#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, x;
  cin >> n >> x;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<vector<long long> > dp(n + 1, vector<long long>(5, -1e9));
  for (int i = 0; i < 5; ++i) dp[0][i] = 0;
  for (int i = 1; i <= n; ++i) {
    dp[i][1] = a[i - 1];
    dp[i][2] = a[i - 1] * x;
    dp[i][3] = a[i - 1];
  }
  long long ans = 0;
  for (int j = 1; j < 5; ++j)
    for (int i = 1; i <= n; ++i)
      dp[i][j] += max(0ll, max(dp[i - 1][j], dp[i - 1][j - 1]));
  for (int i = 1; i <= 3; ++i)
    for (int j = 1; j <= n; ++j) ans = max(ans, dp[j][i]);
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0);
  int TTT = 1;
  while (TTT--) {
    solve();
  }
}
