#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int str, intel, exp;
    scanf("%d%d%d", &str, &intel, &exp);
    double minia;
    minia = (exp + intel - str) / 2.0;
    if (minia < 0)
      cout << exp + 1 << endl;
    else if (minia > exp)
      cout << 0 << endl;
    else
      printf("%d\n", int(exp - floor(minia)));
  }
  return 0;
}
