#include <bits/stdc++.h>
using namespace std;
int n, r;
double m, b;
bool add;
int x[1001];
double v[1001];
int main() {
  cout << fixed;
  cout.precision(6);
  cin >> n >> r;
  cin >> x[0];
  v[0] = r;
  for (int i = 1; i < n; i++) {
    cin >> x[i];
    m = 0;
    for (int j = 0; j < i; j++) {
      int dist = fabs(x[i] - x[j]);
      if (dist == 0) m = v[j] + (r * 2);
      if (dist <= 2 * r) {
        b = sqrt(4 * r * r - dist * dist);
        if (b + v[j] > m) m = b + v[j];
      }
    }
    if (m == 0)
      v[i] = r;
    else
      v[i] = m;
  }
  for (int i = 0; i < n; i++) cout << v[i] << " ";
}
