#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline T read() {
  T sum = 0, fg = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') fg = -1;
  for (; isdigit(c); c = getchar()) sum = (sum << 3) + (sum << 1) + (c ^ 0x30);
  return fg * sum;
}
int main() {
  int T = read<int>();
  while (T--) {
    int a = read<int>(), b = read<int>(), c = read<int>();
    int k = floor(double(c - (a - b) - 1) / 2.);
    printf("%d\n", max(min(a + k, b + c) - b + 1, 0));
  }
  return 0;
}
