[Solution] Tasty Decisions CodeChef Solution
Problem
Chef is buying sweet things to prepare for Halloween!
The shop sells both chocolate and candy.
- Each bar of chocolate has a tastiness of .
- Each piece of candy has a tastiness of .
One packet of chocolate contains bars, while one packet of candy contains pieces.
Chef can only buy one packet of something sweet, and so has to make a decision: which one should he buy in order to maximize the total tastiness of his purchase?
Print Chocolate
if the packet of chocolate is tastier, Candy
if the packet of candy is tastier, and Either
if they have the same tastiness.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of one line of input, containing two space-separated integers and — the tastiness of one bar of chocolate and one piece of candy, respectively.
Output Format
For each test case, output on a new line the answer:
Chocolate
if the packet of chocolate is tastier.Candy
if the packet of candy is tastier.Either
if they have the same tastiness.
You may print each character of the output in either uppercase or lowercase, i.e, Candy
, CANDY
, CaNdY
and cANDy
will all be treated as equivalent.
Explanation:
Test case : The packet of chocolate has a tastiness of , while the packet of candy has a tastiness of . The chocolate is tastier.
Test case : The packet of chocolate has a tastiness of , while the packet of candy has a tastiness of . They have the same tastiness.
Test case : The packet of chocolate has a tastiness of , while the packet of candy has a tastiness of . The candy is tastier.
Test case : The packet of chocolate has a tastiness of , while the packet of candy has a tastiness of . The candy is tastier.
No comments:
Post a Comment