func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int t;     long long int a, b, c;     cin >> t;     while (t--) {       cin >> a >> b >> c;       long long int max_val = (a + c);       long long int min_val = b;       if (a + c <= b) {         cout << 0 << endl;       } else if (b + c < a) {         cout << c + 1 << endl;       } else {         long long int ans = (max_val - min_val + 1) / 2;         cout << ans << endl;       }     }   }   