(defconstant +mod+ 998244353) (defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (a (read)) (b (read)) (fact-table (make-array (1+ n)))) (setf (aref fact-table 0) 1) (loop for i from 1 to n do (setf (aref fact-table i) (mod (* i (aref fact-table (1- i))) +mod+))) (format t "~d~%" (if (= a b) (- (aref fact-table n) (* 2 (aref fact-table (1- n)))) (mod (- (+ (aref fact-table n) (aref fact-table (- n 2))) (* 2 (aref fact-table (1- n)))) +mod+))))) (main)