Cod sursa(job #1045891)
| Utilizator | Data | 2 decembrie 2013 11:29:04 | |
|---|---|---|---|
| Problema | Invers modular | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.28 kb |
#include <fstream>
using namespace std;
ifstream in("inversmodular.in");
ofstream out("inversmodular.out");
int n,a,k,p;
int main()
{
in>>a>>n;
k=n-a;
while (k*p+1!=5)
p++;
out<<(n*p+1)/a;
in.close();
out.close();
return 0 ;
}
