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=max(A)

B=sorted(list([x for x in B if x>a]),reverse=True)

ans=0

while h>0 and B:

    h-=B[0]

    B.pop(0)

    ans+=1

if h>0:

    if h%a==0:

        ans+=h//a

    else:

        ans+=(h//a+1)

print(ans)
from math import ceil

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=max(A)

B=sorted(list([x for x in B if x>a]),reverse=True)

ans=0

i=0

l=len(B)

while h>0 and i<l:

    h-=B[i]

    ans+=1

    i+=1

if h>0:

    ans+=ceil(h/a)

print(ans)
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 = max(A)
B = sorted(list([x for x in B if x > a]), reverse=True)
ans = 0
while h > 0 and B:
    h -= B[0]
    B.pop(0)
    ans += 1
if h > 0:
    if h % a == 0:
        ans += h // a
    else:
        ans += h // a + 1
print(ans)

from math import ceil

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 = max(A)
B = sorted(list([x for x in B if x > a]), reverse=True)
ans = 0
i = 0
l = len(B)
while h > 0 and i < l:
    h -= B[i]
    ans += 1
    i += 1
if h > 0:
    ans += ceil(h / a)
print(ans)

+from math import ceil + -while h > 0 and B: -    h -= B[0] -    B.pop(0) +i = 0 +l = len(B) +while h > 0 and i < l: +    h -= B[i] +    i += 1 -    if h % a == 0: -        ans += h // a -    else: -        ans += h // a + 1 +    ans += ceil(h / a)