You are playing around with a construction set of rigid blocks. You would like to stack the blocks to build a tower that is $$$H$$$ inches high. The construction set consists of many copies of blocks of different colors; blocks with the same color are identical and, in particular, all have the same height.
What is the least number of blocks you need to stack on top of each other in order to build a tower of height exactly $$$H$$$ inches?
You may assume that the construction set has infinitely many copies of each color block.
The first line of input consists of two space-separated integers $$$H$$$ and $$$n$$$: the height of the tower that you want to build, in inches ($$$0 \lt H \leq 10^5$$$) and the number of different colors of blocks in the construction set ($$$1 \leq n \leq 10$$$).
The next $$$n$$$ lines each contain an integer $$$h$$$ $$$(1 \leq h \leq 100)$$$: the height, in inches, of the blocks of each of the $$$n$$$ colors.
If it impossible to build a tower of height $$$H$$$ inches, print $$$-1$$$. Otherwise, print the minimum number of blocks you need to stack on top of each other to build the tower.
20 31151
4
99999 624681012
-1