#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    long long n, m, k;
    cin >> n >> m >> k;
    if (k == 0) {
      if (n > m)
        puts("1");
      else
        puts("0");
      continue;
    }
    if (m + k - n < 0) {
      cout << k + 1 << endl;
      continue;
    }
    long long A = min(k + 1, (k + 1) - max(0ll, ((m + k - n) / 2 + 1)));
    if (A < 0) A = 0;
    cout << A << endl;
  }
  return 0;
}
