You are given an array a consisting of n integers. Beauty of array is the maximum sum of some consecutive subarray of this array (this subarray may be empty). For example, the beauty of the array [10, -5, 10, -4, 1] is 15, and the beauty of the array [-3, -5, -1] is 0.

You may choose at most one consecutive subarray of a and multiply all values contained in this subarray by x. You want to maximize the beauty of array after applying at most one such operation.

Input

The first line contains two integers n and x (1 ≤ n ≤ 3 ⋅ 10^5, -100 ≤ x ≤ 100) — the length of array a and the integer x respectively.

The second line contains n integers a_1, a_2, ..., a_n (-10^9 ≤ a_i ≤ 10^9) — the array a.

Output

Print one integer — the maximum possible beauty of array a after multiplying all values belonging to some consecutive subarray x.

Examples

Input


5 -2
-3 8 -2 1 -6


Output


22


Input


12 -3
1 3 3 7 1 3 3 7 1 3 3 7


Output


42


Input


5 10
-1 -2 -3 -4 -5


Output


0

Note

In the first test case we need to multiply the subarray [-2, 1, -6], and the array becomes [-3, 8, 4, -2, 12] with beauty 22 ([-3, 8, 4, -2, 12]).

In the second test case we don't need to multiply any subarray at all.

In the third test case no matter which subarray we multiply, the beauty of array will be equal to 0.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStream;
 
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Aman Kumar Singh
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DBeautifulArray solver = new DBeautifulArray();
        solver.solve(1, in, out);
        out.close();
    }
 
    static class DBeautifulArray {
        int MAXN = 300005;
        PrintWriter out;
        InputReader in;
        int n;
        long x;
        long[] arr = new long[MAXN];
        long[][][] dp = new long[MAXN][3][3];
 
        long go(int ind, int state1, int state2) {
            if (ind == n)
                return 0;
            if (dp[ind][state1][state2] != -1)
                return dp[ind][state1][state2];
            long max = 0;
            if (state1 == 0) {
                if (state2 == 0) {
                    max = Math.max(max, go(ind + 1, 0, 0));
                    max = Math.max(max, go(ind + 1, 1, 0) + arr[ind]);
                    max = Math.max(max, go(ind + 1, 1, 1) + arr[ind] * x);
                    max = Math.max(max, go(ind + 1, 1, 2) + arr[ind] * x);
                }
            } else if (state1 == 1) {
                if (state2 == 0) {
                    max = Math.max(max, go(ind + 1, 1, 0) + arr[ind]);
                    max = Math.max(max, go(ind + 1, 1, 1) + arr[ind] * x);
                    max = Math.max(max, go(ind + 1, 1, 2) + arr[ind] * x);
                    max = Math.max(max, go(ind + 1, 2, 0) + arr[ind]);
                    max = Math.max(max, go(ind + 1, 2, 2) + arr[ind] * x);
                } else if (state2 == 1) {
                    max = Math.max(max, go(ind + 1, 1, 1) + arr[ind] * x);
                    max = Math.max(max, go(ind + 1, 1, 2) + arr[ind] * x);
                    max = Math.max(max, go(ind + 1, 2, 2) + arr[ind] * x);
                } else if (state2 == 2) {
                    max = Math.max(max, go(ind + 1, 1, 2) + arr[ind]);
                    max = Math.max(max, go(ind + 1, 2, 2) + arr[ind]);
                }
            } else
                max = Math.max(max, go(ind + 1, 2, 2));
            dp[ind][state1][state2] = max;
            return max;
        }
 
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            n = ni();
            x = nl();
            int i = 0;
            long sum = 0;
            for (i = 0; i < n; i++)
                arr[i] = nl();
            for (i = 0; i < n; i++) {
                for (int j = 0; j < 3; j++)
                    Arrays.fill(dp[i][j], -1);
            }
            pn(go(0, 0, 0));
        }
 
        int ni() {
            return in.nextInt();
        }
 
        long nl() {
            return in.nextLong();
        }
 
        void pn(Object o) {
            out.println(o);
        }
 
    }
 
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
 
        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int nextInt() {
            return Integer.parseInt(next());
        }
 
        public long nextLong() {
            return Long.parseLong(next());
        }
 
        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
 
            return res.toString();
        }
 
        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
    }
}