#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  int n, r;
  cin >> n >> r;
  vector<long double> x(5000, -r);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    long double m = 0;
    for (int j = max(a - 2 * r, 0); j <= a + 2 * r; j++) {
      m = max(m, sqrt(4 * r * r - a * a + 2 * a * j - j * j) + x[j]);
    }
    x[a] = m;
    cout << m << " ";
  }
}
