Revenge of Fibonacci

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 5018
64-bit integer IO format: %I64d      Java class name: Main

Description

In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation
Fn = Fn-1 + Fn-2
with seed values F1 = 1; F2 = 1 (sequence A000045 in OEIS).
---Wikipedia

Today, Fibonacci takes revenge on you. Now the first two elements of Fibonacci sequence has been redefined as A and B. You have to check if C is in the new Fibonacci sequence.

Input

The first line contains a single integer T, indicating the number of test cases.

Each test case only contains three integers A, B and C.

[Technical Specification]
1. 1 <= T <= 100
2. 1 <= A, B, C <= 1 000 000 000

Output

For each test case, output “Yes” if C is in the new Fibonacci sequence, otherwise “No”.

Sample Input

3
2 3 5
2 3 6
2 2 110

Sample Output

Yes
No
Yes

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .