Binary exponentiation - MarisaOJ: Marisa Online Judge

Binary exponentiation

Time limit: 1000 ms
Memory limit: 256 MB
Given 3 integers a,b,c. Calculate: abmodc ### Input - The first line contains 3 integers a,b,c. ### Output - Print abmodc. ### Constraints - 1≤a,b,c≤1018. ### Example Input: 365 Output: 4