[Solution] Determine the Winner CodeChef Solution | CodeChef Problem Solution 2022
There is a contest containing problems and .
strong participants and participated in the contest and solved both the problems.
made AC submissions on problems and at time instants and respectively while made AC submissions on problems and at time instants and .
It is given that the time penalty is the minimum time instant at which a participant has solved both the problems. Also the participant with the lower time penalty will have a better rank.
Determine which participant got the better rank or if there is a TIE
.
Input Format
- The first line will contain , number of test cases. Then the test cases follow.
- Each test case contains a single line of input, four integers .
Output Format
For each test case, output P
if got a better rank, Q
if got a better rank, TIE
otherwise.
Note that output is case-insensitive i.e. P
and p
both are considered the same.
No comments:
Post a Comment