#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3 * 100010;
int v[MAXN];
const int NOX = 0, USEDX = 1, LASTX = 2;
long long dp[MAXN][3];
int n, x;
inline void relax(long long &a, long long b) { a = max(a, b); }
int main() {
  scanf("%d%d", &n, &x);
  long long best = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &v[i]);
    relax(dp[i][NOX], dp[i - 1][NOX] + v[i]);
    relax(dp[i][LASTX], dp[i - 1][LASTX] + 1LL * v[i] * x);
    relax(dp[i][LASTX], dp[i - 1][NOX] + 1LL * v[i] * x);
    relax(dp[i][USEDX], dp[i - 1][USEDX] + v[i]);
    relax(dp[i][USEDX], dp[i - 1][LASTX] + v[i]);
    for (int j = 0; j < 3; ++j) relax(best, dp[i][j]);
  }
  printf("%I64d\n", best);
  return 0;
}
