#include <bits/stdc++.h>
using namespace std;
int n, x;
long long a[300005], dp[300005][3], ans;
int main() {
  int i;
  cin >> n >> x;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) dp[i][0] = max(0LL, max(a[i], dp[i - 1][0] + a[i]));
  for (i = 1; i <= n; i++)
    dp[i][1] = max(0LL, max(dp[i - 1][0], dp[i - 1][1]) + x * a[i]);
  for (i = 1; i <= n; i++) {
    dp[i][2] = max(0LL, max(dp[i - 1][1], dp[i - 1][2]) + a[i]);
  }
  for (i = 1; i <= n; i++) {
    ans = max(ans, dp[i][0]);
    ans = max(ans, dp[i][1]);
    ans = max(ans, dp[i][2]);
  }
  cout << ans;
  return 0;
}
