Wrong anti-spam code

Formulation

The user input consists of four positive integers \(m\), \(a\), \(b\), and \(c\). Determine the smallest non-negative integer \(x\) such that \[ax+b\] gives the remainder \(c\) when divided by \(m\). If such an integer \(x\) does not exist, display the message There is no such x.

Your code should replace the text // ??? // below

#include<iostream>
int main(){
    int m,a,b,c; 
    std::cin>>m>>a>>b>>c;
    // ??? //
    return 0;
}
\begin{eqnarray*} \begin{array}{|c|l|l|}\hline \mbox{Test case}&\mbox{Input}&\mbox{Output}\\ \hline 1& 17 \quad5\quad 3\quad 2 & 10 \\ \hline 2& 18 \quad2\quad 8\quad 1 &\mbox{There is no such x}\\ \hline \end{array} \end{eqnarray*}

Your submission


Picture
Prove that you are not a robot.