#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  cin >> t;
  while (t--) {
    long long int n, a, b;
    cin >> n >> a >> b;
    long long int an = max(0ll, (a + b - n + 2) / 2);
    cout << max(0ll, b - an + 1) << endl;
  }
}
