#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int n, r, x[maxn];
double y[maxn];
int read() {
  int num = 0, flag = 1;
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') flag = -1;
  for (; c >= '0' && c <= '9'; c = getchar())
    num = (num << 3) + (num << 1) + c - 48;
  return num * flag;
}
void init() {
  n = read();
  r = read();
  for (int i = 1; i <= n; ++i) x[i] = read();
  return;
}
double dis(int a, int b) {
  int d = abs(x[a] - x[b]);
  if (d > r * 2) return r;
  if (d == r * 2) return y[a];
  double t = 4 * r * r - d * d;
  return y[a] + sqrt(t);
}
void work() {
  for (int i = 1; i <= n; ++i) {
    double mx = r;
    for (int j = 1; j < i; ++j)
      if (dis(j, i) > mx) mx = dis(j, i);
    y[i] = mx;
  }
}
int main() {
  init();
  work();
  for (int i = 1; i < n; ++i) printf("%.10lf ", y[i]);
  printf("%.10lf", y[n]);
  return 0;
}
