Dominant Army Solution Python CodeChef
In the medieval age, there were
kingdoms , , and . The army of these kingdom had , , and soldiers respectively.
You are given that an army with soldiers can defeat an army with soldiers only if .
An army is said to be dominant if it can defeat both the other armies combined. For example, kingdom 's army will be dominant only if .
Determine whether any of the armies is dominant or not.
Input Format
- The first line contains a single integer - the number of test cases. Then the test cases follow.
- The first and only line of each test case contains three integers , , and - the number of warriors in the armies of kingdoms , , and respectively.
Output Format
For each test case, output YES
if any of the armies is dominant. Otherwise, output NO
.
You may print each character of YES
and NO
in uppercase or lowercase (for example, yes
, yEs
, Yes
will be considered identical).
Constraints
Sample Input 1
4
15 5 6
12 13 16
1 1 100
10 10 20
Sample Output 1
YES
NO
YES
NO
Explanation
Test case : The kingdom 's army is dominant since .
Test case : We can observe that none of the armies is dominant.
Test case : The kingdom 's army is dominant since .
Test case : We can observe that none of the armies is dominant. Note that the kingdom 's army is not dominant since .
Dominant Army Solution
Code
0 Comments