#include #include #include #include #include #include #include #define MAX 10010 #define INF 0x7ffff #define MAXM 100100 #define LL long long using namespace std; int main() { int n,m,j,i,t; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); int x=n/2+m/2; printf("%d\n",x); } return 0; }