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