import numpy as np

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

amax = 0

lst = []

for i in range(n):

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

    amax = max(amax,a)

    lst.append(b)

lst.sort(reverse = True)



rui = np.cumsum(lst)

cnt = 10**10



for k in range(n):

    if rui[k] > h:

        cnt = min(cnt,k+1)

        break

    else:

        tmp = (h - rui[k]) // amax

        if (h - rui[k]) % amax != 0:

            tmp += 1

        cnt = min(cnt,k+tmp+1)

print(cnt)
import math



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)

x = max(A)

B = sorted(B, reverse=True)



B_lst = []

for i in range(n):

    if B[i] > x:

        B_lst.append(B[i])

        

cnt = 0

damage = 0

ans = None

for i in range(len(B_lst)):

    damage += B_lst[i]

    cnt += 1

    if damage >= h:

        ans = cnt

        break

ans = cnt

if damage < h:

    ans = cnt + math.ceil((h - damage)/x)

print(ans)
import numpy as np

n, h = list(map(int, input().split()))
amax = 0
lst = []
for i in range(n):
    a, b = list(map(int, input().split()))
    amax = max(amax, a)
    lst.append(b)
lst.sort(reverse=True)
rui = np.cumsum(lst)
cnt = 10**10
for k in range(n):
    if rui[k] > h:
        cnt = min(cnt, k + 1)
        break
    else:
        tmp = (h - rui[k]) // amax
        if (h - rui[k]) % amax != 0:
            tmp += 1
        cnt = min(cnt, k + tmp + 1)
print(cnt)

import math

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)
x = max(A)
B = sorted(B, reverse=True)
B_lst = []
for i in range(n):
    if B[i] > x:
        B_lst.append(B[i])
cnt = 0
damage = 0
ans = None
for i in range(len(B_lst)):
    damage += B_lst[i]
    cnt += 1
    if damage >= h:
        ans = cnt
        break
ans = cnt
if damage < h:
    ans = cnt + math.ceil((h - damage) / x)
print(ans)

-import numpy as np +import math -amax = 0 -lst = [] +A = [] +B = [] -    amax = max(amax, a) -    lst.append(b) -lst.sort(reverse=True) -rui = np.cumsum(lst) -cnt = 10**10 -for k in range(n): -    if rui[k] > h: -        cnt = min(cnt, k + 1) +    A.append(a) +    B.append(b) +x = max(A) +B = sorted(B, reverse=True) +B_lst = [] +for i in range(n): +    if B[i] > x: +        B_lst.append(B[i]) +cnt = 0 +damage = 0 +ans = None +for i in range(len(B_lst)): +    damage += B_lst[i] +    cnt += 1 +    if damage >= h: +        ans = cnt -    else: -        tmp = (h - rui[k]) // amax -        if (h - rui[k]) % amax != 0: -            tmp += 1 -        cnt = min(cnt, k + tmp + 1) -print(cnt) +ans = cnt +if damage < h: +    ans = cnt + math.ceil((h - damage) / x) +print(ans)