#include <bits/stdc++.h>
using namespace std;
long long powermodm(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long modInv(long long x, long long M) { return powermodm(x, M - 2, M); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long str, inte, exp;
    cin >> str >> inte >> exp;
    if (str <= inte) {
      if (exp > (inte - str)) {
        long long diff = (inte - str) + 1;
        exp -= diff;
        str += diff;
      } else {
        cout << 0 << '\n';
        continue;
      }
    }
    long long low = 0, high = exp, mid, ans = exp;
    while (low <= high) {
      mid = (low + high) / 2;
      if (str + mid > inte + (exp - mid)) {
        ans = min(ans, mid);
        high = mid - 1;
      } else {
        low = mid + 1;
      }
    }
    cout << (exp - ans + 1) << '\n';
  }
  return 0;
}
