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.*;
import java.util.*;

public class CodeForces {

    private static void solve() {
        int n = sc.nextInt();
        int x = sc.nextInt();
        long[] arr = new long[n+1];
        for(int i=1;i<=n;i++)arr[i] = sc.nextInt();
        dp = new long[n+2][3][3];
        for(int i=0;i<=n+1;i++)
            for(int j=0;j<=2;j++)
                Arrays.fill(dp[i][j],-1);
        out.println(memo(0,0,0,x,arr,n+1));
    }
    static long [][][] dp;
    private static long memo(int i,int isSubarray,int multiply,int x,long[] arr,int n){
        if(i==n)return 0;
        if(isSubarray == 2) // subarray is ended
            return 0;
        if(dp[i][isSubarray][multiply]!=-1)return dp[i][isSubarray][multiply];
        if(isSubarray == 1){    // taking elements to subarray
            if(multiply == 2) { // we have multiplied by x
                long ans = 0;
                ans = max2(ans,memo(i+1,1,multiply,x,arr,n));   // we can continue subarray
                ans = max2(ans,memo(i+1,2,multiply,x,arr,n));// we can end subarray
                return dp[i][isSubarray][multiply] = arr[i] + ans;
            }
            if(multiply == 1){
                long ans = 0;
                ans = max2(ans, memo(i+1,1,1,x,arr,n)); // continue taking subarray and multiplying
                ans = max2(ans,memo(i+1,1,2,x,arr,n));// continue taking subarray but ending multiplying
                ans = max2(ans,memo(i+1,2,multiply,x,arr,n));// end taking subarray
                return  dp[i][isSubarray][multiply] = arr[i] * x + ans;
            }
            if(multiply == 0){
                long ans = 0;
                ans = max2(ans,memo(i+1,1,0,x,arr,n)); // continue taking subarray but not started multiplying
                ans = max2(ans,memo(i+1,1,1,x,arr,n)); // continue taking subarray and start multiplying
                ans = max2(ans,memo(i+1,2,multiply,x,arr,n)); // end taking subarray
                return dp[i][isSubarray][multiply] = ans + arr[i];
            }
        }
        if(isSubarray == 0){
            long ans = 0;
            ans = max2(ans,memo(i+1,0,0,x,arr,n));  // we can not start subarray
            ans = max2(ans,memo(i+1,1,0,x,arr,n));  // we start subarray and not start multiplying
            ans = max2(ans,memo(i+1,1,1,x,arr,n));  // we start subarray and start multiplying
            return dp[i][isSubarray][multiply] = ans;
        }
        return dp[i][isSubarray][multiply] = 0;
    }


    /*****************************************WRITING CODE ENDS HERE******************************************/

    public static void main(String[] args){
        FIO(true);
        int testCase = 1;
//        testCase = sc.nextInt();
        while (testCase-- > 0) solve();
        closeIO();
    }

    static Scanner sc ;                     // FAST INPUT
    static PrintWriter out;                // FAST OUTPUT
    static PrintWriter debug ;             // DEBUG IN FILE : debug.txt

    public static void FIO(boolean isDebug){
        sc = new Scanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        if(isDebug)
            try {
                debug = new PrintWriter(new FileOutputStream("debug.txt"));
            }catch (IOException e){
                e.printStackTrace();
            }
    }
    public static void closeIO(){
        sc.close();
        out.flush();
        out.close();
        if(debug!=null) {
            debug.flush();
            debug.close();
        }
    }


    /**************************************HELPER FUNCTION STARTS HERE ************************************/

    public static int mod = (int) 1e9 + 7;
    public static final int INT_MAX = Integer.MAX_VALUE;
    public static final int INT_MIN = Integer.MIN_VALUE;
    public static final long LONG_MAX = Long.MAX_VALUE;
    public static final long LONG_MIN = Long.MIN_VALUE;
    public static final double DOUBLE_MAX = Double.MAX_VALUE;
    public static final double DOUBLE_MIN = Double.MIN_VALUE;
    public static final String YES = "YES";
    public static final String NO = "NO";

    public static void sort(int[] a, boolean isAscending) {
        ArrayList<Integer> temp = new ArrayList<>();
        for (int j : a) temp.add(j);
        sort(temp, isAscending);
        for (int i = 0; i < a.length; i++) a[i] = temp.get(i);
    }

    public static void sort(long[] a, boolean isAscending) {
        ArrayList<Long> temp = new ArrayList<>();
        for (long ele : a) temp.add(ele);
        sort(temp, isAscending);
        for (int i = 0; i < a.length; i++) a[i] = temp.get(i);
    }

    public static void sort(List list, boolean isAscending) {
        if (isAscending)
            Collections.sort(list);
        else Collections.sort(list, Collections.reverseOrder());
    }

    // euclidean algorithm
    public static long gcd(long a, long b) {
        // time O(max (loga ,logb))
        long x = Math.min(a, b);
        long y = Math.max(a, b);
        if (y % x == 0) return x;
        return gcd(y % x, x);
    }

    public static long lcm(long a, long b) {
        // lcm(a,b) * gcd(a,b) = a * b
        return (a / gcd(a, b)) * b;
    }

    public static long power(long x, long n) {
        // time O(logn)
        long ans = 1;
        while (n > 0) {
            if ((n & 1) == 1) {
                ans *= x;
                ans %= mod;
                n--;
            } else {
                x *= x;
                x %= mod;
                n >>= 1;
            }
        }
        return ans;
    }

    public static long factorial(long n) {
        long fact = 1L;
        for (int i = 2; i <= n; i++) fact = (fact * i) % mod;
        return fact;
    }

    public static long firstDivisor(long n) {
        if (n == 1) return n;
        for (long i = 2; i * i <= n; i++)
            if (n % i == 0) return i;
        return -1;
    }

    public static int ncr(int n, int r) {
        // time O(n+r)
        if (r > n)
            return 0;
        long[] inv = new long[r + 1];
        inv[1] = 1;
        // Getting the modular inversion
        // for all the numbers
        // from 2 to r with respect to m
        for (int i = 2; i <= r; i++) {
            inv[i] = mod - (mod / i) * inv[mod % i] % mod;
        }
        int ans = 1;
        // for 1/(r!) part
        for (int i = 2; i <= r; i++) {
            ans = (int) (((ans % mod) * (inv[i] % mod)) % mod);
        }
        // for (n)*(n-1)*(n-2)*...*(n-r+1) part
        for (int i = n; i >= (n - r + 1); i--) {
            ans = (int) (((ans % mod) * (i % mod)) % mod);
        }
        return ans;
    }

    public static long max3(long a, long b, long c) { return max2(max2(a, b), c);}

    public static long max2(long a, long b) {return Math.max(a, b);}

    public static long min3(long a, long b, long c) {return min2(min2(a, b), c);}

    public static long min2(long a, long b) { return Math.min(a, b); }

    public static int max3(int a, int b, int c) { return max2(max2(a, b), c); }

    public static int max2(int a, int b) { return Math.max(a, b); }

    public static int min3(int a, int b, int c) { return min2(min2(a, b), c); }

    public static int min2(int a, int b) {
        return Math.min(a, b);
    }

    /**************************************HELPER FUNCTION ENDS HERE ************************************/

    /*****************************************FAST INPUT STARTS HERE *************************************/


    private static class Scanner {
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        private StringTokenizer st = new StringTokenizer("");

        public String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();

        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] setintArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) arr[i] = nextInt();
            return arr;
        }

        public long[] setlongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) arr[i] = nextLong();
            return arr;
        }

        public int[][] set2DIntArray(int n) {
            return set2DIntArray(n, n);
        }

        public int[][] set2DIntArray(int row, int col) {
            int[][] arr = new int[row][col];
            for (int i = 0; i < row; i++)
                for (int j = 0; j < col; j++)
                    arr[i][j] = nextInt();
            return arr;
        }

        public long[][] set2DlongArray(int n) {
            return set2DlongArray(n, n);
        }

        public long[][] set2DlongArray(int row, int col) {
            long[][] arr = new long[row][col];
            for (int i = 0; i < row; i++)
                for (int j = 0; j < col; j++)
                    arr[i][j] = nextLong();
            return arr;
        }

        public char[][] set2DCharArray(int n) {
            return set2DCharArray(n, n);
        }

        public char[][] set2DCharArray(int row, int col) {
            char[][] ch = new char[row][col];
            for (int i = 0; i < row; i++)
                ch[i] = sc.next().toCharArray();
            return ch;
        }

        public void close() {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    /*****************************************FAST INPUT ENDS HERE *************************************/
}
