#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int n, x;
  cin >> n >> x;
  vector<long long int> v(n + 1);
  for (long long int i = 1; i <= n; i++) {
    cin >> v[i];
  }
  vector<long long int> pref(n + 1, 0);
  for (long long int i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] + v[i];
  }
  vector<long long int> left(n + 1, 0), right(n + 2, 0);
  long long int smin = 0;
  for (long long int i = 1; i <= n; i++) {
    smin = min(smin, pref[i]);
    left[i] = max((long long int)0, pref[i] - smin);
  }
  long long int smax = pref[n];
  for (long long int i = n; i >= 1; i--) {
    smax = max(smax, pref[i]);
    right[i] = max((long long int)0, smax - pref[i - 1]);
  }
  long long int ans = 0, best = 0;
  for (long long int i = 1; i <= n; i++) {
    ans = max(ans, (pref[i] * x) + right[i + 1] + best);
    ans = max(ans, left[i]);
    best = max(best, left[i] - (pref[i] * x));
  }
  cout << ans << '\n';
}
