-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCABS (Difficulty-399).java
More file actions
35 lines (29 loc) · 885 Bytes
/
CABS (Difficulty-399).java
File metadata and controls
35 lines (29 loc) · 885 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
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner scanner = new Scanner(System.in);
// Read number of test cases
int T = scanner.nextInt();
// Process each test case
for (int i = 0; i < T; i++) {
// Read the prices of the two cab services
int X = scanner.nextInt();
int Y = scanner.nextInt();
// Compare the prices and print the result
if (X < Y) {
System.out.println("FIRST");
} else if (X > Y) {
System.out.println("SECOND");
} else {
System.out.println("ANY");
}
}
// Close the scanner
scanner.close();
}
}