from bisect import bisect_right

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

A = []

B = []

for _ in range(N):

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

    A.append(a)

    B.append(b)

A = sorted(A,reverse=True)

B = sorted(B)

a = A[0]

ind = bisect_right(B,a)

cnt = 0

flag = 0

for i in range(N-1,ind-1,-1):

    H -= B[i]

    cnt += 1

    if H<=0:

        flag = 1

        break

if flag==0:

    k = H//a

    if H%a>0:

        k += 1

    cnt += k

print(cnt)
import math

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

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

a = 0

for i in range(N):

    if A[i][0]>a:

        a = A[i][0]

B = []

for i in range(N):

    if A[i][1]>a:

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

B = sorted(B,reverse=True)

totB = sum(B)

if totB>=H:

    flag = 0

    tot = 0

    for i in range(len(B)):

        tot += B[i]

        if tot>=H:

            flag = i+1

            break

    print(flag)

else:

    h = H-totB

    n = len(B)+math.ceil(h/a)

    print(n)
from bisect import bisect_right

N, H = list(map(int, input().split()))
A = []
B = []
for _ in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)
A = sorted(A, reverse=True)
B = sorted(B)
a = A[0]
ind = bisect_right(B, a)
cnt = 0
flag = 0
for i in range(N - 1, ind - 1, -1):
    H -= B[i]
    cnt += 1
    if H <= 0:
        flag = 1
        break
if flag == 0:
    k = H // a
    if H % a > 0:
        k += 1
    cnt += k
print(cnt)

import math

N, H = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
a = 0
for i in range(N):
    if A[i][0] > a:
        a = A[i][0]
B = []
for i in range(N):
    if A[i][1] > a:
        B.append(A[i][1])
B = sorted(B, reverse=True)
totB = sum(B)
if totB >= H:
    flag = 0
    tot = 0
    for i in range(len(B)):
        tot += B[i]
        if tot >= H:
            flag = i + 1
            break
    print(flag)
else:
    h = H - totB
    n = len(B) + math.ceil(h / a)
    print(n)

-from bisect import bisect_right +import math -A = [] +A = [list(map(int, input().split())) for _ in range(N)] +a = 0 +for i in range(N): +    if A[i][0] > a: +        a = A[i][0] -for _ in range(N): -    a, b = list(map(int, input().split())) -    A.append(a) -    B.append(b) -A = sorted(A, reverse=True) -B = sorted(B) -a = A[0] -ind = bisect_right(B, a) -cnt = 0 -flag = 0 -for i in range(N - 1, ind - 1, -1): -    H -= B[i] -    cnt += 1 -    if H <= 0: -        flag = 1 -        break -if flag == 0: -    k = H // a -    if H % a > 0: -        k += 1 -    cnt += k -print(cnt) +for i in range(N): +    if A[i][1] > a: +        B.append(A[i][1]) +B = sorted(B, reverse=True) +totB = sum(B) +if totB >= H: +    flag = 0 +    tot = 0 +    for i in range(len(B)): +        tot += B[i] +        if tot >= H: +            flag = i + 1 +            break +    print(flag) +else: +    h = H - totB +    n = len(B) + math.ceil(h / a) +    print(n)