# Arup Guha
# 10/12/2025
# Solution to 2025 NAQ Problem I: Star Guardians

# Get input of bonuses.
n = int(input())
bonus = [int(x) for x in input().split()]

# Read solves and sort from largest to smallest.
# For any size team, the k best are what we want.
solves = [int(x) for x in input().split()]
solves.sort(reverse=True)

# Team of 0.
res = 0

# Try each team size.
tot = 0
for i in range(n):

    # Add into total.
    tot += solves[i]

    # Total solves for whole team.
    whole = tot + bonus[i]

    # Update as needed.
    res = max(res, whole/(i+1))

# This is the best we can do.
print(res)
