#include <bits/stdc++.h>
using namespace std;
const int lmt = 5e5 + 100;
long long a[lmt], pre[lmt], suff[lmt], mx[4 * lmt], lazy[4 * lmt];
void build(int at, int L, int R) {
  if (L == R) {
    mx[at] = pre[L];
    return;
  }
  int mid = (L + R) / 2;
  build(at * 2, L, mid);
  build(at * 2 + 1, mid + 1, R);
  mx[at] = max(mx[at * 2], mx[at * 2 + 1]);
}
void update(int at, int L, int R, int l, int r, long long u) {
  if (lazy[at] != 0) {
    mx[at] += lazy[at];
    if (L != R) {
      lazy[at * 2] += lazy[at];
      lazy[at * 2 + 1] += lazy[at];
    }
    lazy[at] = 0;
  }
  if (r < L || R < l) return;
  if (l <= L && R <= r) {
    mx[at] += u;
    if (L != R) {
      lazy[at * 2] += u;
      lazy[at * 2 + 1] += u;
    }
    return;
  }
  int mid = (L + R) / 2;
  update(at * 2, L, mid, l, r, u);
  update(at * 2 + 1, mid + 1, R, l, r, u);
  mx[at] = max(mx[at * 2], mx[at * 2 + 1]);
}
long long query(int at, int L, int R, int l, int r) {
  if (lazy[at] != 0) {
    mx[at] += lazy[at];
    if (L != R) {
      lazy[at * 2] += lazy[at];
      lazy[at * 2 + 1] += lazy[at];
    }
    lazy[at] = 0;
  }
  if (r < L || R < l) return 0LL;
  if (l <= L && R <= r) return mx[at];
  int mid = (L + R) / 2;
  long long x = query(at * 2, L, mid, l, r),
            y = query(at * 2 + 1, mid + 1, R, l, r);
  return max(x, y);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  long long x;
  cin >> n >> x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    pre[i] = max(pre[i], pre[i - 1] + a[i]);
    ans = max(ans, pre[i]);
  }
  for (int i = n; i > 0; i--) {
    suff[i] = max(suff[i], suff[i + 1] + a[i]);
    ans = max(ans, suff[i]);
  }
  if (x > 0) {
    ans = max(ans, ans * x);
  }
  for (int i = n; i > 0; i--) {
    pre[i] = pre[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    suff[i] = suff[i + 1];
  }
  build(1, 1, n);
  for (int i = 1; i <= n; i++) {
    long long u = x * a[i];
    update(1, 1, n, 1, i, u);
    long long res = query(1, 1, n, 1, i);
    res += suff[i];
    ans = max(ans, res);
  }
  cout << ans << "\n";
  return 0;
}
