from heapq import heappush, heappop





def solve():

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

    cut_dmgs = []

    thr_dmgs = []

    for _ in range(N):

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

        heappush(cut_dmgs, -a)

        heappush(thr_dmgs, -b)



    ans = 0

    max_cut_dmg = -min(cut_dmgs)

    while thr_dmgs:

        thr_dmg = -heappop(thr_dmgs) 

        if thr_dmg <= max_cut_dmg:

            break

        ans += 1

        H -= thr_dmg

        if H <= 0:

            return ans

    return ans + (H + max_cut_dmg - 1) // max_cut_dmg





print((solve()))

N, H, *blades = list(map(int, open(0).read().split()))

cut = max(blades[::2])

throws = sorted(b for b in blades[1::2] if b >= cut)



ans = 0

while throws:

    H -= throws.pop()

    ans += 1

    if H <= 0:

        print(ans)

        exit()



ans += (H + cut - 1) // cut

print(ans)
from heapq import heappush, heappop


def solve():
    N, H = list(map(int, input().split()))
    cut_dmgs = []
    thr_dmgs = []
    for _ in range(N):
        a, b = list(map(int, input().split()))
        heappush(cut_dmgs, -a)
        heappush(thr_dmgs, -b)
    ans = 0
    max_cut_dmg = -min(cut_dmgs)
    while thr_dmgs:
        thr_dmg = -heappop(thr_dmgs)
        if thr_dmg <= max_cut_dmg:
            break
        ans += 1
        H -= thr_dmg
        if H <= 0:
            return ans
    return ans + (H + max_cut_dmg - 1) // max_cut_dmg


print((solve()))

N, H, *blades = list(map(int, open(0).read().split()))
cut = max(blades[::2])
throws = sorted(b for b in blades[1::2] if b >= cut)
ans = 0
while throws:
    H -= throws.pop()
    ans += 1
    if H <= 0:
        print(ans)
        exit()
ans += (H + cut - 1) // cut
print(ans)

-from heapq import heappush, heappop - - -def solve(): -    N, H = list(map(int, input().split())) -    cut_dmgs = [] -    thr_dmgs = [] -    for _ in range(N): -        a, b = list(map(int, input().split())) -        heappush(cut_dmgs, -a) -        heappush(thr_dmgs, -b) -    ans = 0 -    max_cut_dmg = -min(cut_dmgs) -    while thr_dmgs: -        thr_dmg = -heappop(thr_dmgs) -        if thr_dmg <= max_cut_dmg: -            break -        ans += 1 -        H -= thr_dmg -        if H <= 0: -            return ans -    return ans + (H + max_cut_dmg - 1) // max_cut_dmg - - -print((solve())) +N, H, *blades = list(map(int, open(0).read().split())) +cut = max(blades[::2]) +throws = sorted(b for b in blades[1::2] if b >= cut) +ans = 0 +while throws: +    H -= throws.pop() +    ans += 1 +    if H <= 0: +        print(ans) +        exit() +ans += (H + cut - 1) // cut +print(ans)