from math import ceil



from numpy import cumsum





def solve(string):

    n, h, *ab = list(map(int, string.split()))

    max_a = max(ab[::2])

    cnt = 0

    b = sorted([b for b in ab[1::2] if b > max_a], reverse=True)

    if sum(b) < h:

        cnt = len(b) + ceil((h - sum(b)) / max_a)

    else:

        cnt = (cumsum(b) >= h).argmax() + 1

        """

        for _b in b:

            cnt += 1

            h -= _b

            if h <= 0:

                break

        """

    return str(cnt)





if __name__ == '__main__':

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

    print((solve('{} {}\n'.format(n, m) + '\n'.join([eval(input()) for _ in range(n)]))))

from math import ceil





def solve(string):

    n, h, *ab = list(map(int, string.split()))

    max_a = max(ab[::2])

    b = sorted([b for b in ab[1::2] if b > max_a], reverse=True)

    if sum(b) < h:

        cnt = len(b) + ceil((h - sum(b)) / max_a)

    else:

        for i, _b in enumerate(b):

            cnt = i + 1

            h -= _b

            if h <= 0:

                break

    return str(cnt)





if __name__ == '__main__':

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

    print((solve('{} {}\n'.format(n, m) + '\n'.join([eval(input()) for _ in range(n)]))))

from math import ceil
from numpy import cumsum


def solve(string):
    n, h, *ab = list(map(int, string.split()))
    max_a = max(ab[::2])
    cnt = 0
    b = sorted([b for b in ab[1::2] if b > max_a], reverse=True)
    if sum(b) < h:
        cnt = len(b) + ceil((h - sum(b)) / max_a)
    else:
        cnt = (cumsum(b) >= h).argmax() + 1
        """
        for _b in b:
            cnt += 1
            h -= _b
            if h <= 0:
                break
        """
    return str(cnt)


if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    print(
        (solve("{} {}\n".format(n, m) + "\n".join([eval(input()) for _ in range(n)])))
    )

from math import ceil


def solve(string):
    n, h, *ab = list(map(int, string.split()))
    max_a = max(ab[::2])
    b = sorted([b for b in ab[1::2] if b > max_a], reverse=True)
    if sum(b) < h:
        cnt = len(b) + ceil((h - sum(b)) / max_a)
    else:
        for i, _b in enumerate(b):
            cnt = i + 1
            h -= _b
            if h <= 0:
                break
    return str(cnt)


if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    print(
        (solve("{} {}\n".format(n, m) + "\n".join([eval(input()) for _ in range(n)])))
    )

-from numpy import cumsum -    cnt = 0 -        cnt = (cumsum(b) >= h).argmax() + 1 -        """ -        for _b in b: -            cnt += 1 +        for i, _b in enumerate(b): +            cnt = i + 1 -        """