#include <bits/stdc++.h>
using namespace std;
bool p[1000000] = {0};
void primeFacTillN(long n) {
  p[0] = 1;
  p[1] = 1;
  int i = 0;
  for (int i = 2; i <= n; i++) {
    if (!p[i]) {
      for (int j = 2 * i; j <= n; j += i) p[j] = 1;
    }
  }
}
long long baseN(long long a, long long n) {
  if (a < n)
    return a;
  else {
    return (a % n + 10 * baseN((a / n), n));
  }
}
long long binarySearch(long long a[], long long l, long long h, long long k) {
  while (l <= h) {
    long long mid = (l + h) >> 1;
    if (a[k] > mid)
      l = mid + 1;
    else if (a[k] < mid)
      h = mid - 1;
    else
      return mid;
  }
  return -1;
}
long long GCD(long long A, long long B) {
  if (B == 0)
    return A;
  else
    return GCD(B, A % B);
}
int main() {
  long t;
  cin >> t;
  while (t--) {
    long long a, b, n;
    cin >> a >> b >> n;
    long long low = -1, high = n + 1;
    for (long long i = 0; i < 100; i++) {
      long long mid = (low + high) / 2;
      long long k = n - mid;
      if (a + mid > b + k)
        high = mid;
      else
        low = mid;
    }
    cout << n - low;
    cout << endl;
    ;
  }
  return 0;
}
