n,m = [int(i) for i in input().split()]
l = sorted([[int(i) for i in input().split()] for _ in range(n)],key = lambda x: (x[1]))
l2 = sorted(l,key = lambda x :x[0])

min_atk = l2[n-1][0]
ct = 0
for i in range(len(l)-1,0,-1):
    print(l[i])
    if l[i][1] >= min_atk and m >= 0:
        m -= l[i][1]
        ct += 1
    else:
        break

if m < 0:
    print(ct)
elif m%min_atk == 0:
    ct += m//min_atk
else:
    ct += m//min_atk +1
    
print(ct)