Difficulty 571 : Car or Bike
Hazrat Ali
Car or Bike
Chef wants to reach home as soon as possible. He has two options:
- Travel with his
BIKEwhich takes XX minutes. - Travel with his
CARwhich takes YY minutes.
Which of the two options is faster or do they both take same time?
Input Format
- First line will contain TT, number of test cases. Then the test cases follow.
- Each test case contains a single line of input, two integers X,YX,Y representing the time taken to travel with
BIKEandCARrespectively.
Output Format
For each test case, print CAR if travelling with Car is faster, BIKE if travelling with Bike is faster, SAME if they both take the same time.
You may print each character of CAR, BIKE and SAME in uppercase or lowercase (for example, CAR, Car, cAr will be considered identical).
Constraints
- 1≤T≤100
- 1≤X,Y≤10
Sample 1:
3 1 5 4 2 6 6
BIKE CAR SAME
Explanation:
Test case-1: Travelling with BIKE takes 11 minute while travelling with CAR takes 55 minutes. So travelling with BIKE is faster.
Test case-2: Travelling with BIKE takes 44 minutes while travelling with CAR takes 22 minutes. So travelling with CAR is faster.
Test case-3: Travelling with both BIKE and CAR takes the SAME time i.e. 66 minutes.
Solution :
h=int(input())
for i in range(h):
x,y=map(int,input().split())
if x>y:
print("CAR")
elif x==y:
print("SAME")
else:
print("BIKE")