(define (System.out.println x) (begin (display x) (newline) ) ) (let ( (N (read)) (M (read)) ) (let loop( (foo (read)) (bar '()) ) (if (eof-object? foo) (let loop2( (Rmn M) (Empty 0) (Boxes (sort bar <)) ) (cond ((null? Boxes) (System.out.println Empty)) ((< (- Rmn (car Boxes)) 0) (System.out.println Empty)) ((= (- Rmn (car Boxes)) 0) (System.out.println (+ Empty 1))) (else (loop2 (- Rmn (car Boxes)) (+ Empty 1) (cdr Boxes))) ) ) (loop (read) (cons foo bar)) ) ) )