2067 - 剪绳子2
Description

给一长度为n的绳子,要求将其剪成m种长度为a_i小段的绳子,且绳子数量尽可能多。

Input

第一行两个数字n,m;

接下来m个数字a_i;

Output

一个数字,最多能剪的段数

Examples

Input

5 3
5 3 2

Output

2

Input

8 3
5 5 2

Output

4

Input

8 2
3 7

Output

-1
Hint

30%的数据,n,m\leq 20

100%的数据,n \leq 100000, m\leq 1000,a_i \leq 10000

题目参数
Time Limit 1 second
Memory Limit 128 MB
提交次数 87
通过次数 17