[Solution] A or B CodeChef Solution | CodeChef Problem Solution 2022
There are two problems in a contest.
- Problem
A
is worth points at the start of the contest. - Problem
B
is worth points at the start of the contest.
Once the contest starts, after each minute:
- Maximum points of Problem
A
reduce by points . - Maximum points of Problem
B
reduce by points.
Solution Click Below:- CLICK HERE
It is known that Chef requires minutes to solve Problem A
correctly and 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 , number of test cases. Then the test cases follow.
- Each test case contains of a single line of input, two integers and - the maximum points for problems and 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.
No comments:
Post a Comment