Friday, April 8, 2022

The Cooler Dilemma 1

 The summer is at its peak in Chefland. Chef is planning to purchase a water cooler to keep his room cool. He has two options available:

  • Rent a cooler at the cost of
  • coins per month.
  • Purchase a cooler for
    • coins.

    Given that the summer season will last for

    months in Chefland, help Chef in finding whether he should rent the cooler or not.

    Chef rents the cooler only if the cost of renting the cooler is strictly less than the cost of purchasing it. Otherwise, he purchases the cooler.

    Print

    if Chef should rent the cooler, otherwise print

    .

    Input Format

    • The first line of input will contain an integer
    — the number of test cases. The description of
  • test cases follows.
  • The first and only line of each test case contains three integers
  • , and
    • , as described in the problem statement.

    Output Format

    For each test case, output

    if Chef should rent the cooler, otherwise output

    .

    You may print each character of the string in uppercase or lowercase (for example, the strings

    , , and

    will all be treated as identical).

    Constraints

    Sample Input 1

    3
    5 10 1
    5 10 2
    5 10 3
    

    Sample Output 1

    YES
    NO
    NO
    

    Explanation

    Test case

    : Cost of renting the cooler coins. Cost of purchasing the cooler coins. So, Chef should rent the cooler as the cost of renting the cooler for

    month is strictly less than purchasing it.

    Test case

    : Cost of renting the cooler coins. Cost of purchasing the cooler coins. So, Chef should not rent the cooler as the cost of renting the cooler for

    months is not strictly less than purchasing it.

    Test case

    : Cost of renting the cooler coins. Cost of purchasing the cooler coins. So, Chef should not rent the cooler as the cost of renting the cooler for months is not strictly less than purchasing it.

    No comments:

    Post a Comment

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

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