#include <bits/stdc++.h>
using namespace std;
const long long int inf = INT32_MAX;
const long long int minf = INT32_MIN;
template <class T>
T cal(T n) {
  return (n * 1ll * (n - 1)) / 2;
}
template <class T>
T mx(T begin, T end) {
  return max_element(begin, end);
}
template <class T>
T mn(T begin, T end) {
  return min_element(begin, end);
}
template <class T>
void getUnique(vector<T>& nums) {
  sort(nums.begin(), nums.end());
  nums.erase(unique(nums.begin(), nums.end()), nums.end());
}
template <class T>
void print(vector<T> nums) {
  for (T i : nums) cout << i << " ";
  cout << "\n";
}
template <class T>
void read(vector<T>& nums) {
  for (T& i : nums) cin >> i;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int a, b, c;
    cin >> a >> b >> c;
    if (a + c <= b) {
      cout << 0 << "\n";
      continue;
    }
    long long int ans = 0;
    long long int l = 0, r = c;
    while (l <= r) {
      long long int mid = l - (l - r) / 2;
      if (a + mid > b + c - mid) {
        ans = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    cout << c - ans + 1 << "\n";
  }
  return 0;
}
