#include int main(){ int t; scanf("%d", &t); for (; t > 0; t--){ int n, m; scanf("%d%d", &n, &m); printf("%d\n", (n / 2) + (m / 2)); } return 0; }