We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
long long n1,k1,n2,k2,n,t,i,f,j,l;
cin>>t;
for(i=0;i<t;i++)
{cin>>n1>>k1>>n2>>k2>>n;
if(n1==0 && k1==0)
j=1;
j=pow(n1,k1);
if(n2==0 && k2==0)
l=1;
l=pow(n2,k2);
if (j==0 && l==0)
f=1;
f=pow(j,l);
cout<<f%n<<'\n';
}
giving error in some tests
dont know what is wrong with this code?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Devu Vs Police
You are viewing a single comment's thread. Return to all comments →