#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, r;
  cin >> n >> r;
  vector<long long> x(n);
  vector<double> res;
  for (auto &e : x) cin >> e;
  for (long long i = 0; i < n; i++) {
    double ans = r * 1.0;
    for (long long j = 0; j < i; j++) {
      if (abs(x[i] - x[j]) <= 2 * r) {
        double tmp = (4 * r * r) - (abs(x[i] - x[j]) * abs(x[i] - x[j]));
        tmp = sqrt(tmp) + res[j];
        ans = max(tmp, ans);
      }
    }
    res.push_back(ans);
  }
  for (auto e : res) cout << fixed << setprecision(12) << e << " ";
  return 0;
}
