#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
int n;
long long x;
long long a[N], b[N];
long long beauty() {
  long long res = max(0ll, a[0]);
  long long now = a[0];
  for (int i = 1; i < n; i++) {
    now = max(now + a[i], a[i]);
    res = max(res, now);
  }
  now = b[0];
  for (int i = 1; i < n; i++) {
    now = max(now + b[i], b[i]);
    res = max(res, now);
  }
  return res;
}
int main() {
  scanf("%d %I64d", &n, &x);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  for (int i = 0; i < n; i++) b[i] = a[i] * x;
  if (n == 1)
    printf("%I64d\n", max(max(a[0], b[0]), 0ll));
  else {
    long long res = beauty();
    long long segl[n], segr[n];
    segl[0] = max(0ll, a[0]);
    for (int i = 1; i < n; i++)
      segl[i] = max(max(segl[i - 1] + a[i], a[i]), 0ll);
    segr[n - 1] = max(0ll, a[n - 1]);
    for (int i = n - 2; i >= 0; i--)
      segr[i] = max(max(segr[i + 1] + a[i], a[i]), 0ll);
    long long bestl[n], bestr[n];
    bestl[0] = max(b[0], segl[0]);
    for (int i = 1; i < n; i++) bestl[i] = max(bestl[i - 1] + b[i], segl[i]);
    bestr[n - 1] = max(b[n - 1], segr[n - 1]);
    for (int i = n - 2; i >= 0; i--)
      bestr[i] = max(bestr[i + 1] + b[i], segr[i]);
    for (int i = 0; i < n - 1; i++) res = max(res, bestl[i] + bestr[i + 1]);
    printf("%I64d\n", res);
  }
  return 0;
}
