(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (k (read)) (a (loop repeat n collect (read))) (dp (list (cons 0 0)))) (dolist (b a) (let ((new-dp dp)) (dolist (entry dp) (destructuring-bind (s . c) entry (when (< c k) (push (cons (+ s b) (1+ c)) new-dp))) (setf dp new-dp)))) (let ((res (mod (count-if (lambda (entry) (destructuring-bind (s . cnt) entry (and (= cnt k) (<= (mod s 998244353) (mod s 998))))) dp) 998))) (format t "~d~%" res)))) (main)