(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (m (read)) (op (ecase (read) (+ #'+) (* #'*))) (b (loop repeat m collect (read)))) (dotimes (_ n) (let* ((a (read))) (format t "~{~a~^ ~}~%" (mapcar (lambda (x) (funcall op x a)) b)))))) (main)