#include #include #include #include #include #include #include int profit(int b, int s, int c) { int profit; for(int i=1;i<3000;i++) { int profitb = b-i; int profits = c-i; int profitc = (b+c)-i; if(profitc==profits==profitb) { profit = profitb; } } return profit; } int main() { int t; scanf("%i", &t); for(int a0 = 0; a0 < t; a0++){ int b; int s; int c; scanf("%i %i %i", &b, &s, &c); int result = profit(b, s, c); printf("%d\n", result); } return 0; }