## Problem

There is a cricket match going on between two teams $A$ and $B$.

Team $B$ is batting second and got a target of $X$ runs. Currently, team $B$ has scored $Y$ runs. Determine how many more runs Team $B$ 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 $T$, denoting the number of test cases.
- Each test case consists of two space-separated integers $X$ and $Y$, the target for team $B$ and the current score of team $B$ respectively.

### Output Format

For each test case, output how many more runs team $B$ should score to win the match.

### Constraints

- $1 \leq T \leq 10$
- $50 \leq Y \lt X \leq 200$

### Sample 1:

4 200 50 100 99 130 97 53 51

150 1 33 2

### Explanation:

Test case $1$: The target is $200$ runs and team $B$ has already made $50$ runs. Thus, the team needs to make $200-50 = 150$ runs more, to win the match.

Test case $2$: The target is $100$ runs and team $B$ has already made $99$ runs. Thus, the team needs to make $100-99 = 1$ runs more, to win the match.

Test case $3$: The target is $130$ runs and team $B$ has already made $97$ runs. Thus, the team needs to make $130-97 = 33$ runs more, to win the match.

Test case $4$: The target is $53$ runs and team $B$ has already made $51$ runs. Thus, the team needs to make $53-51= 2$ runs more, to win the match.

**Solution:-**

__Companies interview:-__- Swap adjacent characters
- Double the vowel characters
- Check valid parenthesis
- Print the characters with their frequencies
- Find closest value
- Word Count
- Program of CaesarCipher
- Program to find the perfect city
- Annual Day | Tech Mahindra coding question
- Find the number of pairs in the array whose sum is equal to a given target.

__Wipro :-__

- Update the booking ID | Wipro previous year question paper solution
- Pages in PDF
- Find the location id
- Find the odd digits
- Find the Product ID

__Infytq :-__

__Key Points;-__

__Hackerrank:-__

- Python : missing characters : hackerrank solution
- Python : string transformation | Hackerrank solution
- Active Traders certification test problem | Hackerrank Solution
- Usernames changes certification test problem | Hackerrank Solution
- string Representation of objects certification test hackerrank solution
- Average Function | hackerrank certification problem solution

__C-tutorial:-__

- Micros in C
- Pointer in c
- Function declaration
- Types of user define function
- return type of function
- 2D array

__See more:-__

- c program to convert specified days into years weeks and days
- Print Reverse Hollow Pyramid
- Update the booking ID | Wipro previous year question paper
- Pages in PDF | Wipro previous year question paper
- Sparse Matrix in data structure
- Find the location ID | Wipro previous year Coding question
- find the odd digits | Wipro Coding question
- Find the product id | Wipro Coding question
- Difference between static and dynamic memory allocation
- What is asymptotic Notation

## 0 Comments