#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int test;
  cin >> test;
  for (int tst = 1; tst <= test; ++tst) {
    long long a, b, c;
    cin >> a >> b >> c;
    long long l = 0, r = c;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      if (mid + a > b + c - mid)
        r = mid;
      else
        l = mid;
    }
    long long ans;
    if (l + a > b + c - l)
      ans = l;
    else if (r + a > b + c - r)
      ans = r;
    else {
      cout << 0 << endl;
      continue;
    }
    cout << c - ans + 1 << endl;
  }
  return 0;
}
