#K68322. Valid Resource Transfer
Valid Resource Transfer
Valid Resource Transfer
You are given three integers representing the resources on three different planets: Xena, Yaro, and Zenon. For each planet with resource value \(R\), define \(\lfloor R/2 \rfloor\) as the number of possible pairs that can be formed. A transfer from one planet (source) to another (target) is considered valid if the resource count on the target planet is less than twice the number of pairs that can be formed from the source planet. Formally, if transferring from a planet with resource \(R_s\) to a planet with resource \(R_t\), the transfer is valid if
[ R_t < 2 \times \left\lfloor \frac{R_s}{2} \right\rfloor ]
Your task is to determine whether there exists at least one valid transfer among any pair of these three planets. For each test case, output YES
if a valid transfer exists, otherwise output NO
.
inputFormat
The first line contains an integer \(T\) denoting the number of test cases. Each test case consists of a single line with three space-separated integers \(R_x, R_y, R_z\), which represent the resources on planets Xena, Yaro, and Zenon respectively.
Input is given via standard input.
outputFormat
For each test case, output a single line containing YES
if there exists at least one valid transfer between any two planets; otherwise, output NO
.
Output should be printed to standard output.
## sample3
10 20 30
5 5 5
12 17 6
YES
NO
YES
</p>