#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int inf = 0x3f3f3f3f;
const long long int INF = 1e18;
const int mod = 1e9 + 7;
const int maxn = 1e3 + 5;
int cas = 1;
int a[maxn];
double ans[maxn];
void solve() {
  int n;
  double r;
  cin >> n >> r;
  r *= 2;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    double res = r / 2;
    for (int j = i - 1; j >= 1; j--) {
      if (abs(a[i] - a[j]) <= r) {
        double tmp = sqrt(r * r - 1.0 * abs(a[i] - a[j]) * abs(a[i] - a[j]));
        res = max(res, tmp + ans[j]);
      }
    }
    ans[i] = res;
  }
  for (int i = 1; i <= n; i++) {
    printf("%.10f%c", ans[i], i == n ? '\n' : ' ');
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
