Overflow - MarisaOJ: Marisa Online Judge

Overflow

Time limit: 1000 ms
Memory limit: 256 MB
Given 3 integers a,b,c. Calculate: a×bmodc ### Input - The first line contains 3 integers a,b,c. ### Output - Print a×bmodc. Note that the value of a×b may exceed the capacity of a 64-bit integer data type. ### Constraints - 1≤a,b,c≤1018. ### Example Input: 365 Output: 3