#include <bits/stdc++.h>
using namespace std;
char tab[55][55];
int main() {
  int n, r;
  cin >> n >> r;
  vector<int> xs;
  vector<double> ys;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    xs.push_back(x);
  }
  for (int i = 0; i < xs.size(); i++) {
    double maxi = -1;
    for (int j = 0; j < i; j++) {
      if (abs(xs[i] - xs[j]) <= 2 * r) {
        int x1 = xs[j];
        double y1 = ys[j];
        int x2 = xs[i];
        double y2 = sqrt(double(4 * r * r - (x2 - x1) * (x2 - x1))) + y1;
        if (y2 > maxi) maxi = y2;
      }
    }
    if (maxi == -1)
      ys.push_back(r);
    else
      ys.push_back(maxi);
  }
  cout.precision(13);
  for (int i = 0; i < n; i++) cout << ys[i] << ' ';
  return 0;
}
