#include<bits/stdc++.h>
using namespace std;
int bigmod(int a, int b, int M)
{
if(b == 0)
return 1;
int x = bigmod(a, b/2, M);
x = (x*x)%M;
int d = bigmod(n, m, c);
using namespace std;
int bigmod(int a, int b, int M)
{
if(b == 0)
return 1;
int x = bigmod(a, b/2, M);
x = (x*x)%M;
if(b%2 == 1)
x = (x*a)%M;
return x;
}
int main()
{
int n, m, c;
cin >> n >> m >> c;
x = (x*a)%M;
return x;
}
int main()
{
int n, m, c;
cin >> n >> m >> c;
int d = bigmod(n, m, c);
cout << d << endl;
return 0;
}
return 0;
}
Comments
Post a Comment