Pagini recente » Cod sursa (job #2331645) | Profil andreeaanbrus | Monitorul de evaluare | Monitorul de evaluare | Cod sursa (job #274364)
Cod sursa(job #274364)
include <fstream.h>
include <math.h>
ifstream f("gfact.in");
ofstream g("gfact.out");
long long p, A, factmax,temp=1;
int q;
void ReadData()
{
f>>p>>q;
f.close();
}
void CX()
{
A=pow(p,q);
factmax=p*q;
}
int CX2()
{
for(long x=2;x<=factmax;x++)
{
temp=temp * x;
if(temp%A==0 && temp>=A)
return x;
}
}
int main(){
ReadData();
CX();
g<<CX2();
g.close();
return 0;
}