(define ans 0) (define l (read)) (define n (read)) (define w (list)) (let loop((i n)) (set! w (cons (read) w)) (if (> i 1) (loop (- i 1)))) (set! w (sort w)) (define (solve ls) (if (>= l (car ls)) (begin (set! ans (+ ans 1)) (set! l (- l (car ls))) (solve (cdr ls))))) (solve w) (display ans) (newline)