Shopping center
In the country of Olympia, a decision has been made to construct a large shopping center. For this project, a square plot measuring NxN meters has been designated. There are specific height restrictions for the building. If the plot is divided into vertical and horizontal strips, each 1 meter wide, then each strip has its own height limit. The architects plan to design the shopping center as a rectangular parallelepiped.
**Task**
Your task is to write a program that, given the size of the plot and the height restrictions for each strip, determines the maximum volume of the building, shaped as a rectangular parallelepiped, that can be constructed on this plot.
**Input**
The input consists of three lines. The first line contains a natural number N (2 ≤ N ≤ 5x10^4) — the size of the plot. The second line contains N non-negative integers, each not exceeding 10^5, representing the height restrictions for the vertical strips. The third line also contains N non-negative integers, each not exceeding 10^5, representing the height restrictions for the horizontal strips.
**Output**
The output should be a single number — the maximum volume of the shopping center building that can be constructed on the specified plot. The input data guarantees that it is possible to construct a building with a non-zero volume on the plot.
**Scoring**
The test set is divided into 5 blocks, with the following conditions:
1. 10 points: 1 ≤ N ≤ 10 2. 10 points: 10 < N ≤ 30 3. 10 points: 30 < N ≤ 70 4. 30 points: 70 < N ≤ 1000 5. 40 points: 1000 < N ≤ 5x10^4