#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int INF = 0x3f3f3f3f;
const long long MOD = 1e9 + 7;
int n;
bool check(int k, int a, int b) {
  a = a + k;
  b = b + n - k;
  if (a > b)
    return 1;
  else
    return 0;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b >> n;
    int l = 0;
    int r = n;
    int ans = INF;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (check(mid, a, b)) {
        ans = min(ans, mid);
        r = mid - 1;
      } else
        l = mid + 1;
    }
    if (ans == INF) {
      cout << 0 << endl;
      continue;
    }
    int tmp = n - ans + 1;
    cout << tmp << endl;
  }
  return 0;
}
