#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t > 0) {
    t--;
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    int suma = a + b + c;
    if (suma % 2 == 0) suma--;
    suma /= 2;
    int res = suma - b + 1;
    res = min(res, c + 1);
    if (b > suma)
      printf("%d\n", 0);
    else
      printf("%d\n", res);
  }
  return 0;
}
