#include #include #include #include #include #include #include #include using namespace std; #define maxn 1000086 int cmp(int a,int b) { return a>b; } int main() { int t; scanf("%d",&t); while(t--) { long long n,m; scanf("%lld%lld",&n,&m); long long sum; sum=n/2+m/2; printf("%lld\n",sum); } return 0; }