#include 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; }