(defun main () (dotimes (_ (read)) (let* ((n (read)) (m (read))) (princ (max (floor (+ n 3) 4) (floor (+ n m 7) 8))) (terpri)))) (main)