import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

immutable long INF = 1L << 59;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto X = s[1].to!long;
    auto A = readln.split.map!(to!long).array;

    auto dp = new long[][](N+1, 3);
    foreach (i; 0..N+1) dp[i][] = -INF;
    dp[0][0] = 0;

    foreach (i; 0..N) {
        long tmp = dp[i][0];
        dp[i+1][0] = max(dp[i+1][0], tmp + A[i], A[i]);

        tmp = max(tmp, dp[i][1]);
        dp[i+1][1] = max(dp[i+1][1], tmp + X * A[i], X * A[i]);

        tmp = max(tmp, dp[i][2]);
        dp[i+1][2] = max(dp[i+1][2], tmp + A[i], A[i]);
    }

    dp.map!(d => d.reduce!max).reduce!max.writeln;
}