#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long double s, m, e;
    cin >> s >> m >> e;
    long double k = (s + e) - m;
    if (k < 0) {
      k = 0;
    }
    cout.precision(9);
    cout << min(e + 1, ceil(k / 2)) << endl;
  }
}
