407190: GYM102697 161 Haircut

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

161. Haircuttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
This problem is worth 5 points.

After the end of hair salon restrictions of quarantine, many clients come to get their hair cut. Naturally, after months of uncut hair, your client's hairdos can be quite long! Your clients all have a preference of how long their hair needs to be after it is cut, and you can measure how long their hair is once you start cutting their hair.

You must determine how much hair you have to cut in order to reach the specified length of hair the client requested.

Input

The first line will contain an integer $$$n$$$ which denotes the amount of test cases that will follow. Each line succeeding this value will contain two space separated integers representing the length in hair (in inches), the first one being the length of hair your client has at the beginning of the haircut, and the second being the length of hair your client wishes to have at the end of the haircut.

Output

For each test case, print the amount of hair you must cut in order to fit the client's requirements.

ExampleInput
3
14 8
12 5
25 15
Output
6
7
10

加入题单

算法标签: