#include <bits/stdc++.h>
int main() {
  long long int a, b, c, x, t;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld %lld %lld", &a, &b, &c);
    if (a < b) {
      if (b - a >= c) {
        printf("0\n");
      } else {
        x = (c - b + a) / 2;
        if ((c - b + a) % 2 != 0) {
          x++;
        }
        printf("%lld\n", x);
      }
    } else {
      if (c >= a - b) {
        x = (a - b + c) / 2;
        if ((a - b + c) % 2 != 0) {
          x++;
        }
        printf("%lld\n", x);
      } else {
        printf("%lld\n", c + 1);
      }
    }
  }
  return 0;
}
