import sys

import math

sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

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

    A, B = [], []

    for _ in range(n):

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

        A.append(a)

        B.append(b)



    B =sorted(B, reverse=True)

    max_a = max(A)

    res = 0

    for i in range(n):

        if B[i] > max_a:

            h -= B[i]

            res += 1

        if h <= 0:

            break



    res += max(0, math.ceil(h / max_a))

    print(res)





if __name__ == '__main__':

    resolve()

import sys

from collections import deque



sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 998244353





def resolve():

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

    A, B = [], []

    for _ in range(n):

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

        A.append(a)

        B.append(b)



    MAX_A = max(A)

    B.sort(reverse=True)

    que = deque(B)



    res = 0

    while h > 0:

        if que and MAX_A < que[0]:

            damage = que.popleft()

            h -= damage

            res += 1

        else:

            res += (h + MAX_A - 1) // MAX_A

            h = 0



    print(res)





if __name__ == '__main__':

    resolve()

import sys
import math

sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    n, h = list(map(int, input().split()))
    A, B = [], []
    for _ in range(n):
        a, b = list(map(int, input().split()))
        A.append(a)
        B.append(b)
    B = sorted(B, reverse=True)
    max_a = max(A)
    res = 0
    for i in range(n):
        if B[i] > max_a:
            h -= B[i]
            res += 1
        if h <= 0:
            break
    res += max(0, math.ceil(h / max_a))
    print(res)


if __name__ == "__main__":
    resolve()

import sys
from collections import deque

sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 998244353


def resolve():
    n, h = list(map(int, input().split()))
    A, B = [], []
    for _ in range(n):
        a, b = list(map(int, input().split()))
        A.append(a)
        B.append(b)
    MAX_A = max(A)
    B.sort(reverse=True)
    que = deque(B)
    res = 0
    while h > 0:
        if que and MAX_A < que[0]:
            damage = que.popleft()
            h -= damage
            res += 1
        else:
            res += (h + MAX_A - 1) // MAX_A
            h = 0
    print(res)


if __name__ == "__main__":
    resolve()

-import math +from collections import deque -mod = 10**9 + 7 +mod = 998244353 -    B = sorted(B, reverse=True) -    max_a = max(A) +    MAX_A = max(A) +    B.sort(reverse=True) +    que = deque(B) -    for i in range(n): -        if B[i] > max_a: -            h -= B[i] +    while h > 0: +        if que and MAX_A < que[0]: +            damage = que.popleft() +            h -= damage -        if h <= 0: -            break -    res += max(0, math.ceil(h / max_a)) +        else: +            res += (h + MAX_A - 1) // MAX_A +            h = 0