#include<bits/stdc++.h>
using namespace std;
#define int long long
#define db double
#define inf 0x3f3f3f3f
const db pi = acos(-1.0);
const int N = 1e4+10;
const int mod = 1e9+7;
const db eps = 1e-9;
int n,r;
db pp(int a,int b,db c,int e){
db xx=(e*e-(a-b)*(a-b));
return sqrt(xx)+c;
}
db y[N];
int x[N];
void solve(){
cin>>n>>r;
for(int i=1;i<=n;i++)cin>>x[i];
y[1]=r*1.0;
for(int i=2;i<=n;i++){
int jj=i; y[i]=0.0;
for(int j=i-1;j>0;j--){
if(abs(x[i]-x[j])<=r*2){
if(abs(x[i]-x[j])==r*2){
y[i]=max(y[i],y[j]);
}else y[i]=max(y[i],pp(x[i],x[j],y[j],r*2));jj=j;
}
}
if(jj==i){
y[i]=r;
}
}
cout<<r<<" ";
for(int i=2;i<=n;i++)printf("%.10lf ",y[i]);
}
signed main(){
int __=1;
//cin>>__;
while(__--){
solve();
}
}
1367A - Short Substrings | 87A - Trains |
664A - Complicated GCD | 1635D - Infinite Set |
1462A - Favorite Sequence | 1445B - Elimination |
1656C - Make Equal With Mod | 567A - Lineland Mail |
1553A - Digits Sum | 1359B - New Theatre Square |
766A - Mahmoud and Longest Uncommon Subsequence | 701B - Cells Not Under Attack |
702A - Maximum Increase | 1656D - K-good |
1426A - Floor Number | 876A - Trip For Meal |
1326B - Maximums | 1635C - Differential Sorting |
961A - Tetris | 1635B - Avoid Local Maximums |
20A - BerOS file system | 1637A - Sorting Parts |
509A - Maximum in Table | 1647C - Madoka and Childish Pranks |
689B - Mike and Shortcuts | 379B - New Year Present |
1498A - GCD Sum | 1277C - As Simple as One and Two |
1301A - Three Strings | 460A - Vasya and Socks |