Pagini recente » Cod sursa (job #2737213) | Cod sursa (job #307120) | Cod sursa (job #1741494) | Cod sursa (job #1670370) | Cod sursa (job #3141165)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const long long DIVISOR = 1999999973;
long long power(long long a, long long b, long long c) {
if (b == 0) {
return 1;
}
int num = power(a, b / 2, c);
if (b % 2 == 0) {
return num * num % c;
}
return a * num * num % c;
}
int main() {
int n, p;
fin >> n >> p;
fout << power(n, p, DIVISOR);
return 0;
}