Vova is a boy with a great affection for milk, particularly warm milk. However, he absolutely dislikes milk with foam, and under no circumstances will he drink it.
Vova has a good relationship with the milkman, who delivers fresh milk to him every day. For the next $$$n$$$ days, Vova knows in advance how delicious each milk batch will become when heated to a certain temperature. Specifically, for each day $$$i$$$, he knows the flavor enhancement per degree of heating, denoted as $$$b_i$$$, as well as the maximum temperature $$$t_i$$$ (in degrees) at which the milk will still be foam-free.
The milkman has a busy schedule, yet he is willing to warm Vova's milk to exactly $$$T$$$ degrees every day.
Now, Vova faces a challenging problem: he must determine the optimal temperature $$$T$$$ to request for heating the milk so that the total flavor enhancement from all the milk he drinks is maximized.
The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100\,000$$$).
The second line contains $$$n$$$ integers $$$b_i$$$ ($$$1 \leq b_i \leq 10^5$$$).
The third line contains $$$n$$$ integers $$$t_i$$$ ($$$1 \leq t_i \leq 10^9$$$).
The output should consist of a single integer — the maximum total flavor enhancement from the milk Vova drinks given the optimal choice of temperature $$$T$$$.
3 1 1 1 2 2 7
7
2 3 42 10 1
45
In the first example, Vova will only drink the third batch of milk, heated to $$$7$$$ degrees. The first two batches will not be consumed because they would develop foam when heated to $$$7$$$ degrees.
In the second example, he will drink both milk batches, each heated to $$$1$$$ degree.
| Name |
|---|


