#include <bits/stdc++.h>
using namespace std;
void pathak() {
  long long int n, i, t, s, l, u, d;
  cin >> t;
  while (t--) {
    cin >> s >> i >> n;
    l = 0;
    u = n;
    while (l <= u) {
      d = (l + u) / 2;
      if (i + 2 * d < s + n)
        l = d + 1;
      else
        u = d - 1;
    }
    cout << l << endl;
  }
  return;
}
signed main() {
  long long int test = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (test--) pathak();
  return 0;
}
