## CEQU - Crucial Equation

Let us see the following equation,

ax+by=c

Given three positive integers a, b and c. You have to determine whether there exists at least one solution for some integers value of x and y where x, y may be negative or non-negative integers.

For example if a=2, b=4 and c=8 then the equation will be 2x+4y=8, and hence, for x=2 and y=1, there exists a solution.

Let us see another example for a=3, b=6 and c=7, so the equation will become 3x+6y=7 and there exists no solution satisfying this equation.

Input

Input starts with an integer T (1<=T<=105) denoting the number of test cases. Each test case contains three integers a, b, and c. (1<=a, b, c<=106).

Output

For each test case of input print the case number and “Yes” if there exists at least one solution, print “No” otherwise.

 Sample Input Output for Sample Input 2 2 4 83 6 7 Case 1: Yes Case 2: No

Problem Setter: Md Abdul Alim, Dept. of Computer Science, Bangladesh University of Business & Technology

 < Previous 1 2 3 4 5 6 7 8 Next > pennywise_123: 2023-01-19 14:10:52 Be Careful with output form Last edit: 2023-01-19 14:11:33 dawnwillcome: 2022-07-09 03:48:51 Bézout's Lemma trunghieu06: 2022-07-04 09:04:20 I submitted 4 times because the output format xD ayu_031201: 2022-01-10 07:19:02 output format is this -> cout<<"Case "<