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