#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int n, x;
long long f[N], g[N], h[N], a[N];
long long ans;
int main() {
  scanf("%d%d", &n, &x);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n; i++) {
    f[i] = max(f[i - 1] + a[i], 0ll);
    g[i] = max(max(f[i - 1] + a[i] * x, g[i - 1] + a[i] * x), 0ll);
    h[i] = max(max(g[i - 1] + a[i], h[i - 1] + a[i]), 0ll);
    ans = max(ans, max(max(f[i], g[i]), h[i]));
  }
  printf("%I64d\n", ans);
  return 0;
}
