[Solution] Take discount or Not CodeChef Solution | CodeChef Problem Solution 2022
There are items in a shop. You know that the price of the -th item is . Chef wants to buy all the items.
There is also a discount coupon that costs rupees and reduces the cost of every item by rupees. If the price of an item was initially , it becomes free, i.e, costs .
Determine whether Chef should buy the discount coupon or not. Chef will buy the discount coupon if and only if the total price he pays after buying the discount
Solution Click Below:- CLICK HERE
coupon is strictly less than the price he pays without buying the discount coupon.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases. The description of the test cases follows.
- Each test case consists of two lines of input.
- The first line of the test case contains three space-separated integers — , , and .
- The second line contains space-separated integers — .
Output Format
- For each test case, output
COUPON
if Chef should buy the discount coupon, andNO COUPON
otherwise.
Each letter of the output may be printed in either lowercase or uppercase. For example, the strings coupon
, CouPoN
, and COUPON
will all be treated as equivalent.
No comments:
Post a Comment