#!/usr/bin/env PyPy3 from collections import Counter, defaultdict, deque import itertools import re import math from functools import reduce import operator import bisect from heapq import * import functools mod=998244353 import sys input=sys.stdin.readline n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) flg = [0] * n ma = 0 for i in range(n): if ma < a[i] / b[i]: ma = a[i] / b[i] flg[i] = 1 ans = 0 l = -1 now = 1 def f(x,l,r): res = 0 for i in range(l,r): res += a[i] / x + b[i] * x return res for i in range(n): if flg[i]: if l == -1: l = i else: high = 10 ** 5 low = now while high - low > (10 ** (-12)): l1 = low + (high - low) / 3 l2 = high - (high - low) / 3 if f(l1,l,i) > f(l2,l,i): low = l1 else: high = l2 ans += f((high+low)/2,l,i) l = i now = (high+low)/2 high = 10 ** 5 low = now while high - low > (10 ** (-12)): l1 = low + (high - low) / 3 l2 = high - (high - low) / 3 if f(l1,l,n) > f(l2,l,n): low = l1 else: high = l2 ans += f((high+low)/2,l,n) print(ans)