import math

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

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

def f1(l):

    a, b = l

    return a

def f2(l):

    a, b = l

    return b

sword.sort(key = f2)

sword.sort(key = f1)

amax, b1 = sword[-1]

sword.sort(key = f2)

dam = 0

ans = 0

while sword:

    a, b = sword.pop()

    if b < amax:

        break

    else:

        dam += b

        ans += 1 

        if dam >= H:

            break

if dam < H:

    dam -= b1

    ans -= 1

    ans += max(math.ceil((H-dam-b1)/amax), 0) + 1

print(ans)
import math

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

As = []

Bs = []

for i in range(N):

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

    As.append(a)

    Bs.append(b)

As.sort()

Bs.sort()

amax = As[-1]

ans = 0

dam = 0

while Bs:

    b = Bs.pop()

    if b < amax or dam >= H:

        break

    else:

        ans += 1

        dam += b

if dam < H:

    ans += math.ceil((H-dam)/amax)

print(ans)
import math

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


def f1(l):
    a, b = l
    return a


def f2(l):
    a, b = l
    return b


sword.sort(key=f2)
sword.sort(key=f1)
amax, b1 = sword[-1]
sword.sort(key=f2)
dam = 0
ans = 0
while sword:
    a, b = sword.pop()
    if b < amax:
        break
    else:
        dam += b
        ans += 1
        if dam >= H:
            break
if dam < H:
    dam -= b1
    ans -= 1
    ans += max(math.ceil((H - dam - b1) / amax), 0) + 1
print(ans)

import math

N, H = list(map(int, input().split()))
As = []
Bs = []
for i in range(N):
    a, b = list(map(int, input().split()))
    As.append(a)
    Bs.append(b)
As.sort()
Bs.sort()
amax = As[-1]
ans = 0
dam = 0
while Bs:
    b = Bs.pop()
    if b < amax or dam >= H:
        break
    else:
        ans += 1
        dam += b
if dam < H:
    ans += math.ceil((H - dam) / amax)
print(ans)

-sword = [list(map(int, input().split())) for _ in range(N)] - - -def f1(l): -    a, b = l -    return a - - -def f2(l): -    a, b = l -    return b - - -sword.sort(key=f2) -sword.sort(key=f1) -amax, b1 = sword[-1] -sword.sort(key=f2) +As = [] +Bs = [] +for i in range(N): +    a, b = list(map(int, input().split())) +    As.append(a) +    Bs.append(b) +As.sort() +Bs.sort() +amax = As[-1] +ans = 0 -ans = 0 -while sword: -    a, b = sword.pop() -    if b < amax: +while Bs: +    b = Bs.pop() +    if b < amax or dam >= H: +        ans += 1 -        ans += 1 -        if dam >= H: -            break -    dam -= b1 -    ans -= 1 -    ans += max(math.ceil((H - dam - b1) / amax), 0) + 1 +    ans += math.ceil((H - dam) / amax)