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 java.util.concurrent.ThreadLocalRandom;

//notebook#4 pg#93
public class RoughWork{

	//notebook#4 pg#93
	//O(n) time, O(n) space
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int[] input = new int[n+1];
		
		for(int i=1;i<=n;i++){
			input[i] = sc.nextInt();
		}
		
		//Another important note-Beauty of an array is just maximum subarray sum.
		
		//The first dimension corresponds to the current ending position in the array.
		//The second dimension is to keep track of the different options that are available for each dp state.
		//There are actually three dp options available for each dp state but the third option is always 0. Look below for explanations why.
		//This is why the third option is assigned two different variables - opt3 and prev_opt3 which are both 0 always.
		//This is also why the second dimension has the size 2.
		//The third dimenson will be used to keep track of the two options. When the value of the third dimension is
		//0 the current maximum subarray sum doesn't have any elements multiplied by x.
		//If the value is 1. That means the current maximum subarray sum has atleast one element multiplied by x.
		//This can be used to make sure only one subarray in multiplied by x at one time.
		long[][][] dp = new long[n+1][2][2];
		
		//The following values prev_opt1, prev_opt2, prev_opt3 are all 0 because we are starting at i =1 and
		//the values for the previous options will all be 0 because no elements exits at i=0
		
		//OPTION 1 - dp[i][0][1]
		//Explanation: largest subarray sum resulted by adding an ending element multiplied by x
		//dp[i][0][0] is always set to 0 because it doesn't make sense since the current element is multiplied by x.
	
		//OPTION 2 #1- dp[i][1][0] -
		//largest subarray sum resulted by adding an ending element not multiplied by x and not containing any elements that are multipled by x
		
		//OPTION 2 #2- dp[i][1][1] -
		//largest subarray sum resulted by adding an ending element not multiplied by x and containing atleast one element that is multipled by x
				

		//OPTION #3
		//largest subarray sum resulted by not adding the current element. If you don't add the current element
		//(since we are only looking for subarray sum), it means that the subarray beginning is to the right of the 
		//current element. That means  prev_opt3 = 0 by default for all cases. This is relevant for cases when 
		//both prev_opt1 and preb_opt2 are both negative values, in that case adding an element reduces the subarray sum.
		//This variable is actually not needed but added for readability reasons
		long prev_opt3=0;
		
		//This variable is actually not needed but added for readability reasons
		long opt3 = 0;
		
		for(int i=1;i<=n;i++) {
			//OPTION 1 will consider the possibility that that the current element is multiplied by x.
			//If the current element is multiplied by x, it can join 3 possibilities - OPTION 1 for i-1, OPTION 2 #1 for i-1, OPTION #3 for i-1
			dp[i][0][1] = Math.max(Math.max(dp[i-1][0][1], dp[i-1][1][0]), prev_opt3) +  x*((long) input[i]);
			//OPTION 2 #1
			//In this case we take the larger of OPTION 2 #1 for i-1(where no elements have been multiplied by x before) 
			//and prev_opt3(where the previous largest sum is zero).
			dp[i][1][0] = Math.max(dp[i-1][1][0], prev_opt3) + input[i];
			//OPTION 2 #2
			//In this case  we look at the previous largest sum with atleast one element already multiplied with x
			//This gives us two dp state values. We find the maximum and add current i index value in array.
			dp[i][1][1] = Math.max(dp[i-1][1][1], dp[i-1][0][1])+ input[i];
			//opt3 is always set to zero.
			//prev_opt3 is always set to zero.
		}
				
		//long result = Math.max(Math.max(Math.max(prev_opt1,prev_opt2), prev_opt2_with_beauty), prev_opt3);
		long result = 0;
		
		for(int i=1;i<=n;i++) {
			result = Math.max(result, dp[i][0][1]);
			result = Math.max(result, dp[i][1][0]);
			result = Math.max(result, dp[i][1][1]);
			//The reason why we are not doiung result = Math.max(result,0) is because result is because there will be atleast one dp state with 0.
			//If all values  are negative and there is atleast one zero. The final value is 0.
		}
		
		System.out.println(result);
	}
}