This page is still under construction.

Parts of this page are still being built. What you see may change.

Cakes

Time limit3sMemory limit512 MB

Summary
Three eaters with different per-cake speeds share n cakes, each cake splittable into any proportions; find the minimum makespan.
Level

Hard8 of 10

Topics
Binary search, Greedy, Math, Sorting
Solved
No attempts yet

Problem

Malfoy has got nn cakes as a present for his birthday party. He has decided that he wants to share these cakes with his friends Crabbe and Goyle. At the same time he doesn't want to share his birthday present with other Slytherins. So, now they want to eat all these cakes as soon as possible, so that others don't notice anything.

It is known that it takes Malfoy aia_i seconds to eat the ii-th cake. Also, it takes Crabbe bib_i seconds to eat the ii-th cake. Finally, it takes Goyle cic_i seconds to eat the ii-th cake. They can divide each cake into several parts: the time it takes to eat a part is proportional to the size of the part. Surely, they are going to eat cakes simultaneously. Can you find the minimum time required to eat all nn cakes?

Input

The first line contains a single integer nn: the number of cakes (1≤n≤5⋅1041 \le n \le 5 \cdot 10^4).

The second line contains nn integers a1a_1, …\ldots, ana_n.

The third line contains nn integers b1b_1, …\ldots, bnb_n.

The fourth line contains nn integers c1c_1, …\ldots, cnc_n.

It is guaranteed that 1≤ai,bi,ci≤1001 \le a_i, b_i, c_i \le 100.

Output

You should print one number: the minimum time it takes Malfoy, Crabbe and Goyle to eat all nn cakes. Your answer will be accepted if its absolute or relative error does not exceed 10−610^{-6}.

Examples2

  1. Example 1

    Input
    3
    1 2 3
    2 3 1
    3 1 2
    
    Expected output
    1.000000000000000000
    
  2. Example 2

    Input
    2
    1 1
    2 2
    3 3
    
    Expected output
    1.090909090908996903