# no.5 numeric blocks # https://yukicoder.me/problems/no/5 box_width = gets.to_i box_num = gets.to_i gets.split.map(&:to_i).sort!.each_with_index{|b_w, index| if (box_width -= b_w) < 0 puts index return end } puts box_num