It is a few minutes before the most anticipated hockey game of the year - the Geese vs. the Kangaroos. However, Mike is excited about the game for a different reason, namely, the possibility of making a fortune from betting!
Mike can bet any non-negative amount of money that the Geese will win, including non-integer denominations. If he bets dollars that the Geese will win, and he wins the bet, then he will receive dollars as a reward. However, if he loses the bet, then he will not get any money back for that bet.
Similarly, Mike can bet any non-negative amount of money that the Kangaroos will win, including non-integer denominations. If he bets dollars that the Kangaroos will win, and he wins the bet, then he will receive dollars as a reward. However, if he loses the bet, then he will not get any money back for that bet.
Being sneaky, Mike can even bet on both teams at once! Note that there are never any ties, so exactly one team out of the Geese and the Kangaroos will win.
Luckily for him, the bookkeepers this year aren't very bright, and so, it may be possible to always make a profit regardless of the outcome of the match. Can you help Mike make a fortune by determining whether he can guarantee that he will receive strictly more money as a reward than the money he bets?
You will have to determine this answer for different scenarios.
Constraints
Subtask 1 [30%]
It is guaranteed that if it is possible for Mike to always receive more money than he bets, he can do so by betting a whole number of dollars at most that the Geese will win, and by betting a whole number of dollars at most that the Kangaroos will win.
Subtask 2 [70%]
No additional constraints.
Input Specification
The first line contains a single integer, , representing the number of scenarios.
Each of the following lines represents a different scenario, containing four space separated integers .
Output Specification
For each of the scenarios, on a separate line, output YES
if it is possible for Mike to guarantee that he will receive strictly more money than he bets, and NO
otherwise.
Sample Input
2
3 5 3 10
1 2 4 8
Sample Output
YES
NO
Explanation
For the first scenario, Mike can bet dollars that the Geese will win, and dollars that the Kangaroos will win, costing a total of dollars. If the Geese win, then he will receive dollars. If the Kangaroos win, then he will receive dollars. Either way, Mike will receive more money than he bets.
For the second scenario, although Mike can guarantee that he will not lose any money, he is unable to guarantee that he will gain money.
Comments
Damn this is literally just a math question... and not a particularly simple one!