Milly's Rank

3.4

270 votes
Ready, Mathematics, Approved, Easy
Problem

Milly is very much concern about her rank in her class. So to make her feel better , her friend Pranjul will give three numbers to her denoting N, X and Y. N represents the total number of students in the class. Now he has already described about the rank predictor algorithm that he has made for her. According to this algorithm, there are no less than X people who are better than her and no more than Y people are worse than her. Your task is to print the number of different ranks that she can predict using Pranjul's algorithm.

Input

  • First line will have a value of T (No. of test cases).
  • Then for every test case there will be one line containing three space separated values of
    N, X and Y.

Output

  • For every test case print the required answer in a new line.

Constraints

  • 1 ≤ T ≤ 105.
  • 0 ≤ X, Y  ≤ N  ≤  1018.
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Ranks are : 2, 3, 4.

Editor Image

?