国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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ó)家法律
汤原县| 迁安市| 佳木斯市| 米易县| 社旗县| 安仁县| 平果县| 同德县| 游戏| 天镇县| 南通市| 安泽县| 精河县| 大连市| 来宾市| 南岸区| 鹤壁市| 枣阳市| 汝州市| 大田县| 花莲县| 清苑县| 鲜城| 香格里拉县| 新昌县| 景洪市| 峨眉山市| 武乡县| 洞头县| 九台市| 新野县| 柳河县| 天台县| 保靖县| 阳泉市| 惠来县| 清流县| 杭锦旗| 黔南| 垣曲县| 吉木乃县|