Mai intai trebuie sa te autentifici.
Cod sursa(job #3225192)
Utilizator | Data | 17 aprilie 2024 01:17:15 | |
---|---|---|---|
Problema | Invers modular | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("inversmodular.in");
ofstream fout("inversmodular.out");
int main()
{
long long x;
int a,b,c;
fin>>a>>b;
for(c=1;c<=a;c++)
if(((b*c+1)%a)==0)
x = 1LL * (b*c+1)/a;
fout<<x;
return 0;
}