#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int s, i, e, x, l, r, mid;
    cin >> s >> i >> e;
    if (s + e <= i) {
      cout << "0\n";
      continue;
    }
    l = 0;
    r = e;
    while (r - l > 1) {
      mid = (l + r) / 2;
      if (s + e - mid > i + mid)
        l = mid;
      else
        r = mid;
    }
    if (s + e - r > i + r)
      cout << r + 1 << "\n";
    else
      cout << l + 1 << "\n";
  }
  return 0;
}
