-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCHEFRUN.java
More file actions
34 lines (31 loc) · 827 Bytes
/
CHEFRUN.java
File metadata and controls
34 lines (31 loc) · 827 Bytes
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
import java.util.Scanner;
public class CHEFRUN
{
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
int t=scan.nextInt();
for(int t_=0;t_<t;t_++)
{
int x1,x2,x3,v1,v2;
double t1,t2;
x1=scan.nextInt();
x2=scan.nextInt();
x3=scan.nextInt();
v1=scan.nextInt();
v2=scan.nextInt();
t1=(double)(x1-x3)/(double) v1;
t2=(double)(x2-x3)/(double) v2;
if(t1<0)
t1=t1*(-1);
if(t2<0)
t2=t2*(-1);
if (t1<t2)
System.out.println("Chef");
else if(t2<t1)
System.out.println("Kefa");
else
System.out.println("Draw");
}
}
}