#include <bits/stdc++.h>
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
inline bool isPrime(long long int n) {
  if (n <= 1) {
    return false;
  }
  if (n <= 3) {
    return true;
  }
  if (n % 2 == 0 || n % 3 == 0) {
    return false;
  }
  for (int i = 5; i * i <= n; i = i + 6) {
    if (n % i == 0 || n % (i + 2) == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long int n, r;
  cin >> n >> r;
  long long int t[n];
  for (long long int i = 0; i < n; i++) {
    cin >> t[i];
  }
  long double ans[n];
  ans[0] = r;
  for (long long int i = 1; i < n; i++) {
    long double x = 0;
    for (long long int j = 0; j < i; j++) {
      if (abs(t[i] - t[j]) <= 2 * r) {
        long double y = sqrt(4 * r * r - (t[i] - t[j]) * (t[i] - t[j]));
        x = max(x, ans[j] + y);
      }
    }
    ans[i] = max(x, (long double)r);
  }
  for (long long int i = 0; i < n; i++) {
    cout << setprecision(20) << fixed << ans[i] << " ";
  }
  cout << '\n';
  return 0;
}
