Chef and Masks CodeChef Solution | CodeChef Problem Solution 2022
Chef is shopping for masks. In the shop, he encounters types of masks:
- Disposable Masks — cost but last only day.
- Cloth Masks — cost but last days.
Chef wants to buy masks to last him days. He will buy the masks which cost him the least. In case there is a tie in terms of cost, Chef will be eco-friendly and choose the cloth masks. Which type of mask will Chef choose?
Input Format
- The first line of input will contain a single integer , denoting the number of test cases. Then the test cases follow.
- Each test case consists of a single line of input, containing two space-separated integers .
Output Format
For each test case, if Chef buys the cloth masks print CLOTH, otherwise print DISPOSABLE.
You may print each character of the string in uppercase or lowercase (for example, the strings cloth, clOTh, cLoTH, and CLOTH will all be treated as identical).
Constraints
Sample Input 1
4
10 100
9 100
88 99
1 11
Sample Output 1
Cloth
Disposable
Cloth
Disposable
Explanation
Test case : The cost of the disposable masks will be , while the cost of the cloth masks will be . Since the price is equal and Chef is eco-friendly, Chef will buy the cloth masks.
Test case : The cost of the disposable masks will be , while the cost of the cloth masks will be . Since the price of disposable masks is less, Chef will buy the disposable masks.
Test case : The cost of the disposable masks will be , while the cost of the cloth masks will be . Since the price of the cloth masks is less, Chef will buy the cloth masks.
Test case : The cost of the disposable masks will be , while the cost of the cloth masks will be . Since the price of disposable masks is less, Chef will buy the disposable masks.
Join Now for Solution:-
No comments:
Post a Comment