#include <bits/stdc++.h>
using namespace std;
const int Inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const double eps = 1e-6;
struct Segment {
  double l, r;
  double bg, st, xl;
  double inline getval(double pos) const {
    return bg + (st + st + xl * (pos - l)) * (pos - l) / 2;
  }
  double inline get0() const {
    if (fabs(xl) < eps) return fabs(l) < eps ? 0 : -Inf;
    return l - st / xl;
  }
  void inline split(double pos, Segment &a, Segment &b) {
    a.l = l;
    a.r = pos;
    a.bg = bg;
    a.st = st;
    a.xl = xl;
    b.l = pos;
    b.r = r;
    b.bg = getval(pos);
    b.st = st + (pos - l) * xl;
    b.xl = xl;
  }
};
const int maxn = 6005;
int n, q, a, b;
struct SegFunc {
  Segment segs[12005];
  int segc;
  pair<int, double> inline get0() const {
    for (int i = 0; i < (segc); ++i) {
      if (segs[i].st > 0) return make_pair(i, segs[i].l);
      double p = segs[i].get0();
      if (p >= segs[i].l && p <= segs[i].r) {
        return make_pair(i, p);
      }
      if (!i && p < segs[i].l) return make_pair(i, segs[i].l);
      if (i == segc - 1 && p > segs[i].r) return make_pair(i, segs[i].r);
    }
    assert(0);
    return make_pair(Inf, Inf);
  }
  double inline getval(double p) {
    for (int i = 0; i < (segc); ++i) {
      if (p >= segs[i].l && p <= segs[i].r) {
        return segs[i].getval(p);
      }
    }
    return Inf;
  }
  int inline findpos(double p) {
    for (int i = 0; i < (segc); ++i)
      if (p >= segs[i].l && p <= segs[i].r) return i;
    return Inf;
  }
  void inline shr(double dis) {
    int pos = 0;
    double pp = 0;
    tie(pos, pp) = get0();
    Segment lp, rp;
    segs[pos].split(pp, lp, rp);
    static Segment nsegs[12005];
    int nsegc = pos, nsegbg = pos;
    if (lp.r - lp.l > eps) nsegs[nsegc++] = lp;
    if (dis > eps) nsegs[nsegc++] = {rp.l, rp.l + dis, rp.bg, 0, 0};
    rp.l += dis;
    rp.r += dis;
    if (rp.r - rp.l > eps) nsegs[nsegc++] = rp;
    for (int i = (pos + 1); i <= (segc - 1); ++i) {
      segs[i].l += dis;
      segs[i].r += dis;
      nsegs[nsegc++] = segs[i];
    }
    segc = nsegc;
    for (int i = (nsegbg); i <= (segc - 1); ++i) segs[i] = nsegs[i];
    while (segs[segc - 1].l >= q) --segc;
    segs[segc - 1].r = q;
  }
  void inline movr(double dis) {
    for (auto &it : (segs)) it.l += dis, it.r += dis;
    while (segs[segc - 1].l >= q) --segc;
    segs[segc - 1].r = q;
  }
  void inline add(const Segment &seg) {
    double nst = seg.st + seg.xl * (segs[0].l - seg.l);
    for (auto &it : (segs)) {
      it.bg += seg.getval(it.l);
      it.st += nst;
      it.xl += seg.xl;
      nst += seg.xl * (it.r - it.l);
    }
  }
};
int x[maxn];
SegFunc sf;
double mostpos[maxn];
int main() {
  scanf("%d%d%d%d", &n, &q, &a, &b);
  for (int i = 1; i <= (n); ++i) scanf("%d", x + i);
  sf.segs[0] = {1, (double)q, 1. * (1 - x[1]) * (1 - x[1]), 2. * (1 - x[1]), 2};
  sf.segc = 1;
  for (int i = 1; i <= (n); ++i) {
    if (i >= 2) {
      sf.movr(a);
      sf.shr(b - a);
      sf.add({1, (double)q, 1. * (1 - x[i]) * (1 - x[i]), 2. * (1 - x[i]), 2});
    }
    mostpos[i] = sf.get0().second;
  }
  double val = sf.getval(sf.get0().second);
  vector<double> res;
  double lst;
  res.push_back(lst = mostpos[n]);
  for (int i = (n - 1); (-1) > 0 ? i <= (1) : i >= (1); i += (-1)) {
    double xju = lst - mostpos[i];
    if (xju >= a && xju <= b)
      res.push_back(lst = mostpos[i]);
    else if (xju < a)
      res.push_back(lst -= a);
    else if (xju > b)
      res.push_back(lst -= b);
  }
  reverse((res).begin(), (res).end());
  for (auto &it : (res)) printf("%.6lf ", it);
  printf("\n%.6lf\n", val);
  return 0;
}
