#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int o = 0; o < t; o++) {
    int a, b, c;
    cin >> a >> b >> c;
    int x = (a - b + c + 1) / 2;
    cout << max(min(c + 1, x), 0) << endl;
  }
}
