#include <bits/stdc++.h>
using namespace std;
const int maxn = 21;
const int maxm = 410;
int main() {
  long long a, b, c;
  int T;
  cin >> T;
  while (T--) {
    cin >> a >> b >> c;
    if (a + c <= b) {
      puts("0");
      continue;
    }
    if (a <= b) {
      c -= (b - a);
      if (c % 2 == 1) {
        printf("%lld\n", c / 2 + 1);
      } else {
        printf("%lld\n", c / 2);
      }
    } else {
      if (b + c < a) {
        printf("%lld\n", c + 1);
      } else {
        long long d = a + b + c;
        if (d % 2 == 1) {
          printf("%lld\n", a + c - (d / 2 + 1) + 1);
        } else {
          printf("%lld\n", a + c - (d / 2 + 1) + 1);
        }
      }
    }
  }
}
