GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Wednesday 11 May 2022

[Solution] Dominant Army CodeChef Solution | CodeChef Problem Solution 2022 

In the medieval age, there were 3 kingdoms AB, and C. The army of these kingdom had NANB, and NC soldiers respectively.

You are given that an army with X soldiers can defeat an army with Y soldiers only if X>Y.

An army is said to be dominant if it can defeat both the other armies combined. For example, kingdom C's army will be dominant only if NC>NA+NB.

Solution Click Below:-  CLICK HERE

Determine whether any of the armies is dominant or not.

Input Format

  • The first line contains a single integer T - the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains three integers NANB, and NC - the number of warriors in the armies of kingdoms AB, and C 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, yesyEsYes will be considered identical).

Constraints

  • 1T1000
  • 1NA,NB,NC100

Join Now for Solution:- 

No comments:

Post a Comment