#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
long long int n;
int main() {
  int t;
  cin >> t;
  long long int str, intt, exp, x;
  while (t--) {
    cin >> str >> intt >> exp;
    if (str <= intt) {
      exp -= (intt - str);
      exp--;
      str = intt + 1;
    }
    if (exp < 0) {
      cout << 0 << '\n';
      continue;
    }
    if (intt + exp - str < 0) {
      cout << exp + 1 << '\n';
      continue;
    }
    x = 1 + (intt + exp - str) / 2;
    cout << exp - (x - 1) << '\n';
  }
  return 0;
}
