#include <bits/stdc++.h>
using namespace std;
const int max_n = 1e5 + 5;
int t, a, b, c;
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d", &a, &b, &c);
    int op = (b + c - a), ans;
    if (op % 2 != 0) op--;
    op /= 2;
    if (op < 0)
      ans = c + 1;
    else if (op >= c)
      ans = 0;
    else
      ans = c - op;
    printf("%d\n", ans);
  }
  return 0;
}
