[Solution] Speed Limit Test CodeChef Solution
Problem
Alice is driving from her home to her office which is kilometers away and will take her hours to reach.
Bob is driving from his home to his office which is kilometers away and will take him hours to reach.
Determine who is driving faster, else, if they are both driving at the same speed print EQUAL
.
Input Format
- The first line will contain , the number of test cases. Then the test cases follow.
- Each test case consists of a single line of input, containing four integers and , the distances of Alice's and Bob's home from their offices and the times taken by them to reach there respectively.
Output Format
For each test case, if Alice is faster, print ALICE
. Else if Bob is faster, print BOB
. If both are equal, print EQUAL
.
You may print each character of the string in uppercase or lowercase (for example, the strings equal
, equAL
, EquAl
, and EQUAL
will all be treated as identical).
Explanation:
Test case : Since Bob travels the distance between his office and house in hours, whereas Alice travels the same distance of kms in hours, BOB
is faster.
Test case : Since Alice travels the distance of km between her office and house in hours and Bob travels a distance of km in hours, they have equal speeds.
Test case : Since Alice travels the distance of km between her office and house in hour and Bob travels only a distance of km in the same time, ALICE
is faster.
No comments:
Post a Comment