#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double r;
  cin >> n >> r;
  double x[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  vector<double> y;
  y.push_back(r);
  for (int i = 1; i < n; i++) {
    bool touch = false;
    double ymin = -1.0;
    for (int j = i - 1; j >= 0; j--)
      if (abs(x[i] - x[j]) <= 2 * r) {
        double sq = sqrt(4 * r * r - pow((x[i] - x[j]), 2));
        ymin = max(ymin, sq + y[j]);
        touch = true;
      }
    if (touch == false)
      y.push_back(r);
    else
      y.push_back(ymin);
  }
  for (int i = 0; i < y.size(); i++) printf("%.12lf ", y[i]);
  cout << endl;
  return 0;
}
