Mimi is building a house of cards! However, being the strange person that she is, she has premade layers of cards, with width .
Mimi proceeds to build a house of cards by stacking the layers of cards, one on top of another. However, she realizes that people will become suspicious if the layers are too similar in width, or if the stack grows wider as it gets taller. Thus if layer is stack on top of layer , the width of layer must be at least less than .
Given these constraints, what is the tallest house of cards Mimi can make?
Subtask 1 [20%]
Subtask 2 [80%]
The first line will have two space separated integers, and .
The next line will have space separated integers, , the widths of the card layers.
A single integer, the number of layers in the tallest house of cards Mimi can make.
5 4 7 2 20 9 12