#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t, a, b, c;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    long long y = (c + b - a + 2) / 2;
    if (y < 0) y = 0;
    cout << max((long long)0, c - y + 1) << "\n";
  }
}
