#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); };
vector<int> a;
long long n, x;
long long dp[300001][5];
long long f(long long i, long long t) {
  if (i == n) return 0;
  if (dp[i][t] != -1) return dp[i][t];
  dp[i][t] = 0;
  if (t == 0) {
    return dp[i][t] = max(f(i + 1, t), f(i, t + 1));
  } else if (t == 1) {
    return dp[i][t] = max(f(i + 1, t) + a[i], f(i, t + 1));
  } else if (t == 2) {
    return dp[i][t] = max(f(i + 1, t) + a[i] * x, f(i, t + 1));
  } else if (t == 3) {
    return dp[i][t] = max(f(i + 1, t) + a[i], 0ll);
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  long long b;
  cin >> n >> x;
  for (long long i = 0; i < n; i++) {
    cin >> b;
    a.push_back(b);
  }
  memset(dp, -1, sizeof(dp));
  cout << f(0, 0) << "\n";
};
