import sys input=sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): N=I() A=LI() B=LI() def calc(x): res=0 for i in range(N): res+=B[i]*abs(x-A[i]) return res M=10**6+5 left=-M right=M for i in range(300): c1=(2*left+right)//3 c2=(left+2*right)//3 if calc(c1)