#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int dx[] = {-1, 0, 1, 0, -1, 1, 1, -1};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
int main() {
  cin.sync_with_stdio(false);
  cin.tie(nullptr);
  int n, x;
  cin >> n >> x;
  ll arr[300000];
  for (int i = 0; i < n; ++i) cin >> arr[i];
  ll dp[3][300001]{}, ans = 0;
  for (int i = 0; i < n; ++i) {
    dp[0][i + 1] = max(dp[0][i] + arr[i], arr[i]);
    dp[1][i + 1] = max(max(dp[1][i], dp[0][i]) + arr[i] * x, arr[i] * x);
    dp[2][i + 1] = max(dp[2][i] + arr[i], dp[1][i] + arr[i]);
    ans = max({ans, dp[0][i + 1], dp[1][i + 1], dp[2][i + 1]});
  }
  cout << ans;
  return 0;
}
