-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCHEFRUN.java
More file actions
40 lines (28 loc) · 742 Bytes
/
Copy pathCHEFRUN.java
File metadata and controls
40 lines (28 loc) · 742 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
35
36
37
38
39
40
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
class Ideone{
//https://www.codechef.com/COOK94B/problems/CHEFRUN
public static Scanner scn = new Scanner(System.in);
public static void main (String[] args) throws java.lang.Exception{
int T = scn.nextInt();
while(T-- > 0){
int X1 = scn.nextInt();
int X2 = scn.nextInt();
int X3 = scn.nextInt();
int V1 = scn.nextInt();
int V2 = scn.nextInt();
int d1 = X3 - X1;
double t1 = 1.0*d1 / V1;
int d2 = X2 - X3;
double t2 = 1.0*d2 / V2;
if(t1 < t2)
System.out.println("Chef");
else if(t2 < t1)
System.out.println("Kefa");
else
System.out.println("Draw");
}
}
}