#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int N = 1e6 + 5;
int n;
double r;
double a[N];
double dx[N];
double dy[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> r;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    for (int j = 1; j < i; j++) {
      if (abs(a[i] - a[j]) > 2 * r) continue;
      double yy = (r * 2) * (r * 2) - (a[i] - a[j]) * (a[i] - a[j]);
      yy = sqrt(yy);
      dy[i] = max(dy[i], yy + dy[j]);
    }
    if (dy[i] == 0) dy[i] = r;
  }
  for (int i = 1; i <= n; i++) {
    cout << fixed << setprecision(9) << dy[i] << " ";
  }
  return 0;
}
