#!/usr/bin/env python3

# coding=utf-8



import sys

import math

import numpy as np

n, h = list(map(int, sys.stdin.readline().strip().split(" ")))

a = []

b = []

for _ in range(n):

    _a, _b = list(map(int, sys.stdin.readline().strip().split(" ")))

    a.append(_a)

    b.append(_b)

max_a = max(a)

cnt = 0

b = np.asarray(sorted(b))

b = b[b > max_a]

while h > 0 and len(b) > 0:

    cnt += 1

    h -= b[-1]

    b = b[:-1]

if h > 0:

    cnt += math.ceil(h / max_a)

print(cnt)

from math import ceil





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:

        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)]))))

#!/usr/bin/env python3
# coding=utf-8
import sys
import math
import numpy as np

n, h = list(map(int, sys.stdin.readline().strip().split(" ")))
a = []
b = []
for _ in range(n):
    _a, _b = list(map(int, sys.stdin.readline().strip().split(" ")))
    a.append(_a)
    b.append(_b)
max_a = max(a)
cnt = 0
b = np.asarray(sorted(b))
b = b[b > max_a]
while h > 0 and len(b) > 0:
    cnt += 1
    h -= b[-1]
    b = b[:-1]
if h > 0:
    cnt += math.ceil(h / max_a)
print(cnt)

from math import ceil


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:
        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)])))
    )

-#!/usr/bin/env python3 -# coding=utf-8 -import sys -import math -import numpy as np +from math import ceil -n, h = list(map(int, sys.stdin.readline().strip().split(" "))) -a = [] -b = [] -for _ in range(n): -    _a, _b = list(map(int, sys.stdin.readline().strip().split(" "))) -    a.append(_a) -    b.append(_b) -max_a = max(a) -cnt = 0 -b = np.asarray(sorted(b)) -b = b[b > max_a] -while h > 0 and len(b) > 0: -    cnt += 1 -    h -= b[-1] -    b = b[:-1] -if h > 0: -    cnt += math.ceil(h / max_a) -print(cnt) + +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: +        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)]))) +    )