#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int x[maxn];
double y[maxn];
int main() {
  int n;
  int r;
  scanf("%d%d", &n, &r);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
    y[i] = r;
    if (i > 1) {
      for (int j = 1; j < i; j++) {
        int dt = x[i] - x[j];
        if (dt < 0) dt = -dt;
        if (dt <= r * 2) {
          y[i] = max(y[i], y[j] + sqrt(r * r * 4 - dt * dt));
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) printf("%.10f ", y[i]);
  return 0;
}
