joj2154

来源:互联网 发布:ubuntu怎么安装fcitx 编辑:程序博客网 时间:2024/06/05 21:55

2154: Hungry Rabbits


ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1141400Standard
A group of hungry rabbits had got a basket of carrots, but these carrots isn't enough for all the rabbits to stay alive. So they had a meeting to solve the problem. They determined to drive off some rabbits,then the rest of them could have enough carrots. The number of carrots each rabbit required is given as a nonegetive interger vi, and there's T carrots in the basket. The chairman of rabbit association is a big beautiful and strong rabbit, he was very pity for doing this thing, and he wanted to know the least number of rabbits they would drive off to make the rest of the rabbits stay alive.

Input

There's more than one test case.In each case, there're two positive integers T and N. T stands for the number of carrots in the basket and N(1<=N<=1000) stands for the total number of the rabbits. Then following N lines each contains a nonegetive interger vi. These N intergers stand for the carrots each rabbit needed.

Output

For each test case ,output the least number of rabbits they would drive off!

Sample Input

30 5121423410

Sample Output

2

Problem Source: sea


This problem is used for contest: 23 


Submit / Problem List / Status / Discuss