Problem C. Problem C. Calculate

时间限制 3000 ms   内存限制 512 MB

Given A, B, C, Calculate

Where φ(n) denotes the number of positive integers ≤ n that are relatively prime to n.
 

输入数据

The first line of the input contains an integer T , denoting the number of test cases. In each test case, there are three integers A, B, C in one line, as described above.
1 ≤ T ≤ 10, 0 < A, B, C ≤ 10^7
 

输出数据

For each test case, output one line contains a single integer, denoting the answer modulo 2^30.
 

样例输入

复制
4
96 93 95
970 906 893
92460 95043 54245
9760979 8053227 7156842

样例输出

复制
1114536
28070648
388873924
623507672

提交

请先 登录

© 2025 FAQs Contact About