Pagini recente » Istoria paginii runda/testround13 | Cod sursa (job #491177) | Cod sursa (job #504029) | Cod sursa (job #1124504) | Cod sursa (job #274005)
Cod sursa(job #274005)
#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;
}