It's family beaches that I desire
Sacred nights, where we watch the fireworks...
--- Animal Collective, Fireworks
At a family gathering, you want to go to the fireworks. Unfortunately, flashy and splendid sparklers would frighten the babies.
There are $n$ locations where fireworks can be placed. Let's define $a_i$ as the viewing level of location $i$ and $b_i$ as the frightening level of location $i$, where $a_i$ and $b_i$ can only take values of $0$ or $1$. In order to enjoy the beauty of the fireworks while ensuring a pleasant atmosphere, you are going to pick a continuous section $[l, r]$ $(1 \le l \le r \le n)$ to place the fireworks, in such a way that the value of the following function is maximized:
$
f(l, r) = \sum_{i=l}^{r} a_i - \Big(\sum_{i=l}^{r} b_i\Big)^2
$
The first line of input contains one integer $n$ $(1 \le n\le 10^5)$ --- the length of the array.
The second line contains an array $a$ of length $n$ $(a_i \in {0, 1})$.
The third line contains an array $b$ of length $n$ $(b_i \in {0, 1})$.
Print a single integer, representing the maximum value of $f$.
11 1 0 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 1 1 0
\n · · · · · · · · · · \n · · · · · · · · · · \n
6
\n