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