#include <bits/stdc++.h>
using namespace std;
int Q;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> Q;
  int a, b, c;
  while (Q) {
    cin >> a >> b >> c;
    a += c;
    if (a <= b)
      cout << 0 << '\n';
    else
      cout << min((a - b) / 2 - (a - b + 1) % 2 + 1, c + 1) << '\n';
    Q--;
  }
}
