#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, x;
  cin >> n >> x;
  long long v[n], pref[n + 1];
  pref[0] = 0;
  for (int i = 0; i < n; i++) cin >> v[i], pref[i + 1] = pref[i] + v[i];
  long long ans = 0, ma = 0, dp[n + 2][2];
  dp[n + 1][1] = dp[0][0] = 0;
  for (int i = 0; i < n; i++) {
    dp[i + 1][0] = max(max(dp[i][0] + v[i], v[i]), 0LL);
    dp[n - i][1] = max(max(dp[n - i + 1][1] + v[n - i - 1], v[n - i - 1]), 0LL);
    ans = max(ans, dp[i + 1][0]);
  }
  for (int i = 0; i < n; i++) {
    ma = max(ma, dp[i][0] - x * pref[i]);
    ans = max(ans, dp[i + 2][1] + x * pref[i + 1] + ma);
  }
  cout << ans << endl;
}
