import math



n,h = list(map(int, input().split()))

al = []

bl = []

for _ in range(n):

    a,b = list(map(int, input().split()))

    al.append((a,'swing'))

    bl.append((b,'throw'))



abl = al + bl

abl.sort(reverse=True)



remain_h = h

ans = 0

for v in abl:

    damage, command = v

    if command == 'swing':

        ans += math.ceil(remain_h/damage)

        break

    else:

        ans += 1

        remain_h -= damage

        if remain_h <= 0:

            break



print(ans)
n,h = list(map(int, input().split()))

al = []

bl = []

for _ in range(n):

    a,b = list(map(int, input().split()))

    al.append(a)

    bl.append(b)



al.sort(reverse=True)

bl.sort(reverse=True)



amax = al[0]

ans = 0

rem = h

for b in bl:

    if b >= amax:

        rem -= b

        ans += 1

    else:

        break

    if rem <= 0:

        print(ans)

        exit()



cnt = (rem-1)//amax + 1

ans += cnt

print(ans)
import math

n, h = list(map(int, input().split()))
al = []
bl = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    al.append((a, "swing"))
    bl.append((b, "throw"))
abl = al + bl
abl.sort(reverse=True)
remain_h = h
ans = 0
for v in abl:
    damage, command = v
    if command == "swing":
        ans += math.ceil(remain_h / damage)
        break
    else:
        ans += 1
        remain_h -= damage
        if remain_h <= 0:
            break
print(ans)

n, h = list(map(int, input().split()))
al = []
bl = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    al.append(a)
    bl.append(b)
al.sort(reverse=True)
bl.sort(reverse=True)
amax = al[0]
ans = 0
rem = h
for b in bl:
    if b >= amax:
        rem -= b
        ans += 1
    else:
        break
    if rem <= 0:
        print(ans)
        exit()
cnt = (rem - 1) // amax + 1
ans += cnt
print(ans)

-import math - -    al.append((a, "swing")) -    bl.append((b, "throw")) -abl = al + bl -abl.sort(reverse=True) -remain_h = h +    al.append(a) +    bl.append(b) +al.sort(reverse=True) +bl.sort(reverse=True) +amax = al[0] -for v in abl: -    damage, command = v -    if command == "swing": -        ans += math.ceil(remain_h / damage) +rem = h +for b in bl: +    if b >= amax: +        rem -= b +        ans += 1 +    else: -    else: -        ans += 1 -        remain_h -= damage -        if remain_h <= 0: -            break +    if rem <= 0: +        print(ans) +        exit() +cnt = (rem - 1) // amax + 1 +ans += cnt