#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
int main() {
  int n;
  cin >> n;
  int s, iq, exp;
  for (int i = 1; i <= n; i++) {
    cin >> s >> iq >> exp;
    if (s > iq + exp)
      cout << exp + 1 << endl;
    else if (s + exp <= iq)
      cout << 0 << endl;
    else
      cout << (exp + s - iq + 1) / 2 << endl;
  }
  return 0;
}
