hfut1190真心最水同余方程,直接暴力即可

真心伤到了。。还想用神马欧拉定理的。。鸟蛋疼伤不起。。鸟暴力就出来了

#include<iostream>
using namespace std;
int main()
{
    long long int a,n;
    while(cin>>a>>n)
    {
        long long int x=1;
        while((a*x)%n!=1)
        {
            x++;
        }
        cout<<x<<endl;
    }
    return 0;
}

  

posted @ 2012-07-30 10:57  77695  阅读(137)  评论(0编辑  收藏  举报