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

a = []

b = []

for i in range(n):

    ca, cb = list(map(int,input().split()))

    a.append(ca)

    b.append(cb)



amax = max(a)

b.sort(reverse=True)

cnt = 0

while h > 0:

    if b and b[0] > amax:

        h -= b.pop(0)

        cnt += 1

    else:

        cnt += h//amax

        h -= amax * (h//amax)

        if h > 0:

            h -= amax

            cnt += 1

print(cnt)

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

a = []

b = []

for i in range(n):

    ca, cb = list(map(int,input().split()))

    a.append(ca)

    b.append(cb)



amax = max(a)

b.sort(reverse=True)

cnt = 0

bsum = 0

for i in range(n):

    if b[i] <= amax or bsum >= h:

        break

    else:

        bsum += b[i]

        cnt += 1

h -= bsum

if h > 0:

    cnt += h//amax

    h -= amax * (h//amax)

if h > 0:

    h -= amax

    cnt += 1

print(cnt)

n, h = list(map(int, input().split()))
a = []
b = []
for i in range(n):
    ca, cb = list(map(int, input().split()))
    a.append(ca)
    b.append(cb)
amax = max(a)
b.sort(reverse=True)
cnt = 0
while h > 0:
    if b and b[0] > amax:
        h -= b.pop(0)
        cnt += 1
    else:
        cnt += h // amax
        h -= amax * (h // amax)
        if h > 0:
            h -= amax
            cnt += 1
print(cnt)

n, h = list(map(int, input().split()))
a = []
b = []
for i in range(n):
    ca, cb = list(map(int, input().split()))
    a.append(ca)
    b.append(cb)
amax = max(a)
b.sort(reverse=True)
cnt = 0
bsum = 0
for i in range(n):
    if b[i] <= amax or bsum >= h:
        break
    else:
        bsum += b[i]
        cnt += 1
h -= bsum
if h > 0:
    cnt += h // amax
    h -= amax * (h // amax)
if h > 0:
    h -= amax
    cnt += 1
print(cnt)

-while h > 0: -    if b and b[0] > amax: -        h -= b.pop(0) +bsum = 0 +for i in range(n): +    if b[i] <= amax or bsum >= h: +        break +    else: +        bsum += b[i] -    else: -        cnt += h // amax -        h -= amax * (h // amax) -        if h > 0: -            h -= amax -            cnt += 1 +h -= bsum +if h > 0: +    cnt += h // amax +    h -= amax * (h // amax) +if h > 0: +    h -= amax +    cnt += 1