Modular
InputThe first line contains a positive integer N (N <= 250000).
The next N lines contain three space separated positive integers each A,B,M (2 <= A,B,M <= 10^18)
The next N lines contain three space separated positive integers each A,B,M (2 <= A,B,M <= 10^18)
OutputOutput N lines. Each line should contain the remainder of dividing A*B by M.
Input:
Output:
Input:
Output:
1
20 5 84
Output:
16Input:
2
5555555555555555 2222222222222222 7777777777777777
2 5 10
Output:
1111111111111111
0Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.