#include <bits/stdc++.h>
using namespace std;
const int nmax = 1000010;
long long MIN = ((long long)1 << 63) - 1;
long long MAX = -MIN;
int n, m;
long double ans[nmax];
long double r, x;
vector<vector<long double> > vr;
void solve() {
  cin >> n >> r;
  vr.resize(1000 + 7);
  for (int i = 0; i < n; ++i) {
    cin >> x;
    long double mx = r;
    for (int j = max(0, (int)(x - 2 * r)); j <= min(1000, (int)(x + 2 * r));
         ++j) {
      if (vr[j].empty()) continue;
      long double d = vr[j][vr[j].size() - 1];
      long double c = 2 * r;
      long double a = fabs(j - x);
      long double b = sqrt(c * c - a * a);
      mx = max(mx, b + d);
    }
    vr[(int)x].push_back(mx);
    ans[i] = mx;
  }
  for (int i = 0; i < n; ++i) {
    cout.precision(7);
    cout << fixed << ans[i] << ' ';
  }
}
int main() {
  int t = 1;
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
