from itertools import accumulate n = int(input()) a = list(accumulate(map(int, input().split()), initial=0)) b = list(accumulate(map(int, input().split()), initial=0)) l = 0 r = a[n] + 1.0 while True: c = (l + r) / 2 if not l < c < r: break d = [x - c * y for x, y in zip(a, b)] mns = d[:] for i in range(n): mns[i+1] = min(mns[i], d[i]) mx = d[n] ok = True for i in range(n)[::-1]: if mns[i] > mx: ok = False break mx = max(mx, d[i]) if ok: l = c else: r = c print(f'{l:.10f}')