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