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