#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int x;
  for (x = 0; x < t; x++) {
    int s, in, e;
    cin >> s >> in >> e;
    if (s + e <= in) {
      cout << 0 << "\n";
      continue;
    } else {
      if (s < in) {
        e = e - (in - s);
        if (e % 2 == 0)
          cout << e / 2 << "\n";
        else
          cout << (e + 1) / 2 << "\n";
      } else {
        int y;
        if (in + e - s < 0) {
          cout << e + 1 << "\n";
          continue;
        }
        if ((in + e - s) % 2 == 0) {
          y = (in + e - s) / 2;
        } else
          y = (in + e - s - 1) / 2;
        cout << e - y << "\n";
      }
    }
  }
  return 0;
}
