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