n = int(input())
t = input().split()
a = int(t[0])
v = []
for i in range(0,n):
    s = input().split()
    v.append((int(s[0]),int(s[1])))
v.sort(key=lambda x: x[0] * x[1])
res = 0
for i in range(0,n):
    k = a // (v[i])[1]
    if(k > res):
        res = k
    a *= (v[i])[0]
print(res)
73d14e5a8cc71039ed60048cbe3fc53089601ac4
<mask token>

<mask token>
for i in range(0, n):
    s = input().split()
    v.append((int(s[0]), int(s[1])))
v.sort(key=lambda x: x[0] * x[1])
<mask token>
for i in range(0, n):
    k = a // v[i][1]
    if k > res:
        res = k
    a *= v[i][0]
print(res)

n = int(input())
t = input().split()
a = int(t[0])
v = []
for i in range(0, n):
    s = input().split()
    v.append((int(s[0]), int(s[1])))
v.sort(key=lambda x: x[0] * x[1])
res = 0
for i in range(0, n):
    k = a // v[i][1]
    if k > res:
        res = k
    a *= v[i][0]
print(res)

n = int(input())
t = input().split()
a = int(t[0])
v = []
for i in range(0,n):
    s = input().split()
    v.append((int(s[0]),int(s[1])))
v.sort(key=lambda x: x[0] * x[1])
res = 0
for i in range(0,n):
    k = a // (v[i])[1]
    if(k > res):
        res = k
    a *= (v[i])[0]
print(res)