I don’t if there is a problem in the logic or what but 5 of the test cases are failing. The code is:
#include
using namespace std;
#define ll long long
int main()
{
ll a,b,c;
cin>>a>>b>>c;
ll ans= 1;
for(ll i=0; i<b; i++)
{
ans*=(a%c);
}
cout<<ans%c<<endl;
}