#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
const int Z = 1e5 + 1;
const int INF = (int)1e9 + 123;
const ll LLINF = (int)1e18 + 123;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int x, y, z;
    cin >> x >> y >> z;
    if (x + z <= y) {
      cout << 0 << endl;
      continue;
    }
    int m = max(0, (z + y - x + 2) / 2);
    cout << z - m + 1 << endl;
  }
  return 0;
}
