#include <bits/stdc++.h>
#pragma warning(disable : 4786)
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const double eps = 1e-8;
const double PI = acos(-1.0);
const int MAXN = 200005;
const int mod = 1000000007;
const long long llinf = (long long)(1e18) + 500;
const int inf = 0x3f3f3f3f;
int x[1005];
double y[1005];
int main() {
  int i, j, k, m;
  int n, r;
  scanf("%d%d", &n, &r);
  for (i = 1; i <= n; i++) {
    scanf("%d", x + i);
    y[i] = r * 1.0;
  }
  for (i = 2; i <= n; i++) {
    for (j = i - 1; j >= 1; j--) {
      int dx = abs(x[i] - x[j]);
      if (dx > 2 * r) continue;
      y[i] = max(y[i], y[j] + sqrt(4 * r * r * 1.0 - dx * 1.0 * dx));
    }
  }
  for (i = 1; i <= n; i++) {
    printf("%.10lf%c", y[i], i == n ? '\n' : ' ');
  }
  return 0;
}
