Wednesday, March 23, 2022

Cup Finals

 It is the World Cup Finals. Chef only finds a match interesting if the skill difference of the competing teams is less than or equal to

.

Given that the skills of the teams competing in the final are

and

respectively, determine whether Chef will find the game interesting or not.

Input Format

  • The first line of input will contain a single integer
, denoting the number of testcases. The description of
  • testcases follows.
  • Each testcase consists of a single line of input containing three space-separated integers
  • , , and
    • — the skill levels of the teams and the maximum skill difference.

    Output Format

    For each testcase, output "YES" if Chef will find the game interesting, else output "NO" (without the quotes). The checker is case-insensitive, so "YeS" and "nO" etc. are also acceptable.

    Constraints

    Sample Input 1

    3
    5 3 4
    5 3 1
    5 5 0
    

    Sample Output 1

    YES
    NO
    YES
    

    Explanation

    Test case

    : The skill difference between the teams is , which is less than the maximum allowed difference of

    .

    Test case

    : The skill difference between the teams is , which is more than the maximum allowed difference of .

    No comments:

    Post a Comment

    मुझे दिल में बसाना आसान नहीं....

    पता है Recently i realised की मुझे दिल में बसाना आसान नहीं है बात-बात पे चिढ़ जाती हूं मैं दिल लगा लूं एक बार तो फिर ज़िद पे अड़...