import sys



N, H = list(map(int, sys.stdin.readline().split()))



katanas = []

for i in range(N):

    a, b = list(map(int, sys.stdin.readline().split()))

    katanas.append((a, b, i))



sk = sorted(katanas, reverse=True)

max_k = sk[0][0]



katanas.sort(key = lambda x:x[1], reverse=True)

ans = 0

i = 0

while H > 0:

    if i < N and katanas[i][1] > max_k:

        H -= katanas[i][1]

        i += 1

        ans += 1

    else:

        tmp = (H - 1) // max_k + 1

        H -= tmp * max_k

        ans += tmp

        

print(ans)
import sys



input = sys.stdin.readline



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

katanas = []

for _ in range(N):

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

    katanas.append((a, b))



max_a = sorted(katanas, reverse=True)[0][0]

throws = []

for a, b in katanas:

    if max_a < b:

        throws.append(b)



ans = 0

for b in sorted(throws, reverse=True):

    H -= b

    ans += 1

    if H <= 0:

        print(ans)

        sys.exit()



print((ans + (H - 1) // max_a + 1))
import sys

N, H = list(map(int, sys.stdin.readline().split()))
katanas = []
for i in range(N):
    a, b = list(map(int, sys.stdin.readline().split()))
    katanas.append((a, b, i))
sk = sorted(katanas, reverse=True)
max_k = sk[0][0]
katanas.sort(key=lambda x: x[1], reverse=True)
ans = 0
i = 0
while H > 0:
    if i < N and katanas[i][1] > max_k:
        H -= katanas[i][1]
        i += 1
        ans += 1
    else:
        tmp = (H - 1) // max_k + 1
        H -= tmp * max_k
        ans += tmp
print(ans)

import sys

input = sys.stdin.readline
N, H = list(map(int, input().split()))
katanas = []
for _ in range(N):
    a, b = list(map(int, input().split()))
    katanas.append((a, b))
max_a = sorted(katanas, reverse=True)[0][0]
throws = []
for a, b in katanas:
    if max_a < b:
        throws.append(b)
ans = 0
for b in sorted(throws, reverse=True):
    H -= b
    ans += 1
    if H <= 0:
        print(ans)
        sys.exit()
print((ans + (H - 1) // max_a + 1))

-N, H = list(map(int, sys.stdin.readline().split())) +input = sys.stdin.readline +N, H = list(map(int, input().split())) -for i in range(N): -    a, b = list(map(int, sys.stdin.readline().split())) -    katanas.append((a, b, i)) -sk = sorted(katanas, reverse=True) -max_k = sk[0][0] -katanas.sort(key=lambda x: x[1], reverse=True) +for _ in range(N): +    a, b = list(map(int, input().split())) +    katanas.append((a, b)) +max_a = sorted(katanas, reverse=True)[0][0] +throws = [] +for a, b in katanas: +    if max_a < b: +        throws.append(b) -i = 0 -while H > 0: -    if i < N and katanas[i][1] > max_k: -        H -= katanas[i][1] -        i += 1 -        ans += 1 -    else: -        tmp = (H - 1) // max_k + 1 -        H -= tmp * max_k -        ans += tmp -print(ans) +for b in sorted(throws, reverse=True): +    H -= b +    ans += 1 +    if H <= 0: +        print(ans) +        sys.exit() +print((ans + (H - 1) // max_a + 1))