#include <bits/stdc++.h>
using namespace std;
typedef struct node {
  long long int val, more = 0, less = 0;
  bool operator<(const node& a) { return val < a.val; }
} node;
const int M = 1e9 + 7;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int cnt = 0;
    int second, i, e;
    cin >> second >> i >> e;
    int x = (i - second + e);
    if (x < 0) {
      cout << e + 1 << "\n";
      continue;
    }
    x >>= 1;
    x = e - x;
    if (x < 0)
      cout << "0\n";
    else if (x == 0) {
      if (second > i)
        cout << "1\n";
      else
        cout << "0\n";
    } else
      cout << x << "\n";
  }
  return 0;
}
