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(1) 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.
		
		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
		//largest subarray sum resulted by adding an ending element multiplied by x
		long prev_opt1=0;
		//largest subarray sum resulted by adding an ending element not multiplied by x
		long prev_opt2=0;
		long prev_opt2_with_beauty=0;
		//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;
		
		//Opt1, opt2, opt3 are the current values for the current i. prev_opt1, prev_opt2, prev_opt3 are the values of the maximum subarray sum
		//for i-1. The reason why we have these 6 variables is because we want to reduce space complexity from O(3*n) to O(1). Why O(3*n)? Because 
		//for every i value we have three options that need to be recorded. But, we don't need any values other than i-1 for calculating values of i.
		long opt1 = 0;
		long opt2 = 0;
		long opt2_with_beauty = 0;
		//This variable is actually not needed but added for readability reasons
		long opt3 = 0;
		
		for(int i=1;i<=n;i++) {
			//opt1 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 - opt1, opt2, opt3
			dp[i][0][0] = Math.max(Math.max(dp[i-1][0][0], dp[i-1][1][0]), 0) +  x*((long) input[i]);
			//In the case of opt2,
			//In this case we take the larger of prev_opt2(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], 0) + input[i];
			dp[i][1][1] = Math.max(dp[i-1][1][1], dp[i-1][0][0])+ input[i];
			//opt3 is always set to zero.
			//prev_opt1 =opt1;
			//prev_opt2 = opt2;
			//prev_opt2_with_beauty = opt2_with_beauty;
			//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][0]);
			result = Math.max(result, dp[i][1][0]);
			result = Math.max(result, dp[i][1][1]);
		}
		
		System.out.println(result);
	}
}