import sys

from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt, floor

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache, reduce

from operator import xor

from heapq import heappush, heappop

INF = float("inf")

sys.setrecursionlimit(10**7)



# 4近傍（右, 下, 左, 上）

dy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]





def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W

def ceil(a, b):return (a + b - 1) // b





def solve(N, H, a_b):

    max_a = -1

    for a, b in a_b:

        max_a = max(max_a, a)



    good_b = []

    for a, b in a_b:

        if b >= max_a:

            good_b.append(b)



    ans = 0

    for b in sorted(good_b, reverse=True):

        ans += 1

        H -= b

        if H <= 0:

            return ans



    return ans + ceil(H, max_a)





def main():

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

    l = []

    for _ in range(N):

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

        l.append((a, b))

    print((solve(N, H, l)))





if __name__ == '__main__':

    main()

#!/usr/bin/python3



from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache

import sys

sys.setrecursionlimit(10000)

INF = float("inf")

YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"

dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]





def inside(y, x, H, W):

    return 0 <= y < H and 0 <= x < W





def ceil(a, b):

    return (a + b - 1) // b





def solve(N, H, A, B):

    a_max = max(A)

    ans = 0

    for b in sorted(B, reverse=True):

        if H <= 0:

            break



        if b > a_max:

            H -= b

            ans += 1

        else:

            break

    if H > 0:

        ans += ceil(H, a_max)

    return ans





def main():

    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)



    print((solve(N, H, A, B)))





if __name__ == '__main__':

    main()

import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache, reduce
from operator import xor
from heapq import heappush, heappop

INF = float("inf")
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool:
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def solve(N, H, a_b):
    max_a = -1
    for a, b in a_b:
        max_a = max(max_a, a)
    good_b = []
    for a, b in a_b:
        if b >= max_a:
            good_b.append(b)
    ans = 0
    for b in sorted(good_b, reverse=True):
        ans += 1
        H -= b
        if H <= 0:
            return ans
    return ans + ceil(H, max_a)


def main():
    N, H = list(map(int, input().split()))
    l = []
    for _ in range(N):
        a, b = list(map(int, input().split()))
        l.append((a, b))
    print((solve(N, H, l)))


if __name__ == "__main__":
    main()

#!/usr/bin/python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys

sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def solve(N, H, A, B):
    a_max = max(A)
    ans = 0
    for b in sorted(B, reverse=True):
        if H <= 0:
            break
        if b > a_max:
            H -= b
            ans += 1
        else:
            break
    if H > 0:
        ans += ceil(H, a_max)
    return ans


def main():
    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)
    print((solve(N, H, A, B)))


if __name__ == "__main__":
    main()

-import sys +#!/usr/bin/python3 -from math import pi, sqrt, floor +from math import pi, sqrt -from functools import lru_cache, reduce -from operator import xor -from heapq import heappush, heappop +from functools import lru_cache +import sys +sys.setrecursionlimit(10000) -sys.setrecursionlimit(10**7) -# 4近傍（右, 下, 左, 上） -dy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0] +YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no" +dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0] -def inside(y: int, x: int, H: int, W: int) -> bool: +def inside(y, x, H, W): -def solve(N, H, a_b): -    max_a = -1 -    for a, b in a_b: -        max_a = max(max_a, a) -    good_b = [] -    for a, b in a_b: -        if b >= max_a: -            good_b.append(b) +def solve(N, H, A, B): +    a_max = max(A) -    for b in sorted(good_b, reverse=True): -        ans += 1 -        H -= b +    for b in sorted(B, reverse=True): -            return ans -    return ans + ceil(H, max_a) +            break +        if b > a_max: +            H -= b +            ans += 1 +        else: +            break +    if H > 0: +        ans += ceil(H, a_max) +    return ans -    l = [] +    A, B = [], [] -        l.append((a, b)) -    print((solve(N, H, l))) +        A.append(a) +        B.append(b) +    print((solve(N, H, A, B)))