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