#include using namespace std; int n,x,y; int main() { scanf("%d",&n); for (int i=1;i<=n;++i) { scanf("%d%d",&x,&y); printf("%d\n",x/2+y/2); } return 0; }