Pro.ID21975 TitleCoprime Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21975 AC0 Submit0 Ratio- 时间&空间限制描述Please write a program to calculate the k-th positive integer that is coprime with m and n simultaneously. A is coprime with B when their greatest common divisor is 1. 输入The first line contains one integer T representing the number of test cases. For each case, there's one line containing three integers m, n and k ( 0 < m, n, k ≤ 109 ). 输出Description Please write a program to calculate the k-th positive integer that is coprime with m and n simultaneously. A is coprime with B when their greatest common divisor is 1. Input The first line contains one integer T representing the number of test cases. For each case, there's one line containing three integers m, n and k ( 0 < m, n, k ≤ 109 ). Output For each test case, in one line print the case number and the k-th positive integer that is coprime with m and n. Please follow the format of the sample output. Sample Input 3 Sample Output Case 1: 1 Hint case 2: Source 样例输入3 样例输出Case 1: 1 提示case 2: 作者 |