A Subtracting Problem

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

You are given Q queries of the form:

  • a b (-10^9 \le a,b \le 10^9). This query asks for a-b if a < b, and b-a if b \le a.

For each query, print out the desired answer!

Input Specification

The first line will contain the integer Q (1 \le Q \le 10^5).

The next Q lines will each contain a query of the form defined above.

Output Specification

For each query, print the desired answer on its own line.

Sample Input

3
1 3
3 2
10 29

Sample Output

-2
-1
-19

Comments


  • -4
    EricHan06  commented on Dec. 4, 2021, 1:32 p.m.

    Hello


  • -8
    MerpDurp  commented on Feb. 3, 2021, 6:28 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.