#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, r;
  cin >> n >> r;
  int x[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  map<int, double> mp;
  vector<double> res;
  for (int i = 0; i < n; i++) {
    double h = r;
    for (int j = x[i] - 2 * r; j < x[i] + 2 * r + 1; j++) {
      if (mp[j]) {
        h = max(h, mp[j] + sqrt(4 * r * r - (x[i] - j) * (x[i] - j)));
      }
    }
    mp[x[i]] = max(mp[x[i]], h);
    res.push_back(h);
  }
  cout.precision(20);
  for (int i = 0; i < n; i++) cout << res[i] << " ";
  cout << endl;
  return 0;
}
