#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  long long maximize(vector<int>& nums, int x) {
    int n = nums.size();
    vector<vector<long long>> dp(3, vector<long long>(n + 1, 0));
    long long res = 0;
    for (int i = 0; i < n; ++i) {
      long long num = nums[i];
      dp[0][i + 1] = max(0LL, dp[0][i] + num);
      dp[1][i + 1] = max(0LL, max(dp[0][i], dp[1][i]) + num * x);
      dp[2][i + 1] = max(0LL, max(dp[2][i], dp[1][i]) + num);
    }
    for (int j = 0; j < 3; ++j) {
      for (int i = 0; i <= n; ++i) {
        res = max(res, dp[j][i]);
      }
    }
    return res;
  }
};
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Solution sol;
  int n, x;
  cin >> n >> x;
  vector<int> nums(n);
  for (int i = 0; i < n; ++i) {
    cin >> nums[i];
  }
  cout << sol.maximize(nums, x) << "\n";
  return 0;
}
