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 <iostream>
#include <cmath>
using namespace std;

#define rep(i,x) for(int i = 0 ; i < x ; i ++)
#define rep1(i,x) for(int i = 1 ; i <= x ; i ++)

typedef long double ld;
const ld PI = 3.141592653589793238462643383279;

struct po{
	ld x;
	ld y;
	po(ld a){ x = a; y = 0; }
	po(ld a,ld b){ x = a; y = b; }
	po(){}
	inline ld operator()(const po& rhs) const {
		return x*rhs.x+y*rhs.y;
	}
	inline ld norm() {
		return sqrt((*this)(*this));
	}
	inline po& operator+=(const po& rhs){
		x += rhs.x;
		y += rhs.y;
		return *this;
	}
	inline po& operator-=(const po& rhs){
		x -= rhs.x;
		y -= rhs.y;
		return *this;
	}
	inline po& operator*=(const po& rhs){
		ld x_ = x*rhs.x-y*rhs.y;
		y = x*rhs.y+y*rhs.x;
		x = x_;
		return *this;
	}
	inline po& operator/=(const po& rhs){
		ld x_ = x*rhs.x+y*rhs.y;
		y = -x*rhs.y+y*rhs.x;
		x = x_;
		ld nor = rhs(rhs);
		x /= nor;
		y /= nor;
		return *this;
	}
	inline void in(){
		scanf("%Lf%Lf",&x,&y);
	}
};
inline po operator+(const po& a, const po& b){ return po(a) += b; }
inline po operator-(const po& a, const po& b){ return po(a) -= b; }
inline po operator*(const po& a, const po& b){ return po(a) *= b; }
inline po operator/(const po& a, const po& b){ return po(a) /= b; }

inline po similar(const po& a,const po& b,const po& c,const po& p,const po& q){
	return p+(q-p)*(c-a)/(b-a);
}

typedef pair<po,po> se;
#define fr first
#define sc second

struct li{
	ld a;
	ld b;
	ld c;
	li(po p,po q){
		a = q.y-p.y;
		b = p.x-q.x;
		c = p.y*q.x-p.x*q.y;
	}
	/*explicit li(se s){
		a = s.sc.y-s.fr.y;
		b = s.fr.x-s.sc.x;
		c = s.fr.y*s.sc.x-s.fr.x*s.sc.y;
		li(s.fr,s.sc);
	}*/
	li(){}
	inline ld operator()(const po& p) const {
		return a*p.x+b*p.y+c;
	}
};

void intersect(const li &l,const li &m,po* &ret){
	if(abs(l.a*m.b-m.a*l.b) <= 1e-18){
		ret = nullptr;
		return;
	}
	ret = new po;
	ret->x = -(l.c*m.b-m.c*l.b)/(l.a*m.b-m.a*l.b);
	ret->y = -(l.a*m.c-m.a*l.c)/(l.a*m.b-m.a*l.b);
}
inline bool on(const po &p,const se &s){
	return (s.fr-p)(s.sc-p) <= 1e-9;
}
void intersect(const se &s,const se &t,po* &ret){
	li l = li(s.fr,s.sc);
	li m = li(t.fr,t.sc);
	po *p;
	intersect(l,m,p);
	if(p == nullptr || (on(*p,s)&&on(*p,t)))ret = p;
	else{
		delete p;
		ret = nullptr;
	}
}
inline ld dist(const po &p,const po &q){
	return sqrt((p-q)(p-q));
}
inline li perpen(const po &p,const li &l){
	li ret;
	ret.a = l.b;
	ret.b = -l.a;
	ret.c = l.a*p.y-l.b*p.x;
	return ret;
}
inline po perpen_leg(const po &p,const li &l){
	po ret;
	li m = perpen(p,l);
	ret.x = -(l.c*m.b-m.c*l.b)/(l.a*m.b-m.a*l.b);
	ret.y = -(l.a*m.c-m.a*l.c)/(l.a*m.b-m.a*l.b);
	return ret;
}
inline ld dist(const po &p,const se &s){
	po h = perpen_leg(p,li(s.fr,s.sc));
	if(on(h,s))return dist(p,h);
	else return min( dist(p,s.fr) , dist(p,s.sc) );
}
inline ld dist(const se &s,const se &t){
	po *p;
	intersect(s,t,p);
	if(p != nullptr){
		delete p;
		return 0.0;
	}
	ld ret = min( dist(s.fr,t) , dist(s.sc,t) );
	ret = min( ret , min( dist(t.fr,s) , dist(t.sc,s) ) );
	return ret;
}
inline ld dist(const po &p, const li &l){
	return abs(l(p))/sqrt(l.a*l.a+l.b*l.b);
}

struct ci{
	po c;
	ld r;
	inline bool internal(const po &p){
		return dist(p,c) <= r+1e-9;
	}
};

ci circum(const po &p,const po &q,const po &r){
	ci ret;
	li l = perpen((p+q)/2.0,li(p,q));
	li m = perpen((q+r)/2.0,li(q,r));
	po* _c;
	intersect(l,m,_c);
	if(_c == nullptr){
		ret.c = po(0.0,0.0);
		ret.r = -1.0;
		return ret;
	}
	else {
		ret.c = *_c;
		ret.r = dist(ret.c,p);
		delete _c;
		return ret;
	}
}


void intersect(const li &l, const ci &c, po* &ret1, po* &ret2){
	ld d = dist(c.c,l);
	if(d > c.r+1e-9){
		ret1 = nullptr;
		ret2 = nullptr;
		return;
	}
	po h = perpen_leg(c.c,l);
	if(abs(d-c.r) <= 1e-9){
		ret1 = new po;
		*ret1 = h;
		ret2 = nullptr;
		return;
	}
	po v = po(l.b,-l.a);
	v /= sqrt(v(v));
	v *= sqrt(c.r*c.r-d*d);
	ret1 = new po;
	*ret1 = h+v;
	ret2 = new po;
	*ret2 = h-v;
	return;
}
void intersect(const ci &c, const ci &d, po* &ret1, po* &ret2){
	li l;
	l.a = 2*(c.c.x-d.c.x);
	l.b = 2*(c.c.y-d.c.y);
	l.c = d.c(d.c)-d.r*d.r-(c.c(c.c)-c.r*c.r);
	intersect(l,c,ret1,ret2);
}
 
#include <vector>

ld S,T;
bool f(po p){
    return (p.x >= S-1e-8 && p.x <= T+1e-8 && p.y >= S-1e-8 && p.y <= T+1e-8);
}
 
int main(){
    int n,w;
    int x[12],y[12],h[12];
    while(1){
        scanf("%d%d",&n,&w);
        if(n == 0)break;
        rep(i,n){
            scanf("%d%d%d",&x[i],&y[i],&h[i]);
        }
        long double L = 0.0, R = 2000.0;
        while(R-L > 0.00001){
            ld M = (L+R)/2;
            ci c[12];
            for(int i = 0 ; i < n ; i ++){
                c[i].c = po(x[i],y[i]);
                if(M <= h[i])c[i].r = M;
                else c[i].r = sqrt(2*h[i]*M-h[i]*h[i]);
            }
            bool b = false;
            li l[4];
        	ld D;
        	if(M <= w)D = M;
            else D = sqrt(2*w*M-w*w);
        	if(D >= 50.0-1e-12){
        		R=M;
        		continue;
        	}
        	S=D; T=100.0-D;
            l[0] = li(po(S,S),po(T,S));
            l[1] = li(po(T,S),po(T,T));
            l[2] = li(po(T,T),po(S,T));
            l[3] = li(po(S,T),po(S,S));
            for(int i = 0 ; !b && i < n ; i ++){
                po p = c[i].c+c[i].r;
                bool _b = !f(p);
                for(int j = 0 ; !_b && j < n ; j ++){
                    if(i == j)continue;
                    _b |= c[j].internal(p);
                }
                if(!_b)b = true;
            }
            for(int i = 0 ; !b && i < n ; i ++){
                for(int j = 0 ; !b && j < n ; j ++){
                    if(i == j)continue;
                    po* _p[2];
                    intersect(c[i],c[j],_p[0],_p[1]);
                    for(int t = 0 ; t < 2 ; t ++){
                        if(_p[t] == nullptr)continue;
                        po p = *_p[t]; delete _p[t];
                        bool _b = !f(p);
                        for(int k = 0 ; k < n ; k ++){
                            if(k == i || k == j)continue;
                            _b |= c[k].internal(p);
                        }
                        if(!_b)b = true;
                    }
                }
            }
            for(int i = 0 ; !b && i < n ; i ++){
                for(int j = 0 ; j < 4 ; j ++){
                    po* _p[2];
                    intersect(l[j],c[i],_p[0],_p[1]);
                    for(int t = 0 ; t < 2 ; t ++){
                        if(_p[t] == nullptr)continue;
                        po p = *_p[t]; delete _p[t];
                        bool _b = !f(p);
                        for(int k = 0 ; k < n ; k ++){
                            if(k == i)continue;
                            _b |= c[k].internal(p);
                        }
                        if(!_b)b = true;
                    }
                }
            }
        	bool _b = false;
        	for(int k = 0 ; k < n ; k ++){
        		_b |= c[k].internal(po(50,50));
        	}
        	if(!_b)b = true;
            if(b)L=M;
            else R=M;
        }
        printf("%.6f%c",(double)L,10);
    }
}