#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  double r;
  cin >> n >> r;
  double X[n];
  for (int i = 0; i < n; i++) {
    cin >> X[i];
  }
  double Y[n];
  Y[0] = r;
  for (int i = 1; i < n; i++) {
    Y[i] = r;
    for (int j = 0; j < i; j++) {
      if (abs(X[i] - X[j]) <= 2 * r)
        Y[i] = max(Y[i], Y[j] + sqrt(4 * r * r + 2 * X[i] * X[j] - X[i] * X[i] -
                                     X[j] * X[j]));
    }
  }
  for (int i = 0; i < n; i++) {
    cout << fixed << setprecision(9) << Y[i] << ' ';
  }
  return 0;
}
