#include <bits/stdc++.h>
using namespace std;
inline int Read() {
  int x = 0, f = 1, c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 6005;
pair<double, double> c[MAXN << 1];
double ret, x[MAXN], ans[MAXN];
int n, m, t, p, a, b;
int main() {
  n = Read(), t = Read(), a = Read(), b = Read();
  for (int i = 1; i <= n; i++) {
    x[i] = Read();
    if (i == 1)
      c[m++] = make_pair(1, 2 * (1 - x[i])),
      c[m++] = make_pair(t, 2 * (t - x[i]));
    else {
      for (int j = m - 1; j > p; j--) c[j + 2] = c[j];
      m += 2, c[++p] = make_pair(ans[i - 1], 0),
              c[p + 1] = make_pair(ans[i - 1], 0);
      for (int j = 0; j <= p; j++) c[j].first += a;
      for (int j = p + 1; j < m; j++) c[j].first += b;
      for (int j = 0; j < m; j++) c[j].second += 2 * (c[j].first - x[i]);
    }
    if (c[0].second >= 0)
      p = -1, ans[i] = c[0].first;
    else {
      for (p = 0; p < m; p++)
        if (c[p].second <= 0 && c[p + 1].second > 0) break;
      ans[i] = c[p].first - c[p].second * (c[p + 1].first - c[p].first) /
                                (c[p + 1].second - c[p].second);
    }
  }
  ans[n] = min(ans[n], (double)t);
  for (int i = n - 1; i; i--)
    ans[i] = max(min(ans[i], ans[i + 1] - a), ans[i + 1] - b);
  for (int i = 1; i <= n; i++)
    printf("%lf%c", ans[i], i == n ? '\n' : ' '),
        ret += (ans[i] - x[i]) * (ans[i] - x[i]);
  return printf("%lf\n", ret), 0;
}
