#include #include #include #include #include using namespace std; #define LOCAL #define INF 0x3f3f3f3f #define MAX_N 10000 int main() { int T, n, m; cin >> T; while(T--) { cin >> n >> m; cout << n/2 + m/2 << endl; } return 0; }