#include <bits/stdc++.h>
using namespace std;
inline bool is_palindrome(const string& s) {
  return std::equal(s.begin(), s.end(), s.rbegin());
}
const long long MOD = 1000000007;
const long long INF = 1e9 + 5;
const double eps = 1e-7;
const double PI = acos(-1.0);
int x[1005], n, r;
double y[1005], constant;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  memset(y, 0.0, sizeof(y));
  cin >> n >> r;
  constant = 4.0 * r * r;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    cin >> x[i];
    double maxm = r;
    for (long long j = (long long)(0); j < (long long)(i); j++) {
      double dx = (x[i] - x[j]) * (x[i] - x[j]);
      if (dx <= constant) {
        maxm = fmax(maxm, y[j] + sqrt(constant - dx));
      }
    }
    y[i] = maxm;
  }
  cout << fixed << showpoint;
  cout << setprecision(10);
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    cout << y[i] << " ";
  }
  return 0;
}
