#include <bits/stdc++.h>
using namespace std;
long long int check(long long int m, long long int st, long long int iq,
                    long long int ex) {
  long long int str, intelligence, extra;
  str = st + m;
  extra = ex;
  intelligence = iq + extra - m;
  if (str > intelligence) {
    return 1;
  } else
    return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, i, j, st, iq, ex, l, h, m, p;
  cin >> t;
  for (i = 0; i < t; i++) {
    cin >> st >> iq >> ex;
    p = 0;
    if (ex + st == iq || ex + st < iq) {
      cout << 0 << "\n";
    } else if (iq + ex < st) {
      cout << ex + 1 << "\n";
    } else if (ex == 0) {
      if (st > iq) {
        cout << "1\n";
      } else if (st == iq)
        cout << 0 << "\n";
    } else if (ex > 0 && ex + st != iq) {
      l = 0;
      h = ex;
      while (h - l > 1) {
        m = (h + l) / 2;
        p++;
        if (check(m, st, iq, ex) == 1)
          h = m;
        else
          l = m;
      }
      if (p == 0) {
        if (check(l, st, iq, ex) == 1)
          cout << ex - l + 1 << "\n";
        else if (check(h, st, iq, ex) == 1)
          cout << ex - h + 1 << "\n";
      } else if (check(h, st, iq, ex) == 1)
        cout << ex - h + 1 << "\n";
      else
        cout << 0 << "\n";
    }
  }
}
