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

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

a_featured = ab[:]

b_featured = ab[:]

a_featured = sorted(a_featured, key=lambda x: [x[0], x[1]], reverse=True)

b_featured = sorted(b_featured, key=lambda x: [x[1], x[0]], reverse=True)

a_max = a_featured[0]

ans = 0

for i in range(N):

    if b_featured[i][1] >= a_max[0]:

        H -= b_featured[i][1]

        ans += 1

    if H <= 0:

        print(ans)

        exit()

print((ans + (H-1)//a_max[0] + 1))
N, H = list(map(int, input().split()))

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



ans = 0

attack = []



for a, b in ab:

    attack += [[a, 0]]

    attack += [[b, 1]]



attack = sorted(attack, key=lambda x:(-x[0], x[1]))



for a, i in attack:

    if i == 1:

        H -= a

        ans += 1

        if H <= 0:

            break

    else:

        cnt = (H-1)//a + 1

        ans += cnt

        break



print(ans)
N, H = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(N)]
a_featured = ab[:]
b_featured = ab[:]
a_featured = sorted(a_featured, key=lambda x: [x[0], x[1]], reverse=True)
b_featured = sorted(b_featured, key=lambda x: [x[1], x[0]], reverse=True)
a_max = a_featured[0]
ans = 0
for i in range(N):
    if b_featured[i][1] >= a_max[0]:
        H -= b_featured[i][1]
        ans += 1
    if H <= 0:
        print(ans)
        exit()
print((ans + (H - 1) // a_max[0] + 1))

N, H = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(N)]
ans = 0
attack = []
for a, b in ab:
    attack += [[a, 0]]
    attack += [[b, 1]]
attack = sorted(attack, key=lambda x: (-x[0], x[1]))
for a, i in attack:
    if i == 1:
        H -= a
        ans += 1
        if H <= 0:
            break
    else:
        cnt = (H - 1) // a + 1
        ans += cnt
        break
print(ans)

-a_featured = ab[:] -b_featured = ab[:] -a_featured = sorted(a_featured, key=lambda x: [x[0], x[1]], reverse=True) -b_featured = sorted(b_featured, key=lambda x: [x[1], x[0]], reverse=True) -a_max = a_featured[0] -for i in range(N): -    if b_featured[i][1] >= a_max[0]: -        H -= b_featured[i][1] +attack = [] +for a, b in ab: +    attack += [[a, 0]] +    attack += [[b, 1]] +attack = sorted(attack, key=lambda x: (-x[0], x[1])) +for a, i in attack: +    if i == 1: +        H -= a -    if H <= 0: -        print(ans) -        exit() -print((ans + (H - 1) // a_max[0] + 1)) +        if H <= 0: +            break +    else: +        cnt = (H - 1) // a + 1 +        ans += cnt +        break +print(ans)