#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, i, j, l, x, r, d, k, m, q, y, w;
  cin >> t;
  while (t--) {
    cin >> n >> m >> k;
    n += k;
    if (n > m && k != 0) {
      d = n - m;
      r = d / 2;
      if (d % 2 != 0) r++;
      q = min(r, k + 1);
      cout << q << endl;
    } else if (k == 0 && n > m) {
      cout << 1 << endl;
    } else
      cout << 0 << endl;
  }
}
