#include <bits/stdc++.h>
using namespace std;
vector<int> poi;
vector<double> ans;
int cnt[1005];
vector<double> flag[1005];
int main() {
  int n;
  int r;
  cin >> n >> r;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    poi.push_back(x);
    cnt[x]++;
  }
  for (int i = 0; i < n; i++) {
    double maxx = (double)r;
    for (int j = max(1, poi[i] - 2 * r); j <= min(1000, poi[i] + 2 * r); j++) {
      if (flag[j].size() == 0)
        continue;
      else {
        double anss = sqrt(4 * r * r - abs(poi[i] - j) * abs(poi[i] - j)) +
                      flag[j].back();
        maxx = max(maxx, anss);
      }
    }
    flag[poi[i]].push_back(maxx);
    ans.push_back(maxx);
  }
  for (int i = 0; i < ans.size(); i++) {
    printf("%.10f%c", ans[i], i == n - 1 ? '\n' : ' ');
  }
  return 0;
}
