#include <bits/stdc++.h>
using namespace std;
const int MAX = 3e5 + 5;
long long n, x;
long long a[MAX], dp[MAX][3];
int main() {
  dp[0][0] = dp[0][1] = dp[0][2] = 0;
  scanf("%lld%lld", &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] = a[i] + max(0ll, dp[i - 1][0]);
    dp[i][1] = a[i] * x + max(0ll, max(dp[i - 1][0], dp[i - 1][1]));
    dp[i][2] = a[i] + max(0ll, max(dp[i - 1][1], dp[i - 1][2]));
    ans = max(ans, max(dp[i][0], max(dp[i][1], dp[i][2])));
  }
  printf("%lld\n", ans);
  return 0;
}
