#include<iostream>
#include<complex>
#include<vector>

using namespace std;

typedef complex<double> P;

int x[10],y[10],h[10];
double mg;
int n,w;
double m;

bool inside(double d){
  return mg<=d&&d<=100-mg;
}

vector<P> intersection(P a,double ra,P b,double rb){
  double c=abs(b-a);
  double costheta=-(rb*rb-ra*ra-c*c)/2/ra/c;
  if(-1<=costheta&&costheta<=1){
    double theta=acos(costheta);
    double ang=arg(b-a);
    return {a+polar(ra,ang+theta),a+polar(ra,ang-theta)};
  }else{
    return {};
  }
}

bool check(double px,double py,int u=0){
  for(int i=0;i<n;i++){
    if(u>>i&1)continue;
    if(hypot(px-x[i],py-y[i])<=((h[i]>m)?m:sqrt(m*m-(m-h[i])*(m-h[i]))))return false;
  }
  return true;
}


int main(){
  for(;cin>>n>>w,n|w;){
    for(int i=0;i<n;i++){
      cin>>x[i]>>y[i]>>h[i];
    }
    double lo=0,hi=(w>50)?50:(2500.+w*w)/2/w;
    for(int i=0;i<100;i++){
      m=(lo+hi)/2;
      mg=(m<w)?m:sqrt(m*m-(m-w)*(m-w));
      bool f=false;
      f|=check(mg,mg);
      f|=check(mg,100-mg);
      f|=check(100-mg,mg);
      f|=check(100-mg,100-mg);
      double rs[10];
      for(int i=0;i<n;i++){
	double r=(m<h[i])?m:sqrt(m*m-(m-h[i])*(m-h[i]));
	rs[i]=r;
	double sql=r*r-(x[i]-mg)*(x[i]-mg);
	if(sql>=0){
	  double ly=y[i]-sqrt(sql),hy=y[i]+sqrt(sql);
	  f|=inside(ly)&&check(mg,ly,1<<i);
	  f|=inside(hy)&&check(mg,hy,1<<i);
	}
	double sqb=r*r-(y[i]-mg)*(y[i]-mg);
	if(sqb>=0){
	  double lx=x[i]-sqrt(sqb),hx=x[i]+sqrt(sqb);
	  f|=inside(lx)&&check(lx,mg,1<<i);
	  f|=inside(hx)&&check(hx,mg,1<<i);
	}
	double sqr=r*r-(100-mg-x[i])*(100-mg-x[i]);
	if(sqr>=0){
	  double ly=y[i]-sqrt(sqr),hy=y[i]+sqrt(sqr);
	  f|=inside(ly)&&check(100-mg,ly,1<<i);
	  f|=inside(hy)&&check(100-mg,hy,1<<i);
	}
	double sqt=r*r-(100-mg-y[i])*(100-mg-y[i]);
	if(sqt>=0){
	  double lx=x[i]-sqrt(sqt),hx=x[i]+sqrt(sqt);
	  f|=inside(lx)&&check(lx,100-mg,1<<i);
	  f|=inside(hx)&&check(hx,100-mg,1<<i);
	}
	for(int j=0;j<i;j++){
	  for(auto e:intersection(P(x[i],y[i]),r,P(x[j],y[j]),rs[j])){
	    if(mg<=e.real()&&e.real()<=100-mg&&mg<=e.imag()&&e.imag()<=100-mg){
	      f|=check(e.real(),e.imag(),1<<i|1<<j);
	    }
	  }
	}
      }
      if(f){
	lo=m;
      }else{
	hi=m;
      }
    }
    cout<<fixed<<lo<<endl;
  }
}
	  
### Prompt

Construct a cpp code solution to the problem outlined:

An open-top box having a square bottom is placed on the floor. You see a number of needles vertically planted on its bottom.

You want to place a largest possible spheric balloon touching the box bottom, interfering with none of the side walls nor the needles.

Java Specific: Submitted Java programs may not use "java.awt.geom.Area". You may use it for your debugging purposes.

Figure H.1 shows an example of a box with needles and the corresponding largest spheric balloon. It corresponds to the first dataset of the sample input below.

<image>
Figure H.1. The upper shows an example layout and the lower shows the largest spheric balloon that can be placed.



Input

The input is a sequence of datasets. Each dataset is formatted as follows.


n w
x1 y1 h1
:
xn yn hn


The first line of a dataset contains two positive integers, n and w, separated by a space. n represents the number of needles, and w represents the height of the side walls.

The bottom of the box is a 100 × 100 square. The corners of the bottom face are placed at positions (0, 0, 0), (0, 100, 0), (100, 100, 0), and (100, 0, 0).

Each of the n lines following the first line contains three integers, xi, yi, and hi. (xi, yi, 0) and hi represent the base position and the height of the i-th needle. No two needles stand at the same position.

You can assume that 1 ≤ n ≤ 10, 10 ≤ w ≤ 200, 0 < xi < 100, 0 < yi < 100 and 1 ≤ hi ≤ 200. You can ignore the thicknesses of the needles and the walls.

The end of the input is indicated by a line of two zeros. The number of datasets does not exceed 1000.

Output

For each dataset, output a single line containing the maximum radius of a balloon that can touch the bottom of the box without interfering with the side walls or the needles. The output should not contain an error greater than 0.0001.

Example

Input

5 16
70 66 40
38 52 20
40 35 10
70 30 10
20 60 10
1 100
54 75 200
1 10
90 10 1
1 11
54 75 200
3 10
53 60 1
61 38 1
45 48 1
4 10
20 20 10
20 80 10
80 20 10
80 80 10
0 0


Output

26.00000
39.00000
130.00000
49.49777
85.00000
95.00000

### Response

```cpp
#include<iostream>
#include<complex>
#include<vector>

using namespace std;

typedef complex<double> P;

int x[10],y[10],h[10];
double mg;
int n,w;
double m;

bool inside(double d){
  return mg<=d&&d<=100-mg;
}

vector<P> intersection(P a,double ra,P b,double rb){
  double c=abs(b-a);
  double costheta=-(rb*rb-ra*ra-c*c)/2/ra/c;
  if(-1<=costheta&&costheta<=1){
    double theta=acos(costheta);
    double ang=arg(b-a);
    return {a+polar(ra,ang+theta),a+polar(ra,ang-theta)};
  }else{
    return {};
  }
}

bool check(double px,double py,int u=0){
  for(int i=0;i<n;i++){
    if(u>>i&1)continue;
    if(hypot(px-x[i],py-y[i])<=((h[i]>m)?m:sqrt(m*m-(m-h[i])*(m-h[i]))))return false;
  }
  return true;
}


int main(){
  for(;cin>>n>>w,n|w;){
    for(int i=0;i<n;i++){
      cin>>x[i]>>y[i]>>h[i];
    }
    double lo=0,hi=(w>50)?50:(2500.+w*w)/2/w;
    for(int i=0;i<100;i++){
      m=(lo+hi)/2;
      mg=(m<w)?m:sqrt(m*m-(m-w)*(m-w));
      bool f=false;
      f|=check(mg,mg);
      f|=check(mg,100-mg);
      f|=check(100-mg,mg);
      f|=check(100-mg,100-mg);
      double rs[10];
      for(int i=0;i<n;i++){
	double r=(m<h[i])?m:sqrt(m*m-(m-h[i])*(m-h[i]));
	rs[i]=r;
	double sql=r*r-(x[i]-mg)*(x[i]-mg);
	if(sql>=0){
	  double ly=y[i]-sqrt(sql),hy=y[i]+sqrt(sql);
	  f|=inside(ly)&&check(mg,ly,1<<i);
	  f|=inside(hy)&&check(mg,hy,1<<i);
	}
	double sqb=r*r-(y[i]-mg)*(y[i]-mg);
	if(sqb>=0){
	  double lx=x[i]-sqrt(sqb),hx=x[i]+sqrt(sqb);
	  f|=inside(lx)&&check(lx,mg,1<<i);
	  f|=inside(hx)&&check(hx,mg,1<<i);
	}
	double sqr=r*r-(100-mg-x[i])*(100-mg-x[i]);
	if(sqr>=0){
	  double ly=y[i]-sqrt(sqr),hy=y[i]+sqrt(sqr);
	  f|=inside(ly)&&check(100-mg,ly,1<<i);
	  f|=inside(hy)&&check(100-mg,hy,1<<i);
	}
	double sqt=r*r-(100-mg-y[i])*(100-mg-y[i]);
	if(sqt>=0){
	  double lx=x[i]-sqrt(sqt),hx=x[i]+sqrt(sqt);
	  f|=inside(lx)&&check(lx,100-mg,1<<i);
	  f|=inside(hx)&&check(hx,100-mg,1<<i);
	}
	for(int j=0;j<i;j++){
	  for(auto e:intersection(P(x[i],y[i]),r,P(x[j],y[j]),rs[j])){
	    if(mg<=e.real()&&e.real()<=100-mg&&mg<=e.imag()&&e.imag()<=100-mg){
	      f|=check(e.real(),e.imag(),1<<i|1<<j);
	    }
	  }
	}
      }
      if(f){
	lo=m;
      }else{
	hi=m;
      }
    }
    cout<<fixed<<lo<<endl;
  }
}
	  
```