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 int leftmostSetBit(long long int x) {
  long long int count = 0;
  while (x) {
    count++;
    x = x >> 1;
  }
  return count;
}
long long int smallestDivisor(long long int n) {
  if (n % 2 == 0) return 2;
  for (long long int i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return i;
  }
  return n;
}
long long int max(long long int a, long long int b) { return a > b ? a : b; }
long long int min(long long int a, long long int b) { return a < b ? a : b; }
long long int gcd(long long int a, long long int b) {
  while (b) {
    long long int t = a;
    a = b;
    b = t % b;
  }
  return a;
}
long long int lcm(long long int a, long long int b) {
  return (max(a, b) / gcd(a, b)) * min(a, b);
}
int cnt[200005] = {0};
vector<int> adj[200005];
map<int, int, greater<int> > factorize(int n) {
  int count = 0;
  map<int, int, greater<int> > fact;
  while (!(n % 2)) {
    n /= 2;
    count++;
  }
  if (count) fact[2] += count;
  for (int i = 3; i <= sqrt(n); i += 2) {
    count = 0;
    while ((n % i) == 0) {
      count++;
      n /= i;
    }
    if (count) fact[i] += count;
  }
  if (n > 2) fact[n]++;
  for (auto it : fact) {
    cnt[it.first]++;
    adj[it.first].push_back(it.second);
  }
  return fact;
}
long long int power(long long int x, int p) {
  if (p == 0) return 1;
  long long int ans = power(x, p / 2);
  ans = ans * ans;
  if (p % 2 == 1) ans = ans * x;
  return ans;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
vector<long long int> countDivisors(long long int n) {
  long long int cnt = 0;
  std::vector<long long int> v;
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (n / i == i)
        cnt++;
      else {
        cnt = cnt + 2;
        v.push_back(n / i);
      }
    }
  }
  return v;
}
bool isPowerOfTwo(long long int x) { return (x && !(x & (x - 1))); }
map<long long int, long long int> factors(long long int n) {
  vector<long long int> f;
  map<long long int, long long int> m;
  for (long long int x = 2; x * x <= n; x++) {
    while (n % x == 0) {
      f.push_back(x);
      m[x]++;
      n /= x;
    }
  }
  if (n > 1) {
    f.push_back(n);
    m[n]++;
  }
  return m;
}
bool cmp(pair<long long int, long long int> v1,
         pair<long long int, long long int> v2) {
  if (v1.first > v2.first) {
    return true;
  } else if (v1.first < v2.first) {
    return false;
  } else {
    return v1.second < v2.second;
  }
}
long long int binarySearch(long long int arr[], long long int l,
                           long long int r, long long int x) {
  if (r >= l) {
    long long int mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
int rub[2000001];
bool ispali(int n) {
  int no = n;
  int rev = 0;
  while (no > 0) {
    int ld = no % 10;
    no /= 10;
    rev = rev * 10 + ld;
  }
  if (n == rev)
    return true;
  else
    return false;
}
void np() {
  for (int i = 1; i <= 2000000; i++) {
    if (ispali(i))
      rub[i] = rub[i - 1] + 1;
    else
      rub[i] = rub[i - 1];
  }
}
int pi[20000001];
bool isprime[20000001];
void seive() {
  for (int i = 4; i <= 20000000; i += 2) isprime[i] = 1;
  for (int i = 3; i * i <= 20000000; i += 2) {
    if (!isprime[i]) {
      for (int j = i * i; j <= 20000000; j += i) isprime[j] = 1;
    }
  }
  for (int i = 2; i <= 20000000; i++) {
    if (!isprime[i])
      pi[i] = pi[i - 1] + 1;
    else
      pi[i] = pi[i - 1];
  }
}
int g1;
void bfs(vector<vector<int> > &g, int pos, vector<int> visited) {
  queue<int> q;
  q.push(pos);
  while (q.size() > 0) {
    if (q.front() == g1) {
      cout << "yes";
      return;
    }
    int i = q.front();
    q.pop();
    visited[i] = 1;
    for (int j = 0; j < g[i].size(); j++) {
      if (visited[g[i][j]] == 0) {
        q.push(g[i][j]);
        visited[g[i][j]] = 1;
      }
    }
  }
  return;
}
void pairsort(long long int a[], long long int b[], long long int n) {
  pair<long long int, long long int> pairt[n];
  for (long long int i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (long long int i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long int modpower(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int modsum(long long int a, long long int b, long long int m) {
  return ((a % m) + (b % m)) % m;
}
long long int modmul(long long int a, long long int b, long long int m) {
  return ((a % m) * (b % m)) % m;
}
long long int modInverse(long long int a, long long int m) {
  return modpower(a, m - 2, m);
}
long double power(long double x, long long int y) {
  long double temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
long long int modDivide(long long int a, long long int b, long long int m) {
  a = a % m;
  long long int inv = modInverse(b, m);
  return (inv * a) % m;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t1 = 1;
  while (t1--) {
    long long int n, x;
    cin >> n >> x;
    long long int a[n];
    for (long long int i = 0; i < n; i++) cin >> a[i];
    long long int m = (-1) * pow(10, 18);
    long long int dp[n][3];
    dp[0][0] = max(a[0], 0LL);
    dp[0][1] = max(a[0] * x, 0LL);
    dp[0][2] = max(0LL, a[0]);
    for (long long int i = 0; i < 3; i++) m = max(m, dp[0][i]);
    for (long long int i = 1; i < n; i++) {
      dp[i][0] = max(max(a[i], 0LL), dp[i - 1][0] + a[i]);
      dp[i][1] = max(max(max(a[i] * x, 0LL), dp[i - 1][1] + a[i] * x),
                     dp[i - 1][0] + a[i] * x);
      dp[i][2] = max(
          max(max(max(a[i], 0LL), dp[i - 1][0] + a[i]), dp[i - 1][1] + a[i]),
          dp[i - 1][2] + a[i]);
      for (long long int j = 0; j < 3; j++) m = max(m, dp[i][j]);
    }
    cout << m << "\n";
  }
  return 0;
}
