#include <bits/stdc++.h>
using namespace std;
const int N = 600050;
long long a[N], dp[N][3];
int main() {
  int n, x;
  scanf("%d%d", &n, &x);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = max(dp[i][0], max(dp[i - 1][0], 0ll) + a[i]);
    dp[i][1] = max(dp[i][1], max(dp[i - 1][0], 0ll) + a[i] * x);
    dp[i][1] = max(dp[i][1], dp[i - 1][1] + a[i] * x);
    dp[i][2] = max(dp[i][2], max(dp[i - 1][1], dp[i - 1][2]) + a[i]);
    ans = max(max(ans, dp[i][0]), max(dp[i][1], dp[i][2]));
  }
  printf("%lld\n", ans);
}
