#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define X real()
#define Y imag()
using namespace std;
typedef double D;
typedef complex<D> P;
typedef pair<P,P> L;
typedef vector<P> Pol;
struct C{P p;D r;};
D eps=1e-9;
bool eq(D a,D b){return abs(a-b)<eps;}
int large(D a,D b){return eq(a,b)?0:(a>b?1:-1);}
bool containCC(C a,C b){
	return abs(a.p-b.p)+b.r<a.r+eps;
}
D dot(P a,P b){return real(conj(a)*b);}
P perp(L l,P p){
	D t=dot(p-l.fs,l.fs-l.sc)/norm(l.fs-l.sc);
	return l.fs+t*(l.fs-l.sc);
}
D dLP(L l,P p){return abs(perp(l,p)-p);}
Pol intCC(C a,C b){
	int x=large(abs(a.p-b.p),a.r+b.r);
	Pol ret;
	if(x==1) return ret;
	if(x==0){
		ret.pb((a.r*b.p+b.r*a.p)/(a.r+b.r));
		return ret;
	}
	if(containCC(a,b)||containCC(b,a)) return ret;
	D d=abs(a.p-b.p);
	D theta=acos((a.r*a.r+d*d-b.r*b.r)/(2.0*a.r*d));
	ret.pb(a.p+(b.p-a.p)/d*polar(a.r,theta));
	ret.pb(a.p+(b.p-a.p)/d*polar(a.r,-theta));
	return ret;
}
Pol intCL(C c,L l){
	int x=large(dLP(l,c.p),c.r);
	Pol ret;
	if(x==1) return ret;
	if(x==0){
		ret.pb(perp(l,c.p));
		return ret;
	}
	D d=dLP(l,c.p);
	if(d<eps){
		ret.pb(c.p+(l.fs-l.sc)/abs(l.fs-l.sc)*c.r);
		ret.pb(c.p-(l.fs-l.sc)/abs(l.fs-l.sc)*c.r);
		return ret;
	}
	D theta=acos(d/c.r);
	P p=perp(l,c.p);
	ret.pb(c.p+(p-c.p)/d*polar(c.r,theta));
	ret.pb(c.p+(p-c.p)/d*polar(c.r,-theta));
	return ret;
}
P p[10];
int N;
D h[10],w;
D dis(D r,D h){
	if(r<=h) return r;
	return sqrt(2*r*h-h*h);
}
void append(Pol& pol,Pol a){
	for(P p:a) pol.pb(p);
}
bool can(D r){
	D e=dis(r,w);
	if(e>=50) return 0;
	vector<L> ls;
	vector<P> ps;
	ps.pb(P(e,e));
	ps.pb(P(e,100-e));
	ps.pb(P(100-e,100-e));
	ps.pb(P(100-e,e));
	rep(i,4) ls.pb(L(ps[i],ps[(i+1)%4]));
	vector<C> cs;
	rep(i,N) cs.pb(C{p[i],dis(r,h[i])});
	rep(i,N) rep(j,i) append(ps,intCC(cs[i],cs[j]));
	rep(i,N) rep(j,4) append(ps,intCL(cs[i],ls[j]));
	for(P p:ps){
		if(e-eps<p.X&&p.X<100-e+eps&&e-eps<p.Y&&p.Y<100-e+eps){
			bool ok=1;
			rep(i,N){
				if(abs(p-cs[i].p)+eps<cs[i].r) ok=0;
			}
			if(ok) return 1;
		}
	}
	return 0;
}
int main(){
	while(true){
		cin>>N>>w;
		if(N==0) break;
		rep(i,N){
			int x,y;
			cin>>x>>y>>h[i];
			p[i]=P(x,y);
		}
		D ub=1e5,lb=0;
		rep(tt,50){
			D r=(ub+lb)/2;
			if(can(r)) lb=r;
			else ub=r;
		}
		printf("%.12f\n",ub);
	}
}
### Prompt

Please create a solution in cpp to the following problem:

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 <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define X real()
#define Y imag()
using namespace std;
typedef double D;
typedef complex<D> P;
typedef pair<P,P> L;
typedef vector<P> Pol;
struct C{P p;D r;};
D eps=1e-9;
bool eq(D a,D b){return abs(a-b)<eps;}
int large(D a,D b){return eq(a,b)?0:(a>b?1:-1);}
bool containCC(C a,C b){
	return abs(a.p-b.p)+b.r<a.r+eps;
}
D dot(P a,P b){return real(conj(a)*b);}
P perp(L l,P p){
	D t=dot(p-l.fs,l.fs-l.sc)/norm(l.fs-l.sc);
	return l.fs+t*(l.fs-l.sc);
}
D dLP(L l,P p){return abs(perp(l,p)-p);}
Pol intCC(C a,C b){
	int x=large(abs(a.p-b.p),a.r+b.r);
	Pol ret;
	if(x==1) return ret;
	if(x==0){
		ret.pb((a.r*b.p+b.r*a.p)/(a.r+b.r));
		return ret;
	}
	if(containCC(a,b)||containCC(b,a)) return ret;
	D d=abs(a.p-b.p);
	D theta=acos((a.r*a.r+d*d-b.r*b.r)/(2.0*a.r*d));
	ret.pb(a.p+(b.p-a.p)/d*polar(a.r,theta));
	ret.pb(a.p+(b.p-a.p)/d*polar(a.r,-theta));
	return ret;
}
Pol intCL(C c,L l){
	int x=large(dLP(l,c.p),c.r);
	Pol ret;
	if(x==1) return ret;
	if(x==0){
		ret.pb(perp(l,c.p));
		return ret;
	}
	D d=dLP(l,c.p);
	if(d<eps){
		ret.pb(c.p+(l.fs-l.sc)/abs(l.fs-l.sc)*c.r);
		ret.pb(c.p-(l.fs-l.sc)/abs(l.fs-l.sc)*c.r);
		return ret;
	}
	D theta=acos(d/c.r);
	P p=perp(l,c.p);
	ret.pb(c.p+(p-c.p)/d*polar(c.r,theta));
	ret.pb(c.p+(p-c.p)/d*polar(c.r,-theta));
	return ret;
}
P p[10];
int N;
D h[10],w;
D dis(D r,D h){
	if(r<=h) return r;
	return sqrt(2*r*h-h*h);
}
void append(Pol& pol,Pol a){
	for(P p:a) pol.pb(p);
}
bool can(D r){
	D e=dis(r,w);
	if(e>=50) return 0;
	vector<L> ls;
	vector<P> ps;
	ps.pb(P(e,e));
	ps.pb(P(e,100-e));
	ps.pb(P(100-e,100-e));
	ps.pb(P(100-e,e));
	rep(i,4) ls.pb(L(ps[i],ps[(i+1)%4]));
	vector<C> cs;
	rep(i,N) cs.pb(C{p[i],dis(r,h[i])});
	rep(i,N) rep(j,i) append(ps,intCC(cs[i],cs[j]));
	rep(i,N) rep(j,4) append(ps,intCL(cs[i],ls[j]));
	for(P p:ps){
		if(e-eps<p.X&&p.X<100-e+eps&&e-eps<p.Y&&p.Y<100-e+eps){
			bool ok=1;
			rep(i,N){
				if(abs(p-cs[i].p)+eps<cs[i].r) ok=0;
			}
			if(ok) return 1;
		}
	}
	return 0;
}
int main(){
	while(true){
		cin>>N>>w;
		if(N==0) break;
		rep(i,N){
			int x,y;
			cin>>x>>y>>h[i];
			p[i]=P(x,y);
		}
		D ub=1e5,lb=0;
		rep(tt,50){
			D r=(ub+lb)/2;
			if(can(r)) lb=r;
			else ub=r;
		}
		printf("%.12f\n",ub);
	}
}
```