#include <bits/stdc++.h>
using namespace std;
long long maxi = LLONG_MIN;
long long mini = LLONG_MAX;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long st, in, ex;
    cin >> st >> in >> ex;
    if (ex == 0) {
      if (st > in) {
        cout << "1" << '\n';
      } else {
        cout << "0" << '\n';
      }
    } else {
      long long p = 0, z = 0;
      p = ceil((double)(st + ex - in) / 2);
      cout << min(ex + 1, max(p, z)) << '\n';
    }
  }
  return 0;
}
