#include <bits/stdc++.h>
using namespace std;
long long dp[300100][5][5];
long long a[300100];
long long n, x;
long long MAX(long long a, long long b) { return a > b ? a : b; }
long long solve(long long i, long long s1, long long s2) {
  if (dp[i][s1][s2] != -1) return dp[i][s1][s2];
  long long maxi = -1e18;
  for (long long j = s1; j >= 0; j--) {
    for (long long k = s2; k >= 0; k--) {
      long long resp = solve(i - 1, j, k);
      maxi = MAX(resp, maxi);
    }
  }
  long long sum = s2 == 1 ? a[i - 1] * x : a[i - 1];
  if (s1 == 1) {
    maxi += sum;
  }
  return dp[i][s1][s2] = maxi;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  memset(dp, -1, sizeof(dp));
  cin >> n >> x;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) dp[0][i][j] = 0;
  cout << solve(n + 1, 2, 2) << endl;
  return 0;
}
