#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
double mini=1e-10;

struct Sec{
    P p,q;
    Sec(P p,P q):p(p),q(q){}
};

struct Com{
    P p;
    double r;
    Com(P p,double r):p(p),r(r){}
    Com(double x,double y,double r):p(P(x,y)),r(r){}
};

vector<P> crc(Com a,Com b){
    vector<P> res;
    P gra=b.p-a.p;
    double dist=abs(gra);
    if(dist>a.r+b.r+mini)return res;
    if(dist<abs(a.r-b.r)-mini)return res;
    double ca = (a.r*a.r+dist*dist-b.r*b.r) / (2.0*a.r*dist);
    double sa = sqrt(max(0.0,1.0-ca*ca));
    P fs=a.p+gra/dist*a.r*P(ca,sa);
    P sc=a.p+gra/dist*a.r*P(ca,-sa);
    res.push_back(fs);
    res.push_back(sc);
    return res;
}

vector<P> crs(Com a,Sec b){
    vector<P> res;
    P gra=b.q-b.p;
    P v=a.p-b.p;
    P edf=b.p+gra*real(v/gra);
    double h=abs(a.p-edf);
    if(a.r+mini<h)return res;

    double w=sqrt(max(0.0,a.r*a.r-h*h));
    double L=abs(b.p-edf)-w;
    double R=abs(b.p-edf)+w;

    if( -mini<L && L<abs(gra)+mini )
        res.push_back(b.p+gra/abs(gra)*L);
    if( -mini<R && R<abs(gra)+mini )
        res.push_back(b.p+gra/abs(gra)*R);
    return res;
}

int n,w;
int px[10],py[10],h[10];
vector<Com> vec;

double calc(double r,double t){
    if(r<t)return r;
    return sqrt(max(0.0, r*r - (r-t)*(r-t) ));
}
bool check(P p,double r){
    double a=calc(r,w)-mini;
    double b=100-calc(r,w)+mini;
    if(p.real()<a||p.real()>b||p.imag()<a||p.imag()>b)return false;

    for(int i=0;i<n;i++)
    if( abs(p-vec[i].p) < vec[i].r-mini )return false;

    return true;
}
bool check(vector<P> v,double r){
    for(int i=0;i<(int)v.size();i++)  if( check(v[i],r) )return true;
    return false;
}

bool check(double r){

    vec.clear();
    for(int i=0;i<n;i++) vec.push_back( Com( px[i], py[i], calc(r,h[i])));
  
    double a=calc(r,w);
    double b=100-calc(r,w);

    P pa=P(a,a),pb=P(b,a),pc=P(b,b),pd=P(a,b);
    if(check(pa,r)||check(pb,r)||check(pc,r)||check(pd,r))return true;

    for(int i=0;i<n;i++){
        vector<P> tm1=crs(vec[i],Sec(pa,pb));
        vector<P> tm2=crs(vec[i],Sec(pb,pc));
        vector<P> tm3=crs(vec[i],Sec(pc,pd));
        vector<P> tm4=crs(vec[i],Sec(pd,pa));
        if(check(tm1,r)||check(tm2,r)||check(tm3,r)||check(tm4,r))return true;
        for(int j=0;j<i;j++){
            vector<P> tm0=crc(vec[i],vec[j]);
            if(check(tm0,r))return true;
        }
    }
    return false;
}

int main(){
    while(1){
        cin>>n>>w;
        if(n==0&&w==0)break;
        for(int i=0;i<n;i++)cin>>px[i]>>py[i]>>h[i];
        double l=0,r=100000,m;
        for(int i=0;i<100;i++){
            m=(l+r)/2.0;
            if(check(m))l=m;
            else r=m;
        }
        cout<<setprecision(8)<<m<<endl;
    }
    return 0;
}

### Prompt

Please formulate a cpp solution 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>
using namespace std;
typedef complex<double> P;
double mini=1e-10;

struct Sec{
    P p,q;
    Sec(P p,P q):p(p),q(q){}
};

struct Com{
    P p;
    double r;
    Com(P p,double r):p(p),r(r){}
    Com(double x,double y,double r):p(P(x,y)),r(r){}
};

vector<P> crc(Com a,Com b){
    vector<P> res;
    P gra=b.p-a.p;
    double dist=abs(gra);
    if(dist>a.r+b.r+mini)return res;
    if(dist<abs(a.r-b.r)-mini)return res;
    double ca = (a.r*a.r+dist*dist-b.r*b.r) / (2.0*a.r*dist);
    double sa = sqrt(max(0.0,1.0-ca*ca));
    P fs=a.p+gra/dist*a.r*P(ca,sa);
    P sc=a.p+gra/dist*a.r*P(ca,-sa);
    res.push_back(fs);
    res.push_back(sc);
    return res;
}

vector<P> crs(Com a,Sec b){
    vector<P> res;
    P gra=b.q-b.p;
    P v=a.p-b.p;
    P edf=b.p+gra*real(v/gra);
    double h=abs(a.p-edf);
    if(a.r+mini<h)return res;

    double w=sqrt(max(0.0,a.r*a.r-h*h));
    double L=abs(b.p-edf)-w;
    double R=abs(b.p-edf)+w;

    if( -mini<L && L<abs(gra)+mini )
        res.push_back(b.p+gra/abs(gra)*L);
    if( -mini<R && R<abs(gra)+mini )
        res.push_back(b.p+gra/abs(gra)*R);
    return res;
}

int n,w;
int px[10],py[10],h[10];
vector<Com> vec;

double calc(double r,double t){
    if(r<t)return r;
    return sqrt(max(0.0, r*r - (r-t)*(r-t) ));
}
bool check(P p,double r){
    double a=calc(r,w)-mini;
    double b=100-calc(r,w)+mini;
    if(p.real()<a||p.real()>b||p.imag()<a||p.imag()>b)return false;

    for(int i=0;i<n;i++)
    if( abs(p-vec[i].p) < vec[i].r-mini )return false;

    return true;
}
bool check(vector<P> v,double r){
    for(int i=0;i<(int)v.size();i++)  if( check(v[i],r) )return true;
    return false;
}

bool check(double r){

    vec.clear();
    for(int i=0;i<n;i++) vec.push_back( Com( px[i], py[i], calc(r,h[i])));
  
    double a=calc(r,w);
    double b=100-calc(r,w);

    P pa=P(a,a),pb=P(b,a),pc=P(b,b),pd=P(a,b);
    if(check(pa,r)||check(pb,r)||check(pc,r)||check(pd,r))return true;

    for(int i=0;i<n;i++){
        vector<P> tm1=crs(vec[i],Sec(pa,pb));
        vector<P> tm2=crs(vec[i],Sec(pb,pc));
        vector<P> tm3=crs(vec[i],Sec(pc,pd));
        vector<P> tm4=crs(vec[i],Sec(pd,pa));
        if(check(tm1,r)||check(tm2,r)||check(tm3,r)||check(tm4,r))return true;
        for(int j=0;j<i;j++){
            vector<P> tm0=crc(vec[i],vec[j]);
            if(check(tm0,r))return true;
        }
    }
    return false;
}

int main(){
    while(1){
        cin>>n>>w;
        if(n==0&&w==0)break;
        for(int i=0;i<n;i++)cin>>px[i]>>py[i]>>h[i];
        double l=0,r=100000,m;
        for(int i=0;i<100;i++){
            m=(l+r)/2.0;
            if(check(m))l=m;
            else r=m;
        }
        cout<<setprecision(8)<<m<<endl;
    }
    return 0;
}

```