#include int main() { int t; scanf("%d",&t); int n,m,res; while(t--) { scanf("%d %d",&n,&m); res=n/2+m/2; printf("%d\n",res); } return 0; }