#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6, PI = acos(-1);
const long long OO = 1e18;
const long long N = 1e7 + 7, oo = 1e9 + 1, M = 2000002, mod = 1e9 + 7, K = 12;
const int di[] = {1, -1, 0, 0};
const int dj[] = {0, 0, 1, -1};
int i, j;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  double n, r;
  cin >> n >> r;
  deque<pair<double, double> > v;
  for (i = 0; i < n; i++) {
    double x;
    cin >> x;
    double mx = r;
    for (j = v.size() - 1; j >= 0; j--) {
      auto f = v[j];
      if (abs(x - f.first) > r * 2) continue;
      if (abs(f.first - x) == r * 2) {
        mx = max(mx, f.second);
        continue;
      }
      double d = r * 2, bfx = (f.first - x) * (f.first - x);
      d *= d;
      d -= bfx;
      double s = sqrt(d);
      s += f.second;
      mx = max(mx, s);
    }
    v.push_back({x, mx});
  }
  for (auto f : v) cout << setprecision(12) << f.second << " ";
}
