#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int s, i, e, rez;
    scanf("%d %d %d", &s, &i, &e);
    if (s <= i) {
      if (e < i - s + 1) {
        printf("0\n");
        continue;
      } else {
        e -= i - s + 1;
        s = i + 1;
      }
    }
    int l = 0, r = e, sr;
    while (l <= r) {
      sr = (l + r) / 2;
      if (i + sr < s + e - sr) {
        l = sr + 1;
        rez = sr;
      } else
        r = sr - 1;
    }
    printf("%d\n", rez + 1);
  }
  return 0;
}
