#include int main() { int n; scanf("%d",&n); while(n--) { __int64 a,b; scanf("%I64d%I64d",&a,&b); printf("%I64d\n",a/2+b/2); } return 0; }