from math import ceil

N,H = list(map(int,input().split()))

katana = []

for i in range(N):

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

    katana.append((a,'a'))

    katana.append((b,'b'))

katana.sort()

katana.reverse()

damage = 0

ans = 0

i = 0

while damage < H:

    if katana[i][1] == 'b':

        ans += 1

        damage += katana[i][0]

        i += 1

    else:

        ans += ceil((H-damage)/katana[i][0])

        break



print(ans)
from math import ceil

N,H = list(map(int,input().split()))

ab = [list(map(int,input().split())) for _ in range(N)]



amax = 0

for i in range(N):

    amax = max(amax,ab[i][0])



B = []

for i in range(N):

    if ab[i][1]>amax:

        B.append(ab[i][1])

B.sort(reverse=True)

ans = 0

for b in B:

    H -= b

    ans += 1

    if H <= 0:

        break



if H > 0:

    ans += ceil(H/amax)



print(ans)
from math import ceil

N, H = list(map(int, input().split()))
katana = []
for i in range(N):
    a, b = list(map(int, input().split()))
    katana.append((a, "a"))
    katana.append((b, "b"))
katana.sort()
katana.reverse()
damage = 0
ans = 0
i = 0
while damage < H:
    if katana[i][1] == "b":
        ans += 1
        damage += katana[i][0]
        i += 1
    else:
        ans += ceil((H - damage) / katana[i][0])
        break
print(ans)

from math import ceil

N, H = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(N)]
amax = 0
for i in range(N):
    amax = max(amax, ab[i][0])
B = []
for i in range(N):
    if ab[i][1] > amax:
        B.append(ab[i][1])
B.sort(reverse=True)
ans = 0
for b in B:
    H -= b
    ans += 1
    if H <= 0:
        break
if H > 0:
    ans += ceil(H / amax)
print(ans)

-katana = [] +ab = [list(map(int, input().split())) for _ in range(N)] +amax = 0 -    a, b = list(map(int, input().split())) -    katana.append((a, "a")) -    katana.append((b, "b")) -katana.sort() -katana.reverse() -damage = 0 +    amax = max(amax, ab[i][0]) +B = [] +for i in range(N): +    if ab[i][1] > amax: +        B.append(ab[i][1]) +B.sort(reverse=True) -i = 0 -while damage < H: -    if katana[i][1] == "b": -        ans += 1 -        damage += katana[i][0] -        i += 1 -    else: -        ans += ceil((H - damage) / katana[i][0]) +for b in B: +    H -= b +    ans += 1 +    if H <= 0: +if H > 0: +    ans += ceil(H / amax)