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