#include <bits/stdc++.h>
using namespace std;
int main() {
  int task;
  cin >> task;
  while (task--) {
    long long s, i, e;
    cin >> s >> i >> e;
    long long j = min(e + 1, (s + e - i) / 2 + (s + e - i) % 2);
    if (j >= 0)
      cout << j << endl;
    else
      cout << 0 << endl;
  }
}
