In August this year, Professor P is going to Beijing to watch the Olympics, but he cannot bear to leave behind his large collection of intellectual toys. Therefore, he decides to pack all his toys into boxes and ship them to Beijing, so that he can play with them while watching the games.
Professor P uses his Object Dimension Zipper (ODZ) to pack the toys. The ODZ can compress any object into one dimension, which can then be placed into a special one-dimensional container. Professor P has $n$ toys, numbered from $1$ to $n$. The one-dimensional length of the $i$-th toy after being processed by the ODZ is $c_i$. For the sake of organization, Professor P requires that the toys in any single one-dimensional container must have consecutive indices. Furthermore, if a container holds multiple toys, there must be $1$ unit of padding between any two adjacent toys. Formally, if toys from index $i$ to $j$ ($i < j$) are placed in a container, the length of the container will be:
$$l=j-i+\sum_{k=i}^{j} c_k$$
The cost of making a container depends on its length. According to Professor P's research, if the container length is $l$, the production cost is $(l-L)^2$, where $L$ is a constant derived from complex calculations. Professor P does not care about the number of containers and can manufacture containers of any length (even exceeding $L$), but he wants you to help him find the minimum total production cost.
Input
The first line contains two integers $n$ and $L$, separated by a space. The following $n$ lines each contain an integer $c_i$, representing the one-dimensional length of the $i$-th toy after being processed by the ODZ. It is guaranteed that $1\le n\le 50000$ and $1\le L,c_i\le 10^7$ for all $i$.
Output
Output a single integer representing the minimum production cost.
Examples
Input 1
5 4 3 4 2 1 4
Output 1
1