You play your favourite game yet another time. You chose the character you didn't play before. It has str points of strength and int points of intelligence. Also, at start, the character has exp free experience points you can invest either in strength or in intelligence (by investing one point you can either raise strength by 1 or raise intelligence by 1).

Since you'd like to make some fun you want to create a jock character, so it has more strength than intelligence points (resulting strength is strictly greater than the resulting intelligence).

Calculate the number of different character builds you can create (for the purpose of replayability) if you must invest all free points. Two character builds are different if their strength and/or intellect are different.

Input

The first line contains the single integer T (1 ≤ T ≤ 100) — the number of queries. Next T lines contain descriptions of queries — one per line.

This line contains three integers str, int and exp (1 ≤ str, int ≤ 10^8, 0 ≤ exp ≤ 10^8) — the initial strength and intelligence of the character and the number of free points, respectively.

Output

Print T integers — one per query. For each query print the number of different character builds you can create.

Example

Input


4
5 3 4
2 1 0
3 5 5
4 10 6


Output


3
1
2
0

Note

In the first query there are only three appropriate character builds: (str = 7, int = 5), (8, 4) and (9, 3). All other builds are either too smart or don't use all free points.

In the second query there is only one possible build: (2, 1).

In the third query there are two appropriate builds: (7, 6), (8, 5).

In the fourth query all builds have too much brains.

import java.util.*;
import java.io.*;

public class E1217 {

    public static void pri_result(int i) {
        System.out.println(i);
        System.exit(0);
    }

    public static void SolveA() {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for (int i=0; i< T; i++) {
            int str2 = sc.nextInt();
            int int2= sc.nextInt();
            int exp2= sc.nextInt();
            if (str2 + exp2 <= int2)
                System.out.println(0);
            else {
            int extra = str2 + exp2 - int2;
            int points = extra/2;
            if (extra %2 == 1)
                points ++;
            points = Math.min(points, exp2+1);
            System.out.println(points);
            }
        }
        System.exit(0);
    }

    public static void SolveB() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ai = new int[2 * n + 1];
        int max_r = 0;
        int start_c = -1;
        int end_c = -2;
        int start_0 = 0;

        for (int i = 1; i <= n; i++) {
            ai[i] = sc.nextInt();
            ai[i + n] = ai[i];

            if (ai[i] == 0 && start_0 == 0) {
                start_0 = i;
            }
        }

        for (int i = start_0; i <= n + start_0 - 1; i++) {
            if (ai[i] == 1) {
                if (start_c == -1) {
                    start_c = i;
                }
                end_c = i;
            } else {
                max_r = Math.max(max_r, end_c - start_c + 1);
                start_c = -1;
                end_c = -2;
            }
        }
        max_r = Math.max(max_r, end_c - start_c + 1);
        pri_result(max_r);
    }

    public static void SolveC() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] q = new int[n + 1];
        int[] p = new int[n + 1];
        Integer[] p2 = new Integer[n];
        int mins = 0;

        for (int i = 1; i <= n - 1; i++) {
            q[i] = sc.nextInt();
            p[i] = q[i] + p[i - 1];

            if (p[i] < mins) {
                mins = p[i];
            }
        }
        for (int i = 0; i < n; i++) {
            p[i] += 1 - mins;
            p2[i] = p[i];
        }
        Arrays.sort(p2);
        for (int i = 0; i < n; i++) {
            if (p2[i] != i + 1) {
                pri_result(-1);
            }
        }
        for (int i = 0; i < n; i++) {
            System.out.print(p[i]);
            System.out.print(" ");
        }
        System.out.println();
    }

    static PrintWriter pw;  //Time limit exceeded on test 15

    public static void D_aux(int i, int j) {
        int i1 = i + 1;
        int j1 = j + 1;
        pw.println(i1 + " " + j1);
    }

    public static void SolveD() {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt();
        char[] l = new char[n];
        char[] r = new char[n];
        int[][] lc = new int[27][n + 1];
        int[][] rc = new int[27][n + 1];

        l = sc.next().toCharArray();
        r = sc.next().toCharArray();

        for (int i = 0; i < n; i++) {
            if (l[i] == '?') {
                lc[26][0]++;
                lc[26][lc[26][0]] = i;

            } else {
                int temp = l[i] - 'a';
                lc[temp][0]++;
                lc[temp][lc[temp][0]] = i;
            }

            if (r[i] == '?') {
                rc[26][0]++;
                rc[26][rc[26][0]] = i;

            } else {
                int temp = r[i] - 'a';
                rc[temp][0]++;
                rc[temp][rc[temp][0]] = i;
            }

        }
        int total_m = 0;
        for (int i = 0; i < 26; i++) {
            total_m += Math.min(lc[i][0], rc[i][0]);
        }

        total_m = Math.min(n, total_m + lc[26][0] + rc[26][0]);

        pw.println(total_m);

        int l26_i = 0;
        int r26_i = 0;

        for (int i = 0; i < 26; i++) {
            int j = 0;
            for (; j < lc[i][0] && j < rc[i][0]; j++) {
                D_aux(lc[i][j + 1], rc[i][j + 1]);
            }
            while (j < lc[i][0] && r26_i < rc[26][0]) {
                D_aux(lc[i][j + 1], rc[26][r26_i + 1]);
                j++;
                r26_i++;
            }
            while (j < rc[i][0] && l26_i < lc[26][0]) {
                D_aux(lc[26][l26_i + 1], rc[i][j + 1]);
                j++;
                l26_i++;
            }
        }

        while (l26_i < lc[26][0] && r26_i < rc[26][0]) {
            D_aux(lc[26][l26_i + 1], rc[26][r26_i + 1]);
            l26_i++;
            r26_i++;
        }
        pw.close();

    }

    static int find_i(long value, long[] d) {
        for (int i = 0; i < d.length; i++) {
            if (d[i] <= value) {
                return i + 1;
            }
        }
        return d.length;
    }

    public static void SolveE() {
        Scanner sc = new Scanner(System.in);
        long H = sc.nextLong();
        int n = sc.nextInt();
        int[] d = new int[n];
        long[] par_d = new long[n];
        long min_d = 0;

        for (int i = 0; i < n; i++) {
            d[i] = sc.nextInt();
            if (i == 0) {
                par_d[i] = d[i];
            } else {
                par_d[i] = d[i] + par_d[i - 1];
            }
            if (par_d[i] < min_d) {
                min_d = par_d[i];
            }
        }

        if (H + min_d > 0 && par_d[n - 1] >= 0) {
            pri_result(-1);
        }

        if (H + min_d <= 0) {  // Wrong test #12
            System.out.println(find_i(-1L * H, par_d));
            System.exit(0); // wrong answer on Test #4
        }

        long temp = (H + min_d) / (-1L * par_d[n - 1]);
        long H_temp = H + temp * par_d[n - 1];
        if (H_temp + min_d > 0) {
            temp++;
            H_temp += par_d[n - 1];
        }
        System.out.println(temp * n + find_i(-1L * H_temp, par_d));
    }

public static void main(String args[]) {
        SolveA();
        // SolveB();
        // SolveC();
        // SolveD();
        // SolveE();
    }    
}
