-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTASTEDEC.java
More file actions
37 lines (31 loc) · 1.16 KB
/
TASTEDEC.java
File metadata and controls
37 lines (31 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* Chef is buying sweet things to prepare for Halloween!
The shop sells both chocolate and candy.
Each bar of chocolate has a tastiness of XX.
Each piece of candy has a tastiness of YY.
One packet of chocolate contains 22 bars, while one packet of candy contains 55 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.*/
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
while(T-->0){
int X=sc.nextInt();
int Y=sc.nextInt();
if(2*X==5*Y){
System.out.println("Either");
}else if(2*X>5*Y){
System.out.println("Chocolate");
}else{
System.out.println("Candy");
}
}
// your code goes here
}
}