def main():

    from collections import deque

    from math import ceil

    n, h, *ab = list(map(int, open(0).read().split()))

    a = ab[::2]

    *b, = [-x for x in ab[1::2]]

    c = a + b

    c.sort(key=lambda x: abs(x), reverse=True)



    q = deque(c)

    cnt = 0

    while h > 0:

        cnt += 1

        x = q.popleft()

        h -= abs(x)

        if x > 0:

            cnt += ceil(h / x)

            break



    print(cnt)





if __name__ == '__main__':

    main()

def main():

    from math import ceil

    from itertools import accumulate

    from bisect import bisect_left

    n, h, *ab = list(map(int, open(0).read().split()))



    x = max(ab[::2])

    *y, = [i for i in ab[1::2] if i >= x]

    y.sort(reverse=True)

    *z, = accumulate(y)



    if z[-1] <= h:

        print((len(y) + ceil((h - z[-1]) / x)))

    else:

        print((bisect_left(z, h) + 1))





if __name__ == '__main__':

    main()

def main():
    from collections import deque
    from math import ceil

    n, h, *ab = list(map(int, open(0).read().split()))
    a = ab[::2]
    (*b,) = [-x for x in ab[1::2]]
    c = a + b
    c.sort(key=lambda x: abs(x), reverse=True)
    q = deque(c)
    cnt = 0
    while h > 0:
        cnt += 1
        x = q.popleft()
        h -= abs(x)
        if x > 0:
            cnt += ceil(h / x)
            break
    print(cnt)


if __name__ == "__main__":
    main()

def main():
    from math import ceil
    from itertools import accumulate
    from bisect import bisect_left

    n, h, *ab = list(map(int, open(0).read().split()))
    x = max(ab[::2])
    (*y,) = [i for i in ab[1::2] if i >= x]
    y.sort(reverse=True)
    (*z,) = accumulate(y)
    if z[-1] <= h:
        print((len(y) + ceil((h - z[-1]) / x)))
    else:
        print((bisect_left(z, h) + 1))


if __name__ == "__main__":
    main()

-    from collections import deque +    from itertools import accumulate +    from bisect import bisect_left -    a = ab[::2] -    (*b,) = [-x for x in ab[1::2]] -    c = a + b -    c.sort(key=lambda x: abs(x), reverse=True) -    q = deque(c) -    cnt = 0 -    while h > 0: -        cnt += 1 -        x = q.popleft() -        h -= abs(x) -        if x > 0: -            cnt += ceil(h / x) -            break -    print(cnt) +    x = max(ab[::2]) +    (*y,) = [i for i in ab[1::2] if i >= x] +    y.sort(reverse=True) +    (*z,) = accumulate(y) +    if z[-1] <= h: +        print((len(y) + ceil((h - z[-1]) / x))) +    else: +        print((bisect_left(z, h) + 1))