#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
using vi = vector<int>;
using vi64 = vector<int64>;
using mii = map<int, int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vpii = vector<pii>;
const int inf = 2e9 + 7;
const char nwl = '\n';
const int mxx = 1e6 + 3;
int64 sumV(vi &v) {
  int64 s = 0;
  for (int x : v) {
    s += (int64)x;
  }
  return s;
}
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt;
  cin >> tt;
  while (tt--) {
    int64 str, intt, exp, ans = 0;
    cin >> str >> intt >> exp;
    if (str + exp > intt) {
      if (!exp)
        ans = 1;
      else {
        if (str <= intt) {
          exp = exp - (intt - str);
          str = intt;
        }
        int64 x = (str + intt + exp + 2) / 2;
        ans = str + exp - max(str, x) + 1;
      }
    }
    cout << ans << nwl;
  }
  return 0;
}
