#include using namespace std; int profit(int b, int s, int c) { // Return the fixed profit. int j=b,z=s,x=c,i,m,k; for(i=b-1,m=s-1,k=1;i>0;i--,k++,m--) { if(i+k==j&&m+k==s&&i+m+k==x) break; } return k; } int main() { int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int b; int s; int c; cin >> b >> s >> c; int result = profit(b, s, c); cout << result << endl; } return 0; }