import heapq as hq

s=[]

hq.heapify(s) #sをpriority-q化　O(n log(n))

# a=hq.heappop(s)  #最小値を取り出す O(log(n))

# hq.heappush(s,123) #123をs(priority-q)に追加 O(log(n))

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

for i in range(n):

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

    hq.heappush(s,(-a,False))

    hq.heappush(s,(-b,True))

ans=1

x,y=hq.heappop(s)

h+=x

while y and h>0:

    x,y=hq.heappop(s)

    h+=x

    ans+=1

if h>0:

    ans+=(h-x-1)//-x

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

x=[0]*n

y=0

for i in range(n):

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

    y=max(y,a)

    x[i]=b

cnt=0

x.sort(reverse=1)

for i in x:

    if i>y:

        cnt+=1

        h-=i

    if h<=0:

        print(cnt)

        exit()

print((cnt+(h+y-1)//y))
import heapq as hq

s = []
hq.heapify(s)  # sをpriority-q化　O(n log(n))
# a=hq.heappop(s)  #最小値を取り出す O(log(n))
# hq.heappush(s,123) #123をs(priority-q)に追加 O(log(n))
n, h = list(map(int, input().split()))
for i in range(n):
    a, b = list(map(int, input().split()))
    hq.heappush(s, (-a, False))
    hq.heappush(s, (-b, True))
ans = 1
x, y = hq.heappop(s)
h += x
while y and h > 0:
    x, y = hq.heappop(s)
    h += x
    ans += 1
if h > 0:
    ans += (h - x - 1) // -x
print(ans)

n, h = list(map(int, input().split()))
x = [0] * n
y = 0
for i in range(n):
    a, b = list(map(int, input().split()))
    y = max(y, a)
    x[i] = b
cnt = 0
x.sort(reverse=1)
for i in x:
    if i > y:
        cnt += 1
        h -= i
    if h <= 0:
        print(cnt)
        exit()
print((cnt + (h + y - 1) // y))

-import heapq as hq - -s = [] -hq.heapify(s)  # sをpriority-q化　O(n log(n)) -# a=hq.heappop(s)  #最小値を取り出す O(log(n)) -# hq.heappush(s,123) #123をs(priority-q)に追加 O(log(n)) +x = [0] * n +y = 0 -    hq.heappush(s, (-a, False)) -    hq.heappush(s, (-b, True)) -ans = 1 -x, y = hq.heappop(s) -h += x -while y and h > 0: -    x, y = hq.heappop(s) -    h += x -    ans += 1 -if h > 0: -    ans += (h - x - 1) // -x -print(ans) +    y = max(y, a) +    x[i] = b +cnt = 0 +x.sort(reverse=1) +for i in x: +    if i > y: +        cnt += 1 +        h -= i +    if h <= 0: +        print(cnt) +        exit() +print((cnt + (h + y - 1) // y))