import math



count = 0



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

a, b = [], []



for i in range(N):

    tmp = list(map(int, input().split()))

    a.append(tmp[0])

    b.append(tmp[1])



max_a = max(a)

b.sort(reverse=True)



for b_ in b:

    if max_a <= b_:

        H -= b_

        count += 1

    if H <= 0:

        break

if H > 0:

    count += math.ceil(H / max_a)



print(count)
import sys

from math import ceil



input = sys.stdin.readline



def main():

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

    A, B = [], []

    

    for i in range(N):

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

        A.append(a)

        B.append(b)

        

    A.sort(reverse=True)

    B.sort(reverse=True)

    

    a = A[0]

    ans = 0

    

    for b in B:

        if a > b or H <= 0: break

        H -= b

        ans += 1

        

    if H > 0: ans += ceil(H / a)

    

    print(ans)



if __name__ == '__main__':

    main()
import math

count = 0
N, H = list(map(int, input().split()))
a, b = [], []
for i in range(N):
    tmp = list(map(int, input().split()))
    a.append(tmp[0])
    b.append(tmp[1])
max_a = max(a)
b.sort(reverse=True)
for b_ in b:
    if max_a <= b_:
        H -= b_
        count += 1
    if H <= 0:
        break
if H > 0:
    count += math.ceil(H / max_a)
print(count)

import sys
from math import ceil

input = sys.stdin.readline


def main():
    N, H = list(map(int, input().split()))
    A, B = [], []
    for i in range(N):
        a, b = list(map(int, input().split()))
        A.append(a)
        B.append(b)
    A.sort(reverse=True)
    B.sort(reverse=True)
    a = A[0]
    ans = 0
    for b in B:
        if a > b or H <= 0:
            break
        H -= b
        ans += 1
    if H > 0:
        ans += ceil(H / a)
    print(ans)


if __name__ == "__main__":
    main()

-import math +import sys +from math import ceil -count = 0 -N, H = list(map(int, input().split())) -a, b = [], [] -for i in range(N): -    tmp = list(map(int, input().split())) -    a.append(tmp[0]) -    b.append(tmp[1]) -max_a = max(a) -b.sort(reverse=True) -for b_ in b: -    if max_a <= b_: -        H -= b_ -        count += 1 -    if H <= 0: -        break -if H > 0: -    count += math.ceil(H / max_a) -print(count) +input = sys.stdin.readline + + +def main(): +    N, H = list(map(int, input().split())) +    A, B = [], [] +    for i in range(N): +        a, b = list(map(int, input().split())) +        A.append(a) +        B.append(b) +    A.sort(reverse=True) +    B.sort(reverse=True) +    a = A[0] +    ans = 0 +    for b in B: +        if a > b or H <= 0: +            break +        H -= b +        ans += 1 +    if H > 0: +        ans += ceil(H / a) +    print(ans) + + +if __name__ == "__main__": +    main()