#include <bits/stdc++.h>
using namespace std;
void file() {}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long setbit(long long num, int idx, int val = 1) {
  return (val) ? (num | (1 << idx)) : (num & ~(1 << idx));
}
long long getbit(long long num, int idx) { return ((num >> idx) & 1) == 1; }
int contbit(int num) {
  int ret = 0;
  while (num) {
    if (num % 2) ret++;
    num /= 2;
  }
  return ret;
}
int dx[] = {-1, 0, 0, 1, 1, 1, -1, -1};
int dy[] = {0, 1, -1, 0, 1, -1, 1, -1};
long long mem[300005][4];
int n, x;
vector<long long> a;
long long dp(int idx, int k) {
  if (idx == n) return 0;
  long long &ret = mem[idx][k];
  if (ret != -1) return ret;
  long long ch1 = -1e18, ch2 = -1e18, ch3 = -1e18, ch4 = -1e18;
  if (k == 0) ch1 = dp(idx + 1, 0);
  if (k < 2) ch2 = a[idx] + dp(idx + 1, 1);
  if (k < 3) ch3 = x * a[idx] + dp(idx + 1, 2);
  if (k < 4) ch4 = a[idx] + dp(idx + 1, 3);
  ret = max({(long long)0, ch1, ch2, ch3});
  return ret;
}
int main() {
  file();
  fast();
  cin >> n >> x;
  a = vector<long long>(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  memset(mem, -1, sizeof mem);
  cout << dp(0, 0);
}
