题目描述
Prof. R.K.Vats of NIT Hamirpur has given a problem to the whole class and has imposed a condition that he won't give attendance to those who don't solve it within time. He gave the equation ,
ax+by=c
where a, b, c are three positive integers. The problem is to determine if there exists at least one solution for some integral value of x and y where x, y can be negative or non-negative integers.
Input
Input starts with an integer T denoting the number of test cases. Each test case contains three integers a, b, and c.
Output
For each test case of input print the case number and Yes if there exists at least one solution, print No otherwise.
Constraints
1<=T<=10^5
1<=a, b, c<=10^6
Example
Input:
2
2 4 8
3 6 7
Output:
Case 1: Yes
Case 2: No
Explanation
Example case 1.The equation is 2x+4y=8 and hence for xy
输入格式
见题面
输出格式
见题面