#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int str, it, expr;
    cin >> str >> it >> expr;
    if (expr == 0) {
      if (str > it)
        cout << 1 << endl;
      else
        cout << 0 << endl;
      continue;
    }
    if (expr < (str - it)) {
      cout << expr + 1 << endl;
      continue;
    }
    int ans = ((expr + str - it) / 2) + ((expr + str - it)) % 2;
    cout << max(0, ans) << endl;
  }
}
