Two positive integer sequences and of length are given. Let be any permutation of , and define .
Build a histogram from unit-width bars of heights in order. Over every possible permutation of , find the maximum possible area of the largest axis-aligned rectangle in the resulting histogram.
The input is given in the following format:
For each test case, print the maximum possible area.
With , every bar has height , giving a rectangle of area .
Each case is given in the following format: