This problem was posted by HackerEarth.
Problem Statement:
Find the answer of (ABC)%M.
Input :
TThe only line of input consists of four integers A, B, C and M. The input always has C and M such that gcd(C, M)=1.
Output :
Print the answer as asked in the problem statement.
Constraints :
1≤A,B,C,M≤109
gcd(C,M)=1.
gcd(C,M)=1.
Sample Input 0
2 3 4 5
Sample Output 0
2
No comments:
Post a Comment