#Lutece0132. Coprime
Coprime
Migrated from Lutece 132 Coprime
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Please write a program to calculate the positive integer that is coprime with and simultaneously. is coprime with when their greatest common divisor is .
Input
The first line contains one integer representing the number of test cases.
For each case, there's one line containing three integers , and ( ).
Output
For each test case, in one line print the case number and the positive integer that is coprime with and .
Please follow the format of the sample output.
Samples
3
6 9 1
6 9 2
6 9 3
Case 1: 1
Case 2: 5
Case 3: 7
Resources
The 5th Guangting Cup Central China Invitatio