Delivery of containers
Problem
Malcolm Reynolds has been asked to deliver empty containers to the outermost planet in the star system. There is only one free cell of
Х
size left on the ship, in which containers can be placed. The captain decided to stack several containers inside each other. All containers are similar in size. A container with a smaller volume fits freely into a container with a volume of 3 conventional units more. What is the maximum number of containers that Captain Reynolds can deliver?
Input
In the first line, a natural number X is entered - the volume of a free cell (a larger load will not fit in a cell). The second line contains the number of containers. In the third line - the volume of each container. All volumes are natural numbers not exceeding 100, the number of containers does not exceed 1000.
Imprint
Print one number — the maximum number of containers that Malcolm Reynolds can deliver.
Examples
# |
Input |
Output |
1 |
60
2
60 63
| 1 |
2 |
26
5
26 24 22 21 18
| 3 |
Запрещенные операторы: sort