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

a=[]

for i in range(n):

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

  a+=[[b,0],[c,1]]

a.sort(reverse=1)

i=0

ans=0

while h>0:

  if a[i][1]==1:

    h-=a[i][0]

    ans+=1

  else:

    ans+=0--h//a[i][0]

    h=0

  i+=1

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

x=[]

for i in range(n):

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

  x.append([a,0])

  x.append([b,1])

x.sort(reverse=1)

i=ans=0

while h>0:

  if x[i][1]:

    h-=x[i][0]

    ans+=1

  else:

    ans+=0--h//x[i][0]

    h=0

  i+=1

print(ans)
n, h = list(map(int, input().split()))
a = []
for i in range(n):
    b, c = list(map(int, input().split()))
    a += [[b, 0], [c, 1]]
a.sort(reverse=1)
i = 0
ans = 0
while h > 0:
    if a[i][1] == 1:
        h -= a[i][0]
        ans += 1
    else:
        ans += 0 - -h // a[i][0]
        h = 0
    i += 1
print(ans)

n, h = list(map(int, input().split()))
x = []
for i in range(n):
    a, b = list(map(int, input().split()))
    x.append([a, 0])
    x.append([b, 1])
x.sort(reverse=1)
i = ans = 0
while h > 0:
    if x[i][1]:
        h -= x[i][0]
        ans += 1
    else:
        ans += 0 - -h // x[i][0]
        h = 0
    i += 1
print(ans)

-a = [] +x = [] -    b, c = list(map(int, input().split())) -    a += [[b, 0], [c, 1]] -a.sort(reverse=1) -i = 0 -ans = 0 +    a, b = list(map(int, input().split())) +    x.append([a, 0]) +    x.append([b, 1]) +x.sort(reverse=1) +i = ans = 0 -    if a[i][1] == 1: -        h -= a[i][0] +    if x[i][1]: +        h -= x[i][0] -        ans += 0 - -h // a[i][0] +        ans += 0 - -h // x[i][0]