#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double r;
  scanf("%d %lf", &n, &r);
  double x[1005];
  double ansy[1005];
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &x[i]);
  }
  ansy[1] = r;
  for (int i = 2; i <= n; i++) {
    double sx = x[i] - r;
    double sy = x[i] + r;
    int maxi = -1;
    ansy[i] = r;
    for (int j = 1; j < i; j++) {
      double sxx = x[j] - r;
      double syy = x[j] + r;
      if ((sxx >= sx && syy <= sy) || (sxx <= sx && syy <= sy && syy >= sx) ||
          (sxx <= sy && sxx >= sx && syy >= sy)) {
        maxi = j;
        double rr = r * r;
        double diffx = (x[maxi] + (double)x[i]) / 2.0 - x[maxi];
        diffx = diffx * diffx;
        double left = sqrt(rr - diffx);
        double ycord = left * 1.00 + ansy[maxi];
        diffx = (x[maxi] * 1.00 + (double)x[i]) / 2.0 - x[i] * 1.00;
        diffx = diffx * diffx;
        left = (double)sqrt(rr * 1.00 - diffx * 1.00);
        ansy[i] = max(ycord + left * 1.00, ansy[i]);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%0.10lf\n", ansy[i]);
  }
  return 0;
}
