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