I'm trying write a program to solve equations from the following form:
$$ \begin{align} a \bmod x &= t_1 \\ b \bmod x &= t_2 \\ \end{align} $$
where $a$, $b$, $t_1$ and $t_2$ are known values.
I have multiple equations of the same form and I'd like to solve them for $x$. Assuming I have constraints on $t_1$ and on $t_2$ for some constant $C$:
$$ \begin{align} 0 \le t_1 \lt C \\ 0 \le t_2 \lt C \\ \end{align} $$
e.g : for $a=150$, $b=50$, $t1=2$, $t_2=1$: $$ \begin{align} 150 \bmod x &= 2 \\ 50 \bmod x &= 1 \\ 1, 2 \lt 5 \\ \end{align} $$
What would be the most efficient way to program such a thing?