#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
void fastio();
void getIOfromFile();
void getElapsedTime();
const ll maxn = 1e5;
void solve() {
  ll n, x;
  cin >> n >> x;
  vector<ll> a(n + 1);
  for (ll i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<ll> dp1(n + 1, 0), dp2(n + 1, 0), dp3(n + 1, 0);
  dp1[1] = max(0LL, a[1]);
  dp2[1] = max(0LL, a[1] * x);
  dp3[1] = 0;
  ll ans = max({dp1[1], dp2[1], dp3[1]});
  for (ll i = 2; i <= n; i++) {
    dp1[i] = max({0LL, dp1[i - 1] + a[i], a[i]});
    dp2[i] = max({0LL, dp1[i - 1] + a[i] * x, dp2[i - 1] + a[i] * x});
    dp3[i] = max({0LL, dp2[i - 1] + a[i], dp3[i - 1] + a[i]});
    ans = max({ans, dp1[i], dp2[i], dp3[i]});
  }
  cout << ans << "\n";
}
int main() {
  fastio();
  int test = 1;
  for (int i = 1; i <= test; i++) {
    solve();
  }
  return 0;
}
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
void getIOfromFile() {
  string filename = "";
  freopen((filename + ".in").c_str(), "r", stdin);
  freopen((filename + ".out").c_str(), "w", stdout);
}
void getElapsedTime() {}
