#include #include #include #include #include #include #include #include #include #include #define LL long long #define pr pair < int, int > using namespace std; LL pow_mod(LL a,LL b){ LL ans=1LL; while(b){ if(b&1)ans=ans*a; a=a*a; b>>=1; } return ans; } //int a,b,c,m,n,w,v,u; int main() { int T;scanf("%d",&T); while(T--){ LL n,m,ans; cin>>n>>m; ans=n/2+m/2; cout<