n,h=list(map(int,input().split()))

a=[0]*n

b=[0]*n

maxa=0

minb=10**9+1

for i in range(n):

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

  maxa=max(maxa,a[i])

for i in range(len(b)):

  if b[i]<maxa:

    b[i]=0

b=sorted(b)[::-1]

ans=0

for i in range(len(b)):

  if b[i]==0:

    break

  h-=b[i]

  ans+=1

  if h<=0:

    print(ans)

    exit(0)

print((ans+h//maxa+(h%maxa!=0)))
import sys

readline = sys.stdin.readline



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

maxA = 0

B = [0] * N

for i in range(N):

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

  B[i] = b

  if maxA < a:

    maxA = a



usefulB = []

for i in range(N):

  if B[i] > maxA:

    usefulB += [B[i]]



usefulB = sorted(usefulB,reverse = True)



cnt = 0

for b in usefulB:

  H -= b

  cnt += 1

  if H <= 0:

    print(cnt)

    break

else:

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

  print(cnt)
n, h = list(map(int, input().split()))
a = [0] * n
b = [0] * n
maxa = 0
minb = 10**9 + 1
for i in range(n):
    a[i], b[i] = list(map(int, input().split()))
    maxa = max(maxa, a[i])
for i in range(len(b)):
    if b[i] < maxa:
        b[i] = 0
b = sorted(b)[::-1]
ans = 0
for i in range(len(b)):
    if b[i] == 0:
        break
    h -= b[i]
    ans += 1
    if h <= 0:
        print(ans)
        exit(0)
print((ans + h // maxa + (h % maxa != 0)))

import sys

readline = sys.stdin.readline
N, H = list(map(int, readline().split()))
maxA = 0
B = [0] * N
for i in range(N):
    a, b = list(map(int, readline().split()))
    B[i] = b
    if maxA < a:
        maxA = a
usefulB = []
for i in range(N):
    if B[i] > maxA:
        usefulB += [B[i]]
usefulB = sorted(usefulB, reverse=True)
cnt = 0
for b in usefulB:
    H -= b
    cnt += 1
    if H <= 0:
        print(cnt)
        break
else:
    cnt += (H + maxA - 1) // maxA
    print(cnt)

-n, h = list(map(int, input().split())) -a = [0] * n -b = [0] * n -maxa = 0 -minb = 10**9 + 1 -for i in range(n): -    a[i], b[i] = list(map(int, input().split())) -    maxa = max(maxa, a[i]) -for i in range(len(b)): -    if b[i] < maxa: -        b[i] = 0 -b = sorted(b)[::-1] -ans = 0 -for i in range(len(b)): -    if b[i] == 0: +import sys + +readline = sys.stdin.readline +N, H = list(map(int, readline().split())) +maxA = 0 +B = [0] * N +for i in range(N): +    a, b = list(map(int, readline().split())) +    B[i] = b +    if maxA < a: +        maxA = a +usefulB = [] +for i in range(N): +    if B[i] > maxA: +        usefulB += [B[i]] +usefulB = sorted(usefulB, reverse=True) +cnt = 0 +for b in usefulB: +    H -= b +    cnt += 1 +    if H <= 0: +        print(cnt) -    h -= b[i] -    ans += 1 -    if h <= 0: -        print(ans) -        exit(0) -print((ans + h // maxa + (h % maxa != 0))) +else: +    cnt += (H + maxA - 1) // maxA +    print(cnt)