Maximum modulus of the sum#8572

Maximum modulus of the sum

0.75 seconds
64 megabytes
Hard

You are given an array consisting of integers and an integer .

z1.GIF

Your task is to select a sequence of positions b_1, b_2, \ldots, b_k (1 \leq b_1 < b_2 < \ldots < b_k \leq n) such that the value of the expression is maximized. Note that the chosen subsequence can be empty.

Determine the maximum possible value of this expression.

Input

The first line contains two integers and (1 \leq n \leq 35, 1 \leq m \leq 10^9).

The second line contains integers a_1, a_2, \ldots, a_n (1 \leq a_i \leq 10^9).

Output

Print the maximum possible value.

Examples

Example 1

Loading
Loading