Hammoudeh met a guy at a programming contest once (let's call him Jim), and Jim was telling him about how good he is at mathematical problems, and how much he knows about the "three-five theorem", a very advanced topic in number theory. Hammoudeh decided to give Jim a problem to test his skills.
You have $3$ numbers, $a$, $b$, and $x$. You can perform any of the following operations any number of times:
1. $a = a + |a - b|$
2. $b = b + |a - b|$
Determine whether or not it's possible to make $a = x$ or $b = x$.
The first line of input contains an integer $T$ ($1 \leq T \leq 10^5$), the number of test cases.
The following $T$ lines each contain $3$ integers, $a$, $b$, and $x$ ($0 \leq a, \space b, \space x \leq 10^9$).
For each test case, output "Yes" (without quotes) if it's possible to make $a = x$ or $b = x$. Otherwise, output "No" (Without quotes).
Jim is TheJuiceBoi's Best Friend {ʘ‿ʘ}
Input | Output |
---|---|
5 6 3 27 1 0 15 5 3 3 4 2 1 7 4 6 Copy
|
YES NO YES NO NO Copy
|