(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (k (read)) (a (loop repeat n collect (read))) (b (sort (copy-list a) #'<))) (setf b (append b (list 10000000000))) (let ((x (nth (1- k) b)) (c ())) (loop for i from 1 below n when (and (> (nth i a) x) (<= (nth (1- i) a) x)) do (push (1+ i) c)) (format t "~a~%~{~a~^ ~}~%" (length c) (reverse c))))) (main)