#include <bits/stdc++.h>
using namespace std;
long long a, i, high, low, mid, nstr, ninte;
int main() {
  scanf("%lld", &a);
  long long ans[a], str[a], inte[a], exp[a];
  for (i = 0; i < a; i++) {
    scanf("%lld %lld %lld", &str[i], &inte[i], &exp[i]);
  }
  for (i = 0; i < a; i++) {
    high = exp[i];
    low = 0;
    ans[i] = 0;
    while (low <= high) {
      mid = (high + low) / 2;
      nstr = str[i] + mid;
      ninte = inte[i] + (exp[i] - mid);
      if (nstr > ninte) {
        ans[i] = (exp[i] + 1) - mid;
        high = mid - 1;
      } else {
        low = mid + 1;
      }
    }
  }
  for (i = 0; i < a; i++) {
    printf("%lld\n", ans[i]);
  }
}
