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

public class Beautiful_array 
{ 

/*
 *   ********  			*******				********  
 *   *                  *     *					  *
 *   *         			****					 *
 *   *         			*   *  					*
 *   ********  			*     *				   *
 */
	static	Reader in=new Reader();
	
	public static void main(String[] args) throws IOException 
	{ 
		int n=in.integer();
		int x=in.integer();
		long arr[]=new long[n];
		for(int i=0;i<n;i++)
			arr[i]=in._long();
		long dp[][]=new long[n+1][3];
		for(int i=0;i<3;i++)
			dp[0][i]=0;
		long ans=0;
		for(int i=1;i<=n;i++) {
			  dp[i][0] = Math.max(dp[i-1][0] + arr[i-1],arr[i-1]);
			    dp[i][1] = Math.max(dp[i-1][0] + arr[i-1]*x,dp[i-1][1] + arr[i-1]*x);
			    dp[i][1] = Math.max(dp[i][1],arr[i-1]*x);
			    dp[i][2] = Math.max(dp[i-1][1] + arr[i-1],dp[i-1][2] + arr[i-1]);
			    ans = Math.max(ans,Math.max(dp[i][0],Math.max(dp[i][1],dp[i][2])));
		}
		System.out.println(ans);
	}

	
	
	
	
	
	/*
	 * seach algorithm
	 */
	static int return_greater_index(int arr[],int start,int end,int x)
	{
		int ans=-1;
		int mid;
		while(start<=end) {
			 mid=(start+end)/2;
			if(arr[mid]<=x)
				start=mid+1;
			else 
				{
				ans=mid;
				end=mid-1;
				}
		}
		return ans;
	}
static int return_lower_index(int arr[],int start,int end,int x)
	{
		int ans=-1;
		int mid;
		while(start<=end) {
			 mid=(start+end)/2;
			if(arr[mid]<=x) {
				ans=mid;
				start=mid+1;
			}
			else 
				{
				end=mid-1;
				}
		}
		return ans;
	}
	/*
	 * pairs of <int,int> <double,double>
	 */
	static Pair<Integer,Integer> pair(int x,int y){
		Pair<Integer,Integer> p=new Pair<Integer, Integer>(x,y);
		return p;
	}
	static Pair<Double,Double> pair(double x,double y){
		Pair<Double,Double> p=new Pair<Double,Double>(x,y);
		return p;
	}
	/*
	 * for loop
	 */
static int[] rep(int arr[],int n) throws IOException {
	for(int i=0;i<n;i++)
		arr[i]=in.integer();
	return arr;
}

static int[][] rep(int arr[][],int n,int m) throws IOException {
	for(int i=0;i<n;i++) {
		for(int j=0;j<m;j++)
			arr[i][j]=in.integer();
	}
	return arr;
}
	/*display 
	 array
	 */
	static void display(int arr[][],int x,int y) {
		for(int i=0;i<x;i++) {
			for(int j=0;j<y;j++)
			{
				System.out.print(arr[i][j]+" ");
			}
			System.out.println();
		}
	}
	static void display(int arr[],int x) {
			for(int j=0;j<x;j++)
			{
				System.out.print(arr[j]+" ");
			}
			System.out.println();
	}
	
	/*
	 * input 
	 */
	
	static class Reader 
	{ 
		final private int BUFFER_SIZE = 1 << 16; 
		private DataInputStream din; 
		private byte[] buffer; 
		private int bufferPointer, bytesRead; 

		public Reader() 
		{ 
			din = new DataInputStream(System.in); 
			buffer = new byte[BUFFER_SIZE]; 
			bufferPointer = bytesRead = 0; 
		} 

		public Reader(String file_name) throws IOException 
		{ 
			din = new DataInputStream(new FileInputStream(file_name)); 
			buffer = new byte[BUFFER_SIZE]; 
			bufferPointer = bytesRead = 0; 
		} 

		public String string() throws IOException 
		{ 
			byte[] buf = new byte[64]; // line length 
			int cnt = 0, c; 
			while ((c = read()) != -1) 
			{ 
				if (c == '\n') 
					break; 
				buf[cnt++] = (byte) c; 
			} 
			return new String(buf, 0, cnt); 
		} 

		public int integer() throws IOException 
		{ 
			int ret = 0; 
			byte c = read(); 
			while (c <= ' ') 
				c = read(); 
			boolean neg = (c == '-'); 
			if (neg) 
				c = read(); 
			do
			{ 
				ret = ret * 10 + c - '0'; 
			} while ((c = read()) >= '0' && c <= '9'); 

			if (neg) 
				return -ret; 
			return ret; 
		} 

		public long _long() throws IOException 
		{ 
			long ret = 0; 
			byte c = read(); 
			while (c <= ' ') 
				c = read(); 
			boolean neg = (c == '-'); 
			if (neg) 
				c = read(); 
			do { 
				ret = ret * 10 + c - '0'; 
			} 
			while ((c = read()) >= '0' && c <= '9'); 
			if (neg) 
				return -ret; 
			return ret; 
		} 

		public double _double() throws IOException 
		{ 
			double ret = 0, div = 1; 
			byte c = read(); 
			while (c <= ' ') 
				c = read(); 
			boolean neg = (c == '-'); 
			if (neg) 
				c = read(); 

			do { 
				ret = ret * 10 + c - '0'; 
			} 
			while ((c = read()) >= '0' && c <= '9'); 

			if (c == '.') 
			{ 
				while ((c = read()) >= '0' && c <= '9') 
				{ 
					ret += (c - '0') / (div *= 10); 
				} 
			} 

			if (neg) 
				return -ret; 
			return ret; 
		} 

		private void fillBuffer() throws IOException 
		{ 
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); 
			if (bytesRead == -1) 
				buffer[0] = -1; 
		} 

		private byte read() throws IOException 
		{ 
			if (bufferPointer == bytesRead) 
				fillBuffer(); 
			return buffer[bufferPointer++]; 
		} 

		public void close() throws IOException 
		{ 
			if (din == null) 
				return; 
			din.close(); 
		} 
	} 

} 
