(defconstant +mod998+ 998) (defconstant +mod9982+ 998244353) (defun dfs (a b c d arr res) (when (zerop c) (when (<= (mod d +mod9982+) (mod d +mod998+)) (incf res))) (when (< a b) (incf d (aref arr a)) (dfs (1+ a) b (1- c) d arr res) (decf d (aref arr a)) (dfs (1+ a) b c d arr res))) (defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (k (read)) (a (make-array n)) (res 0)) (dotimes (i n) (setf (aref a i) (read))) (dfs 0 n k 0 a res) (format t "~d~%" res))) (main)