大概有一个架构了,但是出了大问题
n,c = input().split()
n = int(n)
c = int(c)
a = input().split()
l = []
s = 0
for i in a:
l.append(int(i))
while True:
if s == n:
break
else:
for i in l:
c-=min(l)
if c < 0:
break
else:
l.remove(min(l))
s+=1
print(s)