#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
inline long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
inline long long power(long long a, long long n, long long m) {
  if (n == 0) return 1;
  long long p = power(a, n / 2, m);
  p = (p * p) % m;
  if (n % 2)
    return (p * a) % m;
  else
    return p;
}
const long long MOD = 1000000007;
const long long MOD1 = 1000000009;
const long long int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t, s, i, e, ans, x;
  cin >> t;
  while (t--) {
    cin >> s >> i >> e;
    x = e + i - s;
    if (x < 0)
      x = 0;
    else {
      x = x / 2;
      x++;
    }
    ans = max((long long)0, e - x + 1);
    cout << ans << "\n";
  }
  return 0;
}
