A Subtracting Problem

View as PDF

Submit solution

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

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

1 3
3 2
10 29

Sample Output



  • -4
    EricHan06  commented on Dec. 4, 2021, 8:32 a.m.


  • -7
    MerpDurp  commented on Feb. 3, 2021, 1:28 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.