Cod sursa(job #1607614)
Utilizator | Data | 21 februarie 2016 14:11:43 | |
---|---|---|---|
Problema | Invers modular | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
long long X=1,A,N;
ifstream fin("inversmodular.in");
ofstream fout("inversmodular.out");
fin>>A>>N;
while(A*X%N!=1)
{
X++;
}
fout<<X;
fin.close();
fout.close();
return 0;
}