#include <bits/stdc++.h>
const double eps = (1e-9);
using namespace std;
int dcmp(long double a, long double b) {
  return fabsl(a - b) <= eps ? 0 : (a > b) ? 1 : -1;
}
int getBit(int num, int idx) { return ((num >> idx) & 1) == 1; }
int setBit1(int num, int idx) { return num | (1 << idx); }
long long setBit0(long long num, int idx) { return num & ~(1ll << idx); }
long long flipBit(int num, int idx) { return num ^ (1 << idx); }
void FS() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int N = 300009;
int n, x;
long long mem[N][10][10], a[N];
long long solve(int pos, int tak, int str) {
  if (pos == n) return 0;
  long long &ret = mem[pos][tak][str];
  if (ret != -1) return ret;
  long long ans = 0;
  if (str == 0) {
    ans = max(ans, a[pos] * x + solve(pos + 1, 1, 1));
    ans = max(ans, a[pos] * x + solve(pos + 1, 1, 2));
    ans = max(ans, a[pos] + solve(pos + 1, 0, 1));
    ans = max(ans, a[pos] + solve(pos + 1, 0, 2));
    ans = max(ans, solve(pos + 1, 0, 0));
  } else if (str == 1) {
    if (tak != 2)
      ans = max(ans, a[pos] * x + solve(pos + 1, 1, 1)),
      ans = max(ans, a[pos] * x + solve(pos + 1, 1, 2));
    if (tak == 1)
      ans = max(ans, a[pos] + solve(pos + 1, 2, 1)),
      ans = max(ans, a[pos] + solve(pos + 1, 2, 2));
    else
      ans = max(ans, a[pos] + solve(pos + 1, tak, 1)),
      ans = max(ans, a[pos] + solve(pos + 1, tak, 2));
  } else {
    ans = solve(pos + 1, tak, 2);
  }
  return ret = ans;
}
int main() {
  FS();
  cin >> n >> x;
  for (int i = 0; i < n; i++) cin >> a[i];
  memset(mem, -1, sizeof(mem));
  cout << solve(0, 0, 0) << endl;
}
