a,b = map(int,input().split(" "))
ar = []
mx = 0
sw = "ON"
k = 0
br = []
for i in range(a):
    l = list(map(int,input().split(" ")))
    ar.append(l)
    br.append(l[1])
    if k <= l[0]:
        k = l[0]
    mx += l[1]
    if mx >= b:
        print(i+1)
        sw = "OFF"
        break
mx = 0
t = 0
for r in br:
    if r > k:
        mx += r
        t += 1
count = 0
if sw == "ON":
    b -= mx
    count += t
    count += b // k
    if b % k > 0:
        count += 1
    print(count)
    