You are viewing a single comment's thread. Return to all comments →
For Python3
import math from math import pow
a=int(input()) b=int(input()) m=int(input()) print(int(pow(a,b))) print(a**b %m)
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Power - Mod Power
You are viewing a single comment's thread. Return to all comments →
For Python3
import math from math import pow
a=int(input()) b=int(input()) m=int(input()) print(int(pow(a,b))) print(a**b %m)