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

Solution (in CPP):

Solution:
#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI = acos(-1);
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
inline bool ABS(double a){return max(a,-a);}
struct Pt {
	double x, y;
	Pt() {}
	Pt(double x, double y) : x(x), y(y) {}
	Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); }
	Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); }
	Pt operator*(const Pt &a) const { return Pt(x * a.x - y * a.y, x * a.y + y * a.x); }
	Pt operator-() const { return Pt(-x, -y); }
	Pt operator*(const double &k) const { return Pt(x * k, y * k); }
	Pt operator/(const double &k) const { return Pt(x / k, y / k); }
	double ABS() const { return sqrt(x * x + y * y); }
	double ABS2() const { return x * x + y * y; }
	double arg() const { return atan2(y, x); }
	double dot(const Pt &a) const { return x * a.x + y * a.y; }
	double det(const Pt &a) const { return x * a.y - y * a.x; }
};
double tri(const Pt &a, const Pt &b, const Pt &c) { return (b - a).det(c - a); }
double dSP(Pt a, Pt b, Pt c) {
	if (sig((b - a).dot(c - a)) <= 0) return (c - a).ABS();
	if (sig((a - b).dot(c - b)) <= 0) return (c - b).ABS();
	return ABS(tri(a, b, c)) / (b - a).ABS();
}
int iCC(Pt a, double r, Pt b, double s) {
	double d = (b - a).ABS();
	if (sig(d) == 0 && sig(r - s) == 0) return -1; // correspond
	if (sig(r - s - d) > 0) return +2; // r > s
	if (sig(s - r - d) > 0) return -2; // s > r
	return (sig(r + s - d) >= 0) ? 1 : 0;
}
bool iCS(Pt a, double r, Pt b, Pt c) {
	return (sig(r - dSP(b, c, a)) >= 0 && sig(r - max((b - a).ABS(), (c - a).ABS())) <= 0);
}
pair<Pt,Pt> pCC(Pt a, double r, Pt b, double s) {
	double d = (b - a).ABS();
	double x = (d * d + r * r - s * s) / (d * 2);
	Pt e = (b - a) / d, w = e * Pt(0, 1) * sqrt(max(r * r - x * x, 0.0));
	return make_pair(a + e * x - w, a + e * x + w);
}
pair<Pt,Pt> pCL(Pt a, double r, Pt b, Pt c) {
	Pt h = b + (c - b) * (c - b).dot(a - b) / (c - b).ABS2(); // perp(b, c, a)
	double d = (h - a).ABS();
	double y = sqrt(max(r * r - d * d, 0.0));
	Pt e = (c - b) / (c - b).ABS();
	return make_pair(h - e * y, h + e * y);
}
int x[11];
int y[11];
int z[11];
Pt p[11];
double r[11];
int main(){
	int a,b;
	while(scanf("%d%d",&a,&b),a){
		for(int i=0;i<a;i++)scanf("%d%d%d",x+i,y+i,z+i);
		for(int i=0;i<a;i++)p[i]=Pt(x[i],y[i]);
		double L=0;
		double R=200;
		for(int i=0;i<50;i++){
			double M=(L+R)/2;
			vector<Pt> v;
			for(int j=0;j<a;j++){
				if((double)z[j]>M)r[j]=M;
				else r[j]=sqrt(M*z[j]*2-z[j]*z[j]);
			}
			double dis;
			if((double)b>M)dis=M;
			else dis=sqrt(M*b*2-b*b);
			if(dis>=50){
				R=M;continue;
			}
			for(int j=0;j<a;j++){
				for(int k=j+1;k<a;k++){
					if(iCC(p[j],r[j],p[k],r[k])==1){
						pair<Pt,Pt> tmp=pCC(p[j],r[j],p[k],r[k]);
						v.push_back(tmp.first);
						v.push_back(tmp.second);
					}
				}
				if(iCS(p[j],r[j],Pt(dis,dis),Pt(dis,-dis+100))){
					pair<Pt,Pt>tmp=pCL(p[j],r[j],Pt(dis,dis),Pt(dis,-dis+100));
					v.push_back(tmp.first);v.push_back(tmp.second);
				}
				if(iCS(p[j],r[j],Pt(-dis+100,dis),Pt(-dis+100,-dis+100))){
					pair<Pt,Pt>tmp=pCL(p[j],r[j],Pt(-dis+100,dis),Pt(-dis+100,-dis+100));
					v.push_back(tmp.first);v.push_back(tmp.second);
				}
				if(iCS(p[j],r[j],Pt(dis,dis),Pt(-dis+100,-dis))){
					pair<Pt,Pt>tmp=pCL(p[j],r[j],Pt(dis,dis),Pt(-dis+100,dis));
					v.push_back(tmp.first);v.push_back(tmp.second);
				}
				if(iCS(p[j],r[j],Pt(dis,-dis+100),Pt(-dis+100,-dis+100))){
					pair<Pt,Pt>tmp=pCL(p[j],r[j],Pt(dis,-dis+100),Pt(-dis+100,-dis+100));
					v.push_back(tmp.first);v.push_back(tmp.second);
				}
			}
			v.push_back(Pt(dis,dis));
			v.push_back(Pt(dis,-dis+100));
			v.push_back(Pt(-dis+100,dis));
			v.push_back(Pt(-dis+100,-dis+100));
			
			bool ok=false;
			for(int i=0;i<v.size();i++){
				if(v[i].x<dis-EPS||v[i].x>-dis+100+EPS||v[i].y<dis-EPS||v[i].y>-dis+100+EPS)continue;
				bool OK=true;
				for(int j=0;j<a;j++)if(r[j]*r[j]-EPS>(v[i].x-x[j])*(v[i].x-x[j])+(v[i].y-y[j])*(v[i].y-y[j]))OK=false;
				if(OK){ok=true;break;}
			}
			if(ok)L=M;else R=M;
		}
		printf("%.12f\n",L);
	}
}