from math import ceil



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

a, b = [], []

for _ in range(N):

    ta, tb = list(map(int, input().split()))

    a.append(ta)

    b.append(tb)



Ma = max(a)

b = sorted([x for x in b if x > Ma], reverse=True)

lb = len(b)



t = 0

while t < lb:

    H -= b[t]

    t += 1

    if H <= 0:

        break



if H > 0:

    t += ceil(H / Ma)



print(t)

def main():

    import sys

    input = sys.stdin.readline



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



    bs = []

    a_mx = -1

    for _ in range(N):

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

        a_mx = max(a_mx, a)

        bs.append(b)



    bs = [b for b in bs if b > a_mx]

    bs.sort(reverse=True)



    ans = 0

    for b in bs:

        H -= b

        ans += 1

        if H <= 0:

            break

    if H > 0:

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



    print(ans)





if __name__ == '__main__':

    main()

from math import ceil

N, H = list(map(int, input().split()))
a, b = [], []
for _ in range(N):
    ta, tb = list(map(int, input().split()))
    a.append(ta)
    b.append(tb)
Ma = max(a)
b = sorted([x for x in b if x > Ma], reverse=True)
lb = len(b)
t = 0
while t < lb:
    H -= b[t]
    t += 1
    if H <= 0:
        break
if H > 0:
    t += ceil(H / Ma)
print(t)

def main():
    import sys

    input = sys.stdin.readline
    N, H = list(map(int, input().split()))
    bs = []
    a_mx = -1
    for _ in range(N):
        a, b = list(map(int, input().split()))
        a_mx = max(a_mx, a)
        bs.append(b)
    bs = [b for b in bs if b > a_mx]
    bs.sort(reverse=True)
    ans = 0
    for b in bs:
        H -= b
        ans += 1
        if H <= 0:
            break
    if H > 0:
        ans += (H + a_mx - 1) // a_mx
    print(ans)


if __name__ == "__main__":
    main()

-from math import ceil +def main(): +    import sys -N, H = list(map(int, input().split())) -a, b = [], [] -for _ in range(N): -    ta, tb = list(map(int, input().split())) -    a.append(ta) -    b.append(tb) -Ma = max(a) -b = sorted([x for x in b if x > Ma], reverse=True) -lb = len(b) -t = 0 -while t < lb: -    H -= b[t] -    t += 1 -    if H <= 0: -        break -if H > 0: -    t += ceil(H / Ma) -print(t) +    input = sys.stdin.readline +    N, H = list(map(int, input().split())) +    bs = [] +    a_mx = -1 +    for _ in range(N): +        a, b = list(map(int, input().split())) +        a_mx = max(a_mx, a) +        bs.append(b) +    bs = [b for b in bs if b > a_mx] +    bs.sort(reverse=True) +    ans = 0 +    for b in bs: +        H -= b +        ans += 1 +        if H <= 0: +            break +    if H > 0: +        ans += (H + a_mx - 1) // a_mx +    print(ans) + + +if __name__ == "__main__": +    main()