\begin{problem}{Choose Colors}{standard input}{standard output}{1.5 seconds}{256 megabytes}

Miss M not only enjoys inventing interesting legends for programming problems but also loves painting, especially using harmonious color combinations, such as complementary colors from the color wheel. However, this time she decided to choose colors for her painting differently.

Miss M took $n$ color wheels (you can look at the note section to see what a color wheel is), each with different shades consisting of $(a_i+1)$ colors, and has already selected one initial color on each wheel, marking it as used. Then, she will choose each subsequent color using the following algorithm:
\begin{enumerate}
\item Find the longest sequence among all the color wheels of unmarked colors; if there are several, choose any.
\item If the length of such a sequence is odd, take the color exactly in the middle and mark it as used.
\item If the length of such a sequence is even, take one of the two middle colors and mark it as used.
\end{enumerate}

Miss M wants to choose $m$ more colors, and she is also interested in what the maximum length of the sequence of unmarked colors will be before she selects the $(m+n)$-th color.

\InputFile
The first line contains two integers $n$ and $m$ ($1 \leq n \leq 100$, $1 \leq m \leq 10^{18}$) --- the number of color wheels and the number of colors Miss M wants to take additionally (i.e., not counting the first marked colors on each wheel).

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \leq a_i \leq 10^{18}$).

It is guaranteed that $m$ is no more than the sum of all $a_i$.

\OutputFile
Print a single integer --- the maximum length of the sequence of unmarked colors before Miss M selects the $(m+n)$-th color.

\Scoring
If your solution works correctly for $n=1$ and $a_1 \leq 100$, it will score at least $25$ points.

If your solution works correctly for $n=1$ and $a_1 \leq 10^6$, it will score at least $50$ points.

If your solution works correctly for $n=1$, it will score at least $75$ points.

\Examples

\begin{example}
\exmpfile{example.01}{example.01.a}%
\exmpfile{example.02}{example.02.a}%
\exmpfile{example.03}{example.03.a}%
\exmpfile{example.04}{example.04.a}%
\exmpfile{example.05}{example.05.a}%
\end{example}

\Note
Explanation for the second example:
We are given one color wheel containing $12$ colors. Miss M has already chosen one color from the wheel (marked as number $1$ in the picture). Now she wants to choose $3$ more colors. Therefore, the sequence of her actions is as follows:
\begin{enumerate}
\item The maximum length of the sequence of unmarked colors is $11$. Therefore, we choose the color that will be in the middle and mark it with the number $2$.
\item Now we have sequences of $5$ and $5$ unmarked colors; we choose any and in the middle of the sequence, we select a color and mark it with the number $3$.
\item Among the sequences --- $2$, $2$, and $5$ we choose $5$ --- this is the maximum length of the sequence of unmarked colors before Miss M selects the $4$-th color.
\end{enumerate}


\begin{center}
  \includegraphics[scale=1.0]{problem_H.png} \\
  \small{The color wheel from the second example in the problem statement.}
\end{center}

\end{problem}

