#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using lint = long long;
using ti = tuple<int, int, int>;
const int N = 1e3 + 5;
double x[N];
double y[N];
double r, r2;
double go(int i) {
  double re = r;
  for (int j = 0; j < i; j++) {
    double d = abs(x[i] - x[j]);
    if (d <= 2 * r) {
      double dy = sqrt(r2 - d * d);
      dy += y[j];
      re = max(dy, re);
    }
  }
  return re;
}
int main() {
  int n;
  scanf("%d", &n);
  scanf("%lf", &r);
  r2 = 4 * r * r;
  for (int i = 0; i < n; i++) {
    scanf("%lf", x + i);
  }
  y[0] = r;
  for (int i = 1; i < n; i++) {
    y[i] = go(i);
  }
  for (int i = 0; i < n; i++) {
    printf("%.8lf ", y[i]);
  }
  return 0;
}
