#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int n;
long double r, x[N], y[N];
int main() {
  cin >> n >> r;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    long double res = r;
    for (int j = 0; j < i; j++) {
      if (abs(x[i] - x[j]) <= 2 * r) {
        auto sqr = [](long double x) { return x * x; };
        long double cat = sqrt(sqr(2 * r) - sqr(abs(x[i] - x[j])));
        res = max(res, y[j] + cat);
      }
    }
    y[i] = res;
    cout << setprecision(8) << fixed << y[i] << ' ';
  }
  cout << endl;
  return 0;
}
