#include <bits/stdc++.h>
using namespace std;
long double getreal(long double a, long double b, long double r,
                    long double y0) {
  long double dx = abs(a - b);
  long double y = sqrt(4 * r * r - dx * dx);
  return y + y0;
}
int main() {
  int n;
  int r;
  cin >> n >> r;
  vector<int> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  vector<long double> y(n);
  for (int i = 0; i < n; i++) {
    y[i] = r;
    for (int j = 0; j < i; j++)
      if (abs(x[i] - x[j]) <= 2 * r)
        y[i] = max(y[i], getreal(x[i], x[j], r, y[j]));
  }
  for (int i = 0; i < n; i++) cout << setprecision(12) << fixed << y[i] << ' ';
}
