#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
struct node {
  long double l, r, mn, mx;
  node() { l = r = mn = mx = 0.0; }
  node(long double L, long double R, long double MN, long double MX) {
    l = L;
    r = R;
    mn = MN;
    mx = MX;
  }
};
struct LAS {
  long double l, r, k, b;
  LAS() {}
  LAS(long double L, long double R, long double K, long double B) {
    l = L;
    r = R;
    k = K;
    b = B;
  }
};
int n, q, A, B, a[500010], ts;
long double ans, ANS, P[500010];
node tmp[500010];
vector<LAS> las[100010];
void pr(int n, long double now) {
  P[n] = now;
  if (n > 1) {
    long double too;
    for (int i = 0; i <= ((int)las[n].size()) - 1; ++i) {
      LAS t = las[n][i];
      if (t.l <= now && now <= t.r) {
        too = now * t.k + t.b;
        break;
      }
    }
    pr(n - 1, too);
  }
  printf("%.10f ", (double)(now + 1.0 * (n - 1) * A + 1.0));
}
int main() {
  cin >> n >> q >> A >> B;
  B -= A;
  q -= (n - 1) * A + 1;
  for (int i = 1; i <= n; ++i) getint(a[i]), a[i] -= (i - 1) * A + 1;
  B = min(B, q);
  tmp[ts = 1] = node(0.0, 1.0 * q, 0, 0);
  for (int i = 1; i <= n; ++i) {
    if (tmp[1].mn >= 0) {
      las[i].push_back(LAS(0.0, 1.0 * B, 0, 0));
      las[i].push_back(LAS(1.0 * B, q, 1, -B));
      for (int j = ts + 1; j >= 2; --j)
        tmp[j] = tmp[j - 1], tmp[j].l += B, tmp[j].r += B;
      tmp[1].l = 0, tmp[1].r = B;
      tmp[1].mn = 0.0, tmp[1].mx = 0.0;
      ++ts;
      while (tmp[ts].l > q) --ts;
      int j = ts;
      long double L = tmp[j].l;
      long double k = (tmp[j].mx - tmp[j].mn) / (tmp[j].r - tmp[j].l);
      long double R = q;
      long double MN = tmp[j].mn;
      long double MX = tmp[j].mn + (R - L) * k;
      tmp[j] = node(L, R, MN, MX);
    } else if (tmp[1].mn < 0 && tmp[ts].mx > 0) {
      int w = 0;
      for (int j = 1; j <= ts; ++j) {
        if (tmp[j].mn <= 0.0 && tmp[j].mx >= 0.0) {
          w = j;
          break;
        }
      }
      if (!w) {
        for (int j = 1; j <= ts; ++j)
          if (tmp[j].mx < 0) w = j;
        las[i].push_back(LAS(0.0, tmp[w].r, 1, 0));
        las[i].push_back(LAS(tmp[w].r, tmp[w].r + B, 0, tmp[w].r));
        las[i].push_back(LAS(tmp[w].r + B, 1.0 * q, 1, -B));
        for (int j = ts + 1; j >= w + 2; --j)
          tmp[j] = tmp[j - 1], tmp[j].l += B, tmp[j].r += B;
        tmp[w + 1].l = tmp[w].r;
        tmp[w + 1].r = tmp[w].r + B;
        tmp[w + 1].mn = 0.0;
        tmp[w + 1].mx = 0.0;
        ++ts;
        while (tmp[ts].l > q) --ts;
        int j = ts;
        long double L = tmp[j].l;
        long double k = (tmp[j].mx - tmp[j].mn) / (tmp[j].r - tmp[j].l);
        long double R = q;
        long double MN = tmp[j].mn;
        long double MX = tmp[j].mn + (R - L) * k;
        tmp[j] = node(L, R, MN, MX);
      } else if (tmp[w].mx - tmp[w].mn < 1e-10) {
        las[i].push_back(LAS(0.0, tmp[w].l, 1, 0));
        las[i].push_back(LAS(tmp[w].l, tmp[w].l + B, 0, tmp[w].l));
        las[i].push_back(LAS(tmp[w].l + B, q, 1, -B));
        tmp[w].r += B;
        for (int j = w + 1; j <= ts; ++j) tmp[j].l += B, tmp[j].r += B;
        while (tmp[ts].l > q) --ts;
        int j = ts;
        long double L = tmp[j].l;
        long double k = (tmp[j].mx - tmp[j].mn) / (tmp[j].r - tmp[j].l);
        long double R = q;
        long double MN = tmp[j].mn;
        long double MX = tmp[j].mn + (R - L) * k;
        tmp[j] = node(L, R, MN, MX);
      } else {
        long double k = (tmp[w].mx - tmp[w].mn) / (tmp[w].r - tmp[w].l);
        long double t = tmp[w].l - tmp[w].mn / k;
        las[i].push_back(LAS(0.0, t, 1, 0));
        las[i].push_back(LAS(t, t + B, 0, t));
        las[i].push_back(LAS(t + B, q, 1, -B));
        for (int j = ts + 2; j >= w + 2; --j)
          tmp[j] = tmp[j - 2], tmp[j].l += B, tmp[j].r += B;
        tmp[w + 2].l = t + B;
        tmp[w + 2].mn = 0.0;
        tmp[w].r = t;
        tmp[w].mx = 0.0;
        tmp[w + 1].l = t;
        tmp[w + 1].r = t + B;
        tmp[w + 1].mn = 0.0;
        tmp[w + 1].mx = 0.0;
        ts += 2;
        while (tmp[ts].l > q) --ts;
        int j = ts;
        long double L = tmp[j].l;
        k = (tmp[j].mx - tmp[j].mn) / (tmp[j].r - tmp[j].l);
        long double R = q;
        long double MN = tmp[j].mn;
        long double MX = tmp[j].mn + (R - L) * k;
        tmp[j] = node(L, R, MN, MX);
      }
    } else {
      las[i].push_back(LAS(0.0, 1.0 * q, 1, 0));
    }
    for (int j = 1; j <= ts; ++j) {
      tmp[j].mn += tmp[j].l * 2 - a[i] * 2;
      tmp[j].mx += tmp[j].r * 2 - a[i] * 2;
    }
  }
  for (int i = 1; i <= n; ++i) ans += 1.0 * a[i] * a[i];
  ANS = 0.0;
  for (int j = 1; j <= ts; ++j) {
    if (tmp[j].mn >= 0) break;
    if (tmp[j].mx <= 0) {
      ans += 0.5 * (tmp[j].mx + tmp[j].mn) * (tmp[j].r - tmp[j].l);
      ANS = tmp[j].r;
    } else {
      long double L = tmp[j].l;
      long double k = (tmp[j].mx - tmp[j].mn) / (tmp[j].r - tmp[j].l);
      long double R = L - tmp[j].mn / k;
      ANS = R;
      long double MN = tmp[j].mn;
      long double MX = tmp[j].mn + (R - L) * k;
      ans += 0.5 * (MX + MN) * (R - L);
      break;
    }
  }
  pr(n, ANS);
  puts("");
  ans = 0.0;
  for (int i = 1; i <= n; ++i) ans += (a[i] - P[i]) * (a[i] - P[i]);
  printf("%.10f\n", (double)ans);
  return 0;
}
