#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int n;
long long a[N], x, d[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> x;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) d[i] = a[i] + max(0ll, d[i - 1]);
  for (int i = 1; i <= n; i++) d[i] = max(d[i], a[i] * x + max(0ll, d[i - 1]));
  for (int i = 1; i <= n; i++) d[i] = max(d[i], a[i] + max(0ll, d[i - 1]));
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, d[i]);
  cout << ans;
  return 0;
}
