#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int li, zhi, ex;
  while (t--) {
    cin >> li >> zhi >> ex;
    if (li <= zhi) {
      ex = ex - zhi + li - 1;
      li = zhi + 1;
      if (ex < 0) {
        cout << 0 << endl;
      } else {
        cout << ex / 2 + 1 << endl;
      }
    } else {
      int he = li + zhi + ex;
      int xiao;
      if (he % 2 == 0) {
        xiao = he / 2 + 1;
      } else {
        xiao = he / 2 + 1;
      }
      cout << li + ex - max(xiao, li) + 1 << endl;
    }
  }
}
