#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c;
    cin >> a >> b >> c;
    if ((a + c) <= b)
      cout << 0 << "\n";
    else if (c == 0)
      cout << 1 << "\n";
    else if (c + b < a)
      cout << c + 1 << "\n";
    else {
      if (a <= b) {
        c -= (b - a);
        a = b;
        cout << c / 2 + c % 2 << "\n";
      } else {
        cout << ((a + c) - b) / 2 + ((a + c) - b) % 2 << "\n";
      }
    }
  }
  return 0;
}
