#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
using pll = pair<long long, long long>;
using pil = pair<int, long long>;
using vi = vector<int>;
using vll = vector<long long>;
using vs = vector<string>;
int main() {
  int n, r;
  cin >> n >> r;
  vi x(n);
  vector<double> pos(n);
  for (auto& xi : x) cin >> xi;
  for (int i = 0; i < n; i++) {
    double d = r;
    for (int j = 0; j < i; j++) {
      if (abs(x[i] - x[j]) <= 2 * r) {
        d = max(d, sqrt(4.0 * r * r - (x[i] - x[j]) * (x[i] - x[j])) + pos[j]);
      }
    }
    pos[i] = d;
  }
  for (auto& x : pos) {
    cout.precision(20);
    cout << x << ' ';
  }
  return 0;
}
