#include <bits/stdc++.h>
using namespace std;
typedef struct node* ntp;
ntp st[110000], rt;
struct node {
  ntp c[2], f;
  double x, dx, y, k, b;
  inline int d(void) { return f->c[1] == this; }
  inline void sc(ntp x, int d) {
    if (this)
      if (c[d] = x) x->f = this;
  }
  inline void rot(void) {
    ntp p = f;
    int dd = d();
    if (!p->f)
      f = NULL, rt = this;
    else
      p->f->sc(this, p->d());
    p->sc(c[!dd], dd), sc(p, !dd);
  }
  inline void down(int x) {
    if (c[x]) c[x]->b += b - dx * c[x]->k, c[x]->dx += dx, c[x]->k += k;
  }
  inline void down(void) {
    if (!this) return;
    x += dx, y += k * x + b, down(0), down(1), k = b = dx = 0;
  }
  void push(void) {
    ntp t = this;
    int top = 0;
    while (t) st[++top] = t, t = t->f;
    while (top) st[top--]->down();
  }
  void splay(void) {
    push();
    while (f) {
      if (!f->f)
        rot();
      else
        (f->d() == d() ? f : this)->rot(), rot();
    }
  }
  ntp next(int x) {
    down();
    ntp t = c[x];
    while (t->c[!x]) (t = t->c[!x])->down();
    return t;
  }
  ntp get(void) {
    ntp t = this, s = NULL;
    down();
    while (true) {
      if (t->y > 0) s = t;
      if (fabs(t->y) <= 1E-12) return t;
      bool d = t->y < 0;
      if (!t->c[d]) return s;
      (t = t->c[d])->down();
    }
  }
  void print(void) {
    down();
    if (c[0]) c[0]->print();
    printf("[%.5lf %.5lf]", x, y), fflush(stdout);
    if (c[1]) c[1]->print();
  }
  void pr(void) { print(), puts(""), fflush(stdout); }
} pool[110000], *pos = pool;
int xi[110000];
double yi[110000], mins[110000];
int n, q, A, B;
inline ntp gnew(double x, double y) {
  pos++, pos->x = x, pos->y = y;
  return pos;
}
void solve(void) {
  rt = gnew(1.0, 2.0 * (1 - xi[1])), rt->sc(gnew(q, 2.0 * (q - xi[1])), 1);
  rt->sc(gnew(-1, -1E30), 0);
  for (int i = 2; i <= n; i++) {
    rt->get()->splay();
    double& p = mins[i - 1];
    ntp t, t2;
    if (fabs(rt->y) <= 1E-12) {
      rt->y = 0, p = rt->x;
      if (A != B) t = gnew(p, 0), t->sc(rt->c[1], 1), rt->sc(t, 1);
    } else {
      double X1 = rt->x, Y1 = rt->y, X2, Y2;
      rt->next(0)->splay(), X2 = rt->x, Y2 = rt->y;
      p = (X2 * Y1 - Y2 * X1) / (Y1 - Y2);
      if (A != B) {
        t = gnew(p, 0), t->sc(rt->c[1], 1), rt->sc(t, 1);
        t2 = gnew(p, 0), t2->sc(rt->c[1], 1), rt->sc(t2, 1), t2->splay();
      }
    }
    if (A != B)
      t->dx = B, t->push(), t->splay(), rt->c[0]->dx = A;
    else
      rt->dx = A;
    rt->k = 2, rt->b = -2.0 * xi[i];
  }
  rt->get()->splay();
  double ts;
  if (fabs(rt->y) <= 1E-12)
    ts = rt->x;
  else {
    double X1 = rt->x, Y1 = rt->y, X2, Y2;
    rt->next(0)->splay(), X2 = rt->x, Y2 = rt->y;
    ts = (X2 * Y1 - Y2 * X1) / (Y1 - Y2);
  }
  yi[n] = ts > q ? q : max(ts, (double)A * (n - 1) + 1);
  for (int i = n - 1; i >= 1; i--)
    yi[i] = yi[i + 1] < mins[i] + A   ? yi[i + 1] - A
            : yi[i + 1] > mins[i] + B ? yi[i + 1] - B
                                      : mins[i];
}
int main(void) {
  scanf("%d%d%d%d", &n, &q, &A, &B);
  for (int i = 1; i <= n; i++) scanf("%d", xi + i);
  solve();
  for (int i = 1; i <= n; i++) printf("%lf ", yi[i]);
  double ans = 0;
  for (int i = 1; i <= n; i++) ans += ((xi[i] - yi[i]) * (xi[i] - yi[i]));
  printf("\n%lf\n", ans);
  return 0;
}
