#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const int N = 2e5 + 15;
long long n, m, t, k, q, a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    long long a, b, c;
    cin >> a >> b >> c;
    long long l = 0, r = c, res = c + 1;
    while (l <= r) {
      long long mid = l + r >> 1;
      if ((b + c - a) < 2 * mid)
        res = mid, r = mid - 1;
      else
        l = mid + 1;
    }
    cout << min(c + 1, max(0LL, c - res + 1)) << '\n';
  }
  return 0;
}
