GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Wednesday 1 June 2022

[Solution] Determine the Winner CodeChef Solution | CodeChef Problem Solution 2022

There is a contest containing 2 problems A and B.

2 strong participants P and Q participated in the contest and solved both the problems.

P made AC submissions on problems A and B at time instants PA and PB respectively while Q made AC submissions on problems A and B at time instants QA and QB.

Solution Click Below:-  CLICK HERE

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 T, number of test cases. Then the test cases follow.
  • Each test case contains a single line of input, four integers PA,PB,QA,QB.

Output Format

For each test case, output P if P got a better rank, Q if Q got a better rank, TIE otherwise.

Note that output is case-insensitive i.e. P and p both are considered the same.

Constraints

  • 1T1000
  • 1PA,PB,QA,QB100

No comments:

Post a Comment