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.
#include <bits/stdc++.h>
using namespace std;
long long dx[] = {1, 0, -1, 0};
long long dy[] = {0, 1, 0, -1};
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long expo(long long n, long long m, long long p) {
  long long r = 1;
  n = n % p;
  while (m > 0) {
    if (m % 2) r = (r * n) % p;
    n = (n * n) % p;
    m = m / 2;
  }
  return r % p;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long n, x, a[300005];
long long dp[300005][4];
bool vis[300005][4];
long long solve(long long i, long long c) {
  if (i == n) return 0;
  if (vis[i][c]) return dp[i][c];
  long long ans;
  if (c == 2) {
    ans = max(a[i] + solve(i + 1, 2), 0LL);
  }
  if (c == 1) {
    ans = max(a[i] * x + solve(i + 1, 1), a[i] + solve(i + 1, 2));
    ans = max(ans, 0LL);
  }
  if (c == 3) {
    ans = max(a[i] * x + solve(i + 1, 1), a[i] + solve(i + 1, 3));
    ans = max(ans, 0LL);
  }
  if (c == 0) {
    ans = max(solve(i + 1, 0), a[i] * x + solve(i + 1, 1));
    ans = max(ans, a[i] + solve(i + 1, 3));
    ans = max(ans, 0LL);
  }
  vis[i][c] = true;
  dp[i][c] = ans;
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> x;
  memset(vis, false, sizeof(vis));
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = solve(0, 0);
  cout << ans << endl;
}
