[Solution] Reach the Target CodeChef Solution
Problem
There is a cricket match going on between two teams and .
Team is batting second and got a target of runs. Currently, team has scored runs. Determine how many more runs Team should score to win the match.
Note: The target score in cricket matches is one more than the number of runs scored by the team that batted first.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of two space-separated integers and , the target for team and the current score of team respectively.
Output Format
For each test case, output how many more runs team should score to win the match.
Explanation:
Test case : The target is runs and team has already made runs. Thus, the team needs to make runs more, to win the match.
Test case : The target is runs and team has already made runs. Thus, the team needs to make runs more, to win the match.
Test case : The target is runs and team has already made runs. Thus, the team needs to make runs more, to win the match.
Test case : The target is runs and team has already made runs. Thus, the team needs to make runs more, to win the match.
No comments:
Post a Comment