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