Cod sursa(job #2467479)

Utilizator Catalin2002Catalin Craciun Catalin2002 Data 4 octombrie 2019 14:55:11
Problema Invers modular Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.33 kb
#include <iostream>
#include <fstream>
using namespace std;

ifstream fin("inversmodular.in");
ofstream fout("inversmodular.out");

int main()
{
    int n,a,x,i=2;

   fin>>a>>n;

   while(true)
   {
       x=n*i+1;

       if(x%a==0)
       {
           fout<<x;
           break;
       }
   }



    return 0;
}