#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007ll;
long long n, x;
long long arr[1014159];
long long dp[1014159][4];
long long get(long long idx, long long f) {
  if (idx == n + 1) return 0;
  long long& ans = dp[idx][f];
  if (ans != -1) return ans;
  ans = 0;
  if (f == 0) {
    ans = max(
        {ans, arr[idx] + get(idx + 1, f), arr[idx] * x + get(idx + 1, f + 1)});
  } else if (f == 1) {
    ans = max(
        {ans, arr[idx] * x + get(idx + 1, f), arr[idx] + get(idx + 1, f + 1)});
  } else {
    ans = max({ans, arr[idx] + get(idx + 1, f)});
  }
  return ans;
}
void solve() {
  cin >> n >> x;
  for (long long i = 1; i <= n; i++) cin >> arr[i];
  memset(dp, -1, sizeof dp);
  long long ans = 0;
  for (long long i = 1; i <= n; i++) ans = max(ans, get(i, 0));
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
