五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

CF 609A - USB Flash Drives

2023-07-06 12:02 作者:您是打尖兒還是住店呢  | 我要投稿

Sean is trying to save a large file to a USB flash drive. He has?n?USB flash drives with capacities equal to?a1,?a2,?...,?an?megabytes. The file size is equal to?m?megabytes.

Find the minimum number of USB flash drives needed to write Sean's file, if he can split the file between drives.

Input

The first line contains positive integer?n?(1?≤?n?≤?100) — the number of USB flash drives.

The second line contains positive integer?m?(1?≤?m?≤?105) — the size of Sean's file.

Each of the next?n?lines contains positive integer?ai?(1?≤?ai?≤?1000) — the sizes of USB flash drives in megabytes.

It is guaranteed that the answer exists, i. e. the sum of all?ai?is not less than?m.

Output

Print the minimum number of USB flash drives to write Sean's file, if he can split the file between drives.

Examples

input

3
5
2
1
3

output

2

input

3

6
2
3
2

output

3

input

2

5
5
10

output

1

Note

In the first example Sean needs only two USB flash drives — the first and the third.

In the second example Sean needs all three USB flash drives.

In the third example Sean needs only one USB flash drive and he can use any available USB flash drive — the first or the second.

-----------------------------

因?yàn)槭钦易钚〉腢SB數(shù)量,所以對(duì)USB的容量要從大到小去遍歷,每次存儲(chǔ)余量大小,≤0 的時(shí)候,退出循環(huán),記錄當(dāng)前用了多少個(gè)USB,輸出即可;

下面是代碼:


CF 609A - USB Flash Drives的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
宜州市| 慈溪市| 喀喇| 娱乐| 虎林市| 金寨县| 当雄县| 怀安县| 抚顺县| 包头市| 澎湖县| 巴马| 石屏县| 汉源县| 化州市| 新化县| 平江县| 临沂市| 杭锦旗| 和政县| 武功县| 凌云县| 太湖县| 尼勒克县| 松潘县| 岱山县| 宁河县| 百色市| 玉树县| 卫辉市| 怀安县| 齐齐哈尔市| 开平市| 阿尔山市| 潼关县| 三门峡市| 育儿| 铅山县| 巴塘县| 乡宁县| 曲阜市|