#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 1e6 + 6;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(12);
  cout << fixed;
  int n, r;
  cin >> n >> r;
  vector<int> xs;
  vector<ld> ys;
  for (int i = 0; i < n; ++i) {
    ld x;
    cin >> x;
    ld y = r;
    for (int j = 0; j < i; ++j) {
      ll l1 = x - r, r1 = x + r;
      ll l2 = xs[j] - r, r2 = xs[j] + r;
      if (max(r1, r2) - min(l1, l2) <= r1 - l1 + r2 - l2) {
        ld A = 1, B = -2 * ys[j],
           C = ys[j] * ys[j] + (x - xs[j]) * (x - xs[j]) - 4 * r * r;
        ld D = B * B - 4 * A * C;
        if (D >= 0) {
          ld ty = (-B + sqrt(D)) / A / 2;
          y = max(y, ty);
        }
      }
    }
    cout << y << ' ';
    xs.push_back(x);
    ys.push_back(y);
  }
  return 0;
}
