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