#include <bits/stdc++.h>
using namespace std;
int n, m, r;
int a[1020];
struct ac {
  ac *pre;
  ac *next;
  int x;
  double y;
};
ac *head = NULL;
void insert(int x) {
  ac *p = head;
  ac *tail = head;
  double y = (double)r;
  while (p != NULL) {
    if (p->x - 2 * r <= x && x <= p->x + 2 * r) {
      double d = (double)r * r * 4.0 - (double)((p->x - x) * (p->x - x));
      d = sqrt(d) + p->y;
      if (d > y) {
        y = d;
      }
    }
    tail = p;
    p = p->next;
  }
  ac *q = new ac;
  q->next = tail->next;
  q->pre = p;
  q->x = x;
  q->y = y;
  tail->next = q;
  printf("%.10lf ", y);
}
void cleanWF() {
  ac *p = head;
  while (p != NULL) {
    ac *q = p->next;
    delete p;
    p = q;
  }
  head = new ac;
  head->next = NULL;
  head->pre = NULL;
  head->x = -1000000000;
  head->y = 1000000000;
}
void solve() {
  int i, j;
  cleanWF();
  for (i = 0; i < n; i++) {
    scanf(" %d", &a[i]);
    insert(a[i]);
  }
  printf("\n");
}
int main() {
  while (scanf("%d %d", &n, &r) != EOF) {
    solve();
  }
  return 0;
}
