GUPTA MECHANICAL

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

Wednesday 18 May 2022

[Solution] A or B CodeChef Solution | CodeChef Problem Solution 2022

There are two problems in a contest.

  • Problem A is worth 500 points at the start of the contest.
  • Problem B is worth 1000 points at the start of the contest.

Once the contest starts, after each minute:

  • Maximum points of Problem A reduce by 2 points .
  • Maximum points of Problem B reduce by 4 points.
Solution Click Below:-  CLICK HERE

It is known that Chef requires X minutes to solve Problem A correctly and Y minutes to solve Problem B correctly.

Find the maximum number of points Chef can score if he optimally decides the order of attempting both the problems.






Input Format

  • First line will contain T, number of test cases. Then the test cases follow.
  • Each test case contains of a single line of input, two integers X and Y - the maximum points for problems A and B at the start of the contest.

Output Format

For each test case, output in a single line, the maximum number of points Chef can score if he optimally decides the order of attempting both the problems.

Constraints

  • 1T1000

No comments:

Post a Comment