F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Problem C. Calculate

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 725    Accepted Submission(s): 285


Problem Description
Given A, B, C, Calculate

Where ¦Õ(n) denotes the number of positive integers ¡Ü n that are relatively prime to n.
 

Input
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
 

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

Sample Input
4 96 93 95 970 906 893 92460 95043 54245 9760979 8053227 7156842
 

Sample Output
1114536 28070648 388873924 623507672
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-23 19:22:49, Gzip enabled