#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, i, j, k, l, n, m;
  cin >> t;
  while (t--) {
    cin >> n >> m >> k;
    if (n > m) {
      if (k == 0) {
        cout << 1 << endl;
        continue;
      }
      l = n - m - 1;
      if (k >= l) {
        k = k - l;
        l = l + k / 2;
      } else
        l = k;
      cout << 1 + l << endl;
    } else if (n < m) {
      k = k - (m - n);
      if (k > 0)
        cout << k / 2 + k % 2 << endl;
      else
        cout << 0 << endl;
    } else {
      cout << k / 2 + k % 2 << endl;
    }
  }
}
