n,h,*t=list(map(int,open(0).read().split()))

b=sorted(t[1::2])

a=max(t[::2])

c=0

while h>0and b and b[-1]>a:

    h-=b.pop()

    c+=1

if h>0:c-=-h//a

print(c)
n,h,*d=list(map(int,open(0).read().split()))

a=max(d[::2])

b=sorted(d[1::2])

c=0

while b and b[-1]>a>0<h:h-=b.pop();c+=1

print((c--h*(h>0)//a))
n, h, *t = list(map(int, open(0).read().split()))
b = sorted(t[1::2])
a = max(t[::2])
c = 0
while h > 0 and b and b[-1] > a:
    h -= b.pop()
    c += 1
if h > 0:
    c -= -h // a
print(c)

n, h, *d = list(map(int, open(0).read().split()))
a = max(d[::2])
b = sorted(d[1::2])
c = 0
while b and b[-1] > a > 0 < h:
    h -= b.pop()
    c += 1
print((c - -h * (h > 0) // a))

-n, h, *t = list(map(int, open(0).read().split())) -b = sorted(t[1::2]) -a = max(t[::2]) +n, h, *d = list(map(int, open(0).read().split())) +a = max(d[::2]) +b = sorted(d[1::2]) -while h > 0 and b and b[-1] > a: +while b and b[-1] > a > 0 < h: -if h > 0: -    c -= -h // a -print(c) +print((c - -h * (h > 0) // a))