using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, k, x) = (c[0], c[1], c[2]); var a = NList; var dp = new long[2][]; for (var i = 0; i < dp.Length; ++i) dp[i] = Enumerable.Repeat(long.MaxValue / 2, n + 1).ToArray(); dp[0][0] = 0; for (var i = 0; i < n; ++i) { dp[0][i + 1] = Math.Min(dp[0][i], dp[1][i]) + a[i]; dp[1][i + 1] = Math.Min(dp[0][i] + k + x, dp[1][i] + k); } WriteLine(Math.Min(dp[0][n], dp[1][n])); } }