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;
using ll = long long;
using ld = long double;
using vi = vector<long long>;
using vii = vector<pair<long long, long long> >;
const long long INFI = 1e9 + 228;
const ll INFL = 1e18 + 228;
const ld INFLD = 1e18 + 228;
const ld PI = acos(-1);
const long long MAXN = 1e5 + 228;
vii DD = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
struct matrix {
  long long n, m;
  vector<vector<long long> > zn;
  matrix(long long rn, long long rm) {
    n = rn;
    m = rm;
    for (long long i = 0; i < n; ++i) {
      zn.push_back(vector<long long>());
      for (long long j = 0; j < m; ++j) {
        zn[i].push_back(0);
      }
    }
  }
};
matrix zero(long long n) {
  matrix now = matrix(n, n);
  for (long long i = 0; i < n; ++i) {
    now.zn[i][i] = 1;
  }
  return now;
}
long long add_mod(long long a, long long b, long long mod) {
  if (a + b >= mod) return a + b - mod;
  return a + b;
}
matrix pr(matrix a, matrix b, long long mod = -1) {
  matrix c = matrix(a.n, b.m);
  for (long long i = 0; i < a.n; ++i) {
    for (long long j = 0; j < b.m; ++j) {
      for (long long k = 0; k < a.m; ++k) {
        if (mod != -1)
          c.zn[i][j] = add_mod(c.zn[i][j], a.zn[i][k] * b.zn[k][j] % mod, mod);
        else
          c.zn[i][j] += a.zn[i][k] * b.zn[k][j];
      }
    }
  }
  return c;
}
void write(matrix a) {
  for (long long i = 0; i < a.n; ++i) {
    for (long long j = 0; j < a.m; ++j) {
      cerr << a.zn[i][j] << ' ';
    }
    cerr << endl;
  }
}
struct segtree {
  segtree *l = nullptr, *r = nullptr;
  long long lb, rb;
  long long sum = 0, add = 0;
  segtree(long long L, long long R) {
    lb = L;
    rb = R;
    if (lb + 1 < rb) {
      long long m = (lb + rb) / 2;
      l = new segtree(lb, m);
      r = new segtree(m, rb);
    }
  }
  void push() {
    sum += (rb - lb) * add;
    if (lb + 1 < rb) {
      l->add += add;
      r->add += add;
    }
    add = 0;
  }
  void upd(long long L, long long R, long long delta) {
    if (R <= lb || rb <= L) return;
    if (L <= lb && rb <= R) {
      add += delta;
      return;
    }
    l->upd(L, R, delta);
    r->upd(L, R, delta);
    sum = l->sum + r->sum + ((rb - lb) / 2) * (l->add + r->add);
  }
  long long get(long long L, long long R) {
    if (R <= lb || rb <= L) return 0;
    if (L <= lb && rb <= R) return sum + add;
    push();
    return l->get(L, R) + r->get(L, R);
  }
};
void run() {
  long long n, x;
  cin >> n >> x;
  long long mass[n + 1];
  for (long long i = 1; i <= n; ++i) {
    cin >> mass[i];
  }
  long long dp[n + 1][3][3];
  for (long long i = 0; i < n + 1; ++i) {
    for (long long j = 0; j <= 2; ++j) {
      for (long long k = 0; k <= 2; ++k) {
        dp[i][j][k] = -INFL;
      }
    }
  }
  dp[0][0][0] = 0;
  for (long long i = 1; i <= n; ++i) {
    for (long long p1 = 0; p1 <= 2; ++p1) {
      for (long long p2 = 0; p2 <= 2; ++p2) {
        for (long long q1 = p1; q1 <= 2; ++q1) {
          for (long long q2 = p2; q2 <= 2; ++q2) {
            long long now;
            if (q2 == 1)
              now = x * mass[i];
            else
              now = mass[i];
            dp[i][q1][q2] =
                max(dp[i][q1][q2], dp[i - 1][p1][p2] + (q1 == 1) * now);
          }
        }
      }
    }
  }
  cout << max(dp[n][2][2], max(dp[n][1][2], max(dp[n][2][1], dp[n][1][1])));
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) run();
  return 0;
}
