#include <bits/stdc++.h>
using namespace std;
map<int, double> use;
inline long double f(int a, int b, int c) {
  long double rez = sqrt((4 * a * a) - ((b - c) * (b - c)));
  return rez;
}
int main() {
  ::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, r;
  cin >> n >> r;
  const int g = n;
  int x[1005];
  double c;
  int v;
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 0; i < n; ++i) {
    c = 0;
    v = 0;
    long double curans = 0;
    for (int j = 0; j < i; ++j) {
      if (abs(x[i] - x[j]) <= 2 * r)
        curans = max(f(r, x[i], x[j]) + use[x[j]], curans);
    }
    if (curans == 0) {
      use[x[i]] = r;
      cout << r << " ";
    } else {
      use[x[i]] = curans;
      cout << fixed << setprecision(10) << curans << " ";
    }
  }
}
