>>555 C++
#include <iostream>
using std::cout;
void f(int p, int x){
int n;
for(n=1; n<p; n++)
if((n*x+1)%p == 0){
cout <<"p="<<p<<" x="<<x<<" -> "<<(x*n+1)/p<<std::endl;
break;
}
if(n==p)
cout <<"p="<<p<<" x="<<x<<" -> "<<"false"<<std::endl;
}
int main(void){
f(213,16);
f(214,16);
f(333,29);
}