#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int tc;
  cin >> tc;
  for (int test = 0; test < tc; ++test) {
    long long int str, inti, exp;
    cin >> str >> inti >> exp;
    long long int right = exp;
    long long int left = 0;
    while (left <= right) {
      int mid = (left + right) / 2;
      if (str + mid > (inti + exp - mid)) {
        right = mid - 1;
      } else
        left = mid + 1;
    }
    cout << exp - left + 1 << endl;
  }
}
