Pagini recente » Profil Tatomir Alex - atatomir | Cod sursa (job #736551) | Cod sursa (job #1233545) | Cod sursa (job #1849148) | Cod sursa (job #2076427)
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
long long N,P;
long long mod(long long a,long long b)
{
if(a>=b)
return mod(a-b,b);
return a;
}
int main()
{
in>>N>>P;
if(!(P%2))
N=pow(N,P/2)*pow(N,P/2);
else N=pow(N,P/2)*pow(N,P/2)*N;
out<<mod(N,1999999973);
return 0;
}