-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCABS.java
More file actions
37 lines (31 loc) · 903 Bytes
/
CABS.java
File metadata and controls
37 lines (31 loc) · 903 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
/*Problem
Chef has to travel to another place. For this, he can avail any one of two cab services.
The first cab service charges XX rupees.
The second cab service charges YY rupees.
Chef wants to spend the minimum amount of money. Which cab service should Chef take?
*/
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();
for(int i=0;i<T;i++){
int X=sc.nextInt();
int Y=sc.nextInt();
if(X < Y){
System.out.println("FIRST");
}
else if(X > Y){
System.out.println("SECOND");
}
else{
System.out.println("ANY");
}
}
}
}