#include #include #include #include #include #include #include #include #include #include #include #define eps 1e-5 #define inf 0x3f3f3f3f #define max(a,b) ((a)>(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b)) #define lson l,m,rt<<1 #define rson m+1,r,rt<<1 | 1 #define lc rt<<1 #define rc rt<<1 | 1 #define getx2(a) ((a)*(a)) #define Pi acos(-1.0) #define N 100010 typedef long long LL; using namespace std; int main() { int t,n,m; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); printf("%d\n",(n/2+m/2)); } return 0; }