import bisect

from math import ceil

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



A=[]

B=[]

for i in range(N):

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

    A.append(a)

    B.append(b)



A=sorted(A)

B=sorted(B)



idx=bisect.bisect_right(B,A[-1])

throw=sum(B[idx:])

if throw<=H:

    ans=N-idx

    res=H-throw

    ans+=ceil(res/A[-1])

    #print(res/A[-1], throw)

else:

    res=H

    ans=0

    for i in range(N):

        ans+=1

        res-=B[-(i+1)]

        if res<=0:

            break

print(ans)

from math import ceil

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



A=[0]*N

B=[0]*N

for i in range(N):

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

    A[i]=a

    B[i]=b



A=sorted(A)

B=sorted(B, reverse=True)

amax=max(A)



ans=0



for i in range(N):

    b=B[i]

    if b>amax:

        H-=b

        ans+=1

        if H<=0:

            break

    else:

        break

if H>0:

    ans+=ceil(H/amax)

print(ans)

import bisect
from math import ceil

N, H = list(map(int, input().split()))
A = []
B = []
for i in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)
A = sorted(A)
B = sorted(B)
idx = bisect.bisect_right(B, A[-1])
throw = sum(B[idx:])
if throw <= H:
    ans = N - idx
    res = H - throw
    ans += ceil(res / A[-1])
    # print(res/A[-1], throw)
else:
    res = H
    ans = 0
    for i in range(N):
        ans += 1
        res -= B[-(i + 1)]
        if res <= 0:
            break
print(ans)

from math import ceil

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

-import bisect -A = [] -B = [] +A = [0] * N +B = [0] * N -    A.append(a) -    B.append(b) +    A[i] = a +    B[i] = b -B = sorted(B) -idx = bisect.bisect_right(B, A[-1]) -throw = sum(B[idx:]) -if throw <= H: -    ans = N - idx -    res = H - throw -    ans += ceil(res / A[-1]) -    # print(res/A[-1], throw) -else: -    res = H -    ans = 0 -    for i in range(N): +B = sorted(B, reverse=True) +amax = max(A) +ans = 0 +for i in range(N): +    b = B[i] +    if b > amax: +        H -= b -        res -= B[-(i + 1)] -        if res <= 0: +        if H <= 0: +    else: +        break +if H > 0: +    ans += ceil(H / amax)