#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define lowbit(x) (x)&(-x) #define REP(i,a,b) for(int i=(a);i<=(b);i++) #define PER(i,a,b) for(int i=(a);i>=(b);i--) #define RVC(i,S) for(int i=0;i<(S).size();i++) #define RAL(i,u) for(int i=fr[u];i!=-1;i=e[i].next) using namespace std; typedef long long LL; typedef pair pii; template inline void read(T& num) { bool start = false, neg = false; char c; num = 0; while ((c = getchar()) != EOF) { if (c == '-') start = neg = true; else if (c >= '0' && c <= '9') { start = true; num = num * 10 + c - '0'; } else if (start) break; } if (neg) num = -num; } /*-------- Header File --------*/ int main() { int T; read(T); while (T--) { int n, m; read(n); read(m); printf("%d\n", n / 2 + m / 2); } return 0; }