#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
long long i, n, r;
long long ncr(long long n, long long r) {
  vector<long long> c(r + 1, 0);
  c[0] = 1;
  for (i = 0; i < n + 1; i++) {
    for (int j = min(i, r); j > 0; j--) c[j] = c[j - 1] + c[j];
  }
  return c[r];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, k, l, n, m, t, cnt = 0, sum = 0;
  cin >> t;
  while (t--) {
    long long str, intel, xp;
    cin >> str >> intel >> xp;
    long long diff;
    long long x1 = max((long long)0, (intel + xp - str + 2) / 2);
    cout << max((long long)0, xp - x1 + 1) << "\n";
  }
}
