#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int main() {
  long long n, x, y, a = 0, b = 0, c = 0, ans = 0;
  cin >> n >> x;
  while (n--) {
    cin >> y;
    a = max(0ll, a + y);
    b = max(a, b + y * x);
    c = max(b, c + y);
    ans = max(ans, c);
  }
  cout << ans << endl;
  return 0;
}
