#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const double DINF = 1e100;
const int MAXN = 6007;
const int MAXL = 15007;
const double EPS = 1e-12;
int n, q, a, b;
int xx[MAXN];
class fT {
 public:
  fT() : kk(0) {}
  void setd(int _k, int _b, int _l, int _r) {
    k[0] = _k, b[0] = _b, bn[0] = _l, bn[1] = _r, kk = 1;
  }
  void operator+=(const fT &x) { (*this) = (*this) + x; }
  fT operator+(const fT &x) const {
    fT ans;
    double ll = (((bn[0]) > (x.bn[0])) ? (bn[0]) : (x.bn[0])),
           rr = (((bn[kk]) < (x.bn[x.kk])) ? (bn[kk]) : (x.bn[x.kk]));
    int i1 = 0, i2 = 0;
    while (i1 <= kk && i2 <= x.kk) {
      if (i1 <= kk && bn[i1] < x.bn[i2]) {
        if ((!ans.kk || bn[i1] != ans.bn[ans.kk - 1]) &&
            (bn[i1] >= ll && bn[i1] <= rr))
          ans.bn[ans.kk++] = bn[i1];
        ++i1;
      } else {
        if ((!ans.kk || x.bn[i2] != ans.bn[ans.kk - 1]) &&
            (x.bn[i2] >= ll && x.bn[i2] <= rr))
          ans.bn[ans.kk++] = x.bn[i2];
        ++i2;
      }
    }
    --ans.kk;
    if (!ans.kk) ++ans.kk, ans.bn[ans.kk] = ans.bn[ans.kk - 1];
    int id1 = 0, id2 = 0;
    for (int i = 0; i < ans.kk; ++i) {
      while (id1 + 1 < kk && bn[id1 + 1] <= ans.bn[i]) ++id1;
      while (id2 + 1 < x.kk && x.bn[id2 + 1] <= ans.bn[i]) ++id2;
      ans.k[i] = k[id1] + x.k[id2];
      ans.b[i] = b[id1] + x.b[id2];
    }
    return ans;
  }
  void move(int ll, int rr) {
    for (int i = 0; i < kk; ++i) {
      bn[i] += ll;
      if (k[i]) b[i] -= k[i] * ll;
    }
    bn[kk] += ll;
    minp += ll;
    if (rr - ll) {
      for (int i = 0; i < kk; ++i) {
        if (minp >= bn[i] && minp <= bn[i + 1]) {
          if (minp - bn[i] > EPS) {
            bn[kk + 1] = bn[kk];
            for (int j = kk; j > i; --j)
              bn[j] = bn[j - 1], k[j] = k[j - 1], b[j] = b[j - 1];
            ++kk;
            bn[i + 1] = minp;
          } else
            --i;
          double del = rr - ll;
          bn[kk + 1] = bn[kk] + del;
          for (int j = kk; j > i + 1; --j)
            bn[j] = bn[j - 1] + del, k[j] = k[j - 1],
            b[j] = b[j - 1] - k[j - 1] * del;
          ++kk;
          bn[i + 2] = minp + del;
          k[i + 1] = 0;
          b[i + 1] = 0;
          break;
        }
      }
    }
  }
  double f(double x, int bid) { return (k[bid] * x + b[bid]); }
  double calcmin() {
    vmin = DINF;
    double v1, v2;
    for (int i = 0; i < kk; ++i) {
      v1 = f(bn[i], i), v2 = f(bn[i + 1], i);
      if (v1 > 0) {
        if (v1 < (((vmin) >= 0) ? (vmin) : (-(vmin)))) minp = bn[i], vmin = v1;
      } else if (v2 < 0) {
        if ((((v2) >= 0) ? (v2) : (-(v2))) <
            (((vmin) >= 0) ? (vmin) : (-(vmin))))
          minp = bn[i + 1], vmin = v2;
      } else {
        if (k[i])
          minp = -b[i] / k[i];
        else
          minp = bn[i];
        vmin = 0;
        break;
      }
    }
    return minp;
  }
  void print() {
    for (int i = 0; i < kk; ++i) {
      if (b[i] >= 0)
        printf("x=[%.6lf][%.6lf]: y=%.6lfx+%.6lf   R=[%.6lf][%.6lf]\n", bn[i],
               bn[i + 1], k[i], b[i], f(bn[i], i), f(bn[i + 1], i));
      else
        printf("x=[%.6lf][%.6lf]: y=%.6lfx%.6lf   R=[%.6lf][%.6lf]\n", bn[i],
               bn[i + 1], k[i], b[i], f(bn[i], i), f(bn[i + 1], i));
    }
    printf("minp=%.6lf   f(minp)=%.6lf\n", minp, vmin);
  }

 private:
  int kk;
  double k[MAXL], b[MAXL], bn[MAXL], minp, vmin;
} func1, func2, tmp;
double mp[MAXN];
void init();
void input();
void work();
double getmin(int lev, double nx);
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() {
  scanf("%d%d%d%d", &n, &q, &a, &b);
  for (int i = 1; i <= n; ++i) scanf("%d", &xx[i]);
}
void work() {
  fT *func = &func1, *la = &func2, *t;
  la->setd(2, -2 * xx[1], 1, q);
  la->calcmin();
  mp[1] = xx[1];
  for (int i = 2; i <= n; ++i) {
    *func = *la;
    func->move(a, b);
    tmp.setd(2, -2 * xx[i], a * (i - 1) + 1, q);
    *func += tmp;
    mp[i] = func->calcmin();
    t = func;
    func = la;
    la = t;
  }
  double ans = getmin(n, mp[n]);
  printf("%.9lf\n%.9lf\n", mp[n], ans);
}
double getmin(int lev, double nx) {
  if (lev == 1) return ((nx - xx[1]) * (nx - xx[1]));
  double tl = nx - b, tr = nx - a, cho;
  tl = (((tl) > (1LL * a * (lev - 2) + 1)) ? (tl) : (1LL * a * (lev - 2) + 1));
  double ans = ((nx - xx[lev]) * (nx - xx[lev]));
  if (tl > mp[lev - 1])
    ans += getmin(lev - 1, tl), cho = tl;
  else if (tr < mp[lev - 1])
    ans += getmin(lev - 1, tr), cho = tr;
  else
    ans += getmin(lev - 1, mp[lev - 1]), cho = mp[lev - 1];
  printf("%.9lf ", cho);
  return ans;
}
