#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << std::fixed << std::setprecision(9);
  int n1;
  double n, r;
  cin >> n1 >> r;
  n = n1;
  double xx[n1];
  for (int i = 0; i < n; i++) cin >> xx[i];
  vector<pair<double, double>> vp;
  for (int i = 0; i < n; i++) {
    double x = xx[i];
    double y = r;
    for (auto e : vp) {
      if (abs(e.first - x) <= 2 * r) {
        double diff = abs(e.first - x);
        y = max(y, e.second + sqrt(4 * r * r - diff * diff));
      }
    }
    vp.push_back({x, y});
  }
  for (auto e : vp) cout << e.second << " ";
}
