(define-syntax readm (syntax-rules (sym str list vec) [(_ list n t ...) (unfold (pa$ = n) (^_ (readm t ...)) (pa$ + 1) 0)] [(_ vec n t ...) (vector-tabulate n (^_ (readm t ...)))] [(_ sym) (read)] [(_ str) (symbol->string (read))])) (define (solve n k vx) (let1 vc (make-vector (+ n 1) 0) (let loop ([i 0] [j 1]) (cond [(> j n) (vector-ref vc n)] [(>= (- (vector-ref vx (- j 1)) (vector-ref vx i)) k) (loop (+ i 1) j)] [else (vector-set! vc j (+ 1 (vector-ref vc i))) (loop i (+ j 1))])))) (define (main args) (let* ([n (read)] [k (read)] [vx (readm vec n sym)]) (print (solve n k vx))) 0)