#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
int n, r;
int x[maxn];
double y[maxn];
int main() {
  while (cin >> n >> r) {
    for (int i = 1; i <= n; i++) {
      cin >> x[i];
    }
    y[1] = r;
    for (int i = 2; i <= n; i++) {
      y[i] = 1.0 * r;
      for (int j = 1; j < i; j++) {
        if (fabs(x[j] - x[i]) > 2 * r)
          continue;
        else {
          int g = (2 * r) * (2 * r) - fabs(x[j] - x[i]) * fabs(x[j] - x[i]);
          double tmp = sqrt(g);
          tmp += y[j];
          y[i] = max(tmp, y[i]);
        }
      }
    }
    for (int i = 1; i <= n; i++) {
      if (i == 1)
        printf("%.8f", y[i]);
      else
        printf(" %.8f", y[i]);
    }
    printf("\n");
  }
  return 0;
}
