#include <bits/stdc++.h>
using namespace std;
const int SI = 2e5 + 100;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int str, in, ex;
    cin >> str >> in >> ex;
    if (str + ex <= in)
      cout << 0 << endl;
    else {
      int r = ex;
      int l;
      int tot = (in + ex - str);
      if (tot >= 0) {
        l = tot / 2;
        l++;
      } else
        l = 0;
      cout << r - l + 1 << endl;
    }
  }
  return 0;
}
