#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long int INF = 1e12;
const int N = 3e5 + 1;
long long int ans = 0, x;
long long int dp[N][3];
long long int solve(int arr[], int n, int usable) {
  if (n == 0) return 0;
  long long int curAns = 0;
  if (dp[n][usable] != -1) return dp[n][usable];
  if (!usable) {
    curAns = max(
        curAns, max(0LL + arr[n - 1], 0LL + arr[n - 1] + solve(arr, n - 1, 0)));
  } else {
    curAns = max(curAns, max(0LL + arr[n - 1],
                             0LL + arr[n - 1] +
                                 solve(arr, n - 1, (usable == 2) ? 0 : 1)));
    curAns = max(curAns, max(0LL + (x * arr[n - 1]),
                             0LL + (x * arr[n - 1]) + solve(arr, n - 1, 2)));
  }
  ans = max(ans, curAns);
  return dp[n][usable] = curAns;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  memset(dp, -1, sizeof(dp));
  int n;
  cin >> n >> x;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  solve(arr, n, 1);
  cout << ans;
  return 0;
}
