I'm given three values $s_0,s_1,s_2 \in \mathbb{Z}_m$ that follows the recursion formular $s_{n+1} = as_n+b \mod m$.
I know $m$ and want to calculate $a,b$. It's easy to see that $a=\frac{s_1-s_2}{s_0-s_1}$ however in my case $gcd(s_0-s_1,m)\neq 1$ thus I'm unable calculate the multiplicative inverse of $s_0-s_1 \mod m$.
Is there any other way of doing this without bruteforcing?