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

ab=sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[1],reverse=True)

ab_M=max([ab[i][0] for i in range(N)])

ab_m=min([ab[i][1] for i in range(N) if ab[i][0]==ab_M])

cnt=0

flag=0

for i in range(N):

    if ab[i][1]<=ab_M:

        break

    elif flag==0 and ab[i]==[ab_M,ab_m]:

        flag=1

    else:

        H-=ab[i][1]

        cnt+=1

        if H<=0:

            break

if H>0:

    if H<=ab_m:

        print((cnt+1))

    else:

        print((cnt+1+(H-ab_m+ab_M-1)//ab_M))

else:

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

ab=sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[1],reverse=True)

a_M=max([ab[i][0] for i in range(N)])



ans =0

for a,b in ab:

    if b <= a_M:

        break

    H -= b

    ans += 1

    if H<=0:break

if H>0:

    ans += (H-1)//a_M+1

print(ans)
N, H = list(map(int, input().split()))
ab = sorted(
    [list(map(int, input().split())) for _ in range(N)],
    key=lambda x: x[1],
    reverse=True,
)
ab_M = max([ab[i][0] for i in range(N)])
ab_m = min([ab[i][1] for i in range(N) if ab[i][0] == ab_M])
cnt = 0
flag = 0
for i in range(N):
    if ab[i][1] <= ab_M:
        break
    elif flag == 0 and ab[i] == [ab_M, ab_m]:
        flag = 1
    else:
        H -= ab[i][1]
        cnt += 1
        if H <= 0:
            break
if H > 0:
    if H <= ab_m:
        print((cnt + 1))
    else:
        print((cnt + 1 + (H - ab_m + ab_M - 1) // ab_M))
else:
    print(cnt)

N, H = list(map(int, input().split()))
ab = sorted(
    [list(map(int, input().split())) for _ in range(N)],
    key=lambda x: x[1],
    reverse=True,
)
a_M = max([ab[i][0] for i in range(N)])
ans = 0
for a, b in ab:
    if b <= a_M:
        break
    H -= b
    ans += 1
    if H <= 0:
        break
if H > 0:
    ans += (H - 1) // a_M + 1
print(ans)

-ab_M = max([ab[i][0] for i in range(N)]) -ab_m = min([ab[i][1] for i in range(N) if ab[i][0] == ab_M]) -cnt = 0 -flag = 0 -for i in range(N): -    if ab[i][1] <= ab_M: +a_M = max([ab[i][0] for i in range(N)]) +ans = 0 +for a, b in ab: +    if b <= a_M: -    elif flag == 0 and ab[i] == [ab_M, ab_m]: -        flag = 1 -    else: -        H -= ab[i][1] -        cnt += 1 -        if H <= 0: -            break +    H -= b +    ans += 1 +    if H <= 0: +        break -    if H <= ab_m: -        print((cnt + 1)) -    else: -        print((cnt + 1 + (H - ab_m + ab_M - 1) // ab_M)) -else: -    print(cnt) +    ans += (H - 1) // a_M + 1 +print(ans)