#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int tt;
  cin >> tt;
  int str, init, expe;
  while (tt--) {
    cin >> str >> init >> expe;
    int adds = max((init + expe - str + 2) / 2, 0);
    cout << max(expe - adds + 1, 0) << "\n";
  }
  return 0;
}
