stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

 

using namespace std;

 

double EPS = 1e-10;

 

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

 

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

 

double dist(point a,point b){

	return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}

 

int main(void){

	int n,x,y,v;

	vector<point>P;

	vector<double>V;

	

	while(cin >> n,n){

		P.clear();

		V.clear();

		

		for(int i=0;i<n;i++){

			cin >> x >> y >> v;

			P.push_back(point(x,y));

			V.push_back(v);

		}

		

		

		double r=0.999;

		point now(0,0);

		

		for(double d=10;d>EPS;d*=r){

			int mx=0;

			double mxd=0;

			

			for(int j=0;j<P.size();j++){

				if(dist(now,P[j])/V[j]>mxd)mx=j,mxd=dist(now,P[j])/V[j];

			}

			

			now=now+((P[mx]-now)/dist(P[mx],now)*d);

		}

		

		double ans=0;

		for(int i=0;i<P.size();i++){

			ans=max(ans,dist(now,P[i])/V[i]);

		}

		printf("%.8f\n",ans);

	}

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.8526904171326817x):
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

  

using namespace std;

  

double EPS = 1e-7;

  

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

  

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

  

double dist(point a,point b){

    return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}



int main(void){

    int n,x,y,v;

    vector<point>P;

    vector<double>V;

     

    while(cin >> n,n){

        P.clear();

        V.clear();

         

        for(int i=0;i<n;i++){

            cin >> x >> y >> v;

            P.push_back(point(x,y));

            V.push_back(v);

        }

        

        double r=0.98;

        point now(0,0);

         

        for(double d=10;d>EPS;d*=r){

            int mx=0;

            double mxd=0;

             

            for(int j=0;j<P.size();j++)

                if(dist(now,P[j])/V[j]>mxd)

		  mx=j,mxd=dist(now,P[j])/V[j];

             

            now=now+((P[mx]-now)/dist(P[mx],now)*d);

        }

         

        double ans=0;

        for(int i=0;i<P.size();i++){

	  ans=max(ans,dist(now,P[i])/V[i]);

        }

        printf("%.8f\n",ans);

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

 

using namespace std;

 

double EPS = 1e-10;

 

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

 

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

 

double dist(point a,point b){

	return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}

 

int main(void){

	int n,x,y,v;

	vector<point>P;

	vector<double>V;

	

	while(cin >> n,n){

		P.clear();

		V.clear();

		

		for(int i=0;i<n;i++){

			cin >> x >> y >> v;

			P.push_back(point(x,y));

			V.push_back(v);

		}

		

		

		double r=0.99;

		point now(0,0);

		

		for(double d=10;d>1e-8;d*=r){

			int mx=0;

			double mxd=0;

			

			for(int j=0;j<P.size();j++){

				if(dist(now,P[j])/V[j]>mxd)mx=j,mxd=dist(now,P[j])/V[j];

			}

			

			now=now+((P[mx]-now)/dist(P[mx],now)*d);

		}

		

		double ans=0;

		for(int i=0;i<P.size();i++){

			ans=max(ans,dist(now,P[i])/V[i]);

		}

		printf("%.8f\n",ans);

	}

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1491217386943031x):
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

  

using namespace std;

  

double EPS = 1e-7;

  

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

  

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

  

double dist(point a,point b){

    return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}



int main(void){

    int n,x,y,v;

    vector<point>P;

    vector<double>V;

     

    while(cin >> n,n){

        P.clear();

        V.clear();

         

        for(int i=0;i<n;i++){

            cin >> x >> y >> v;

            P.push_back(point(x,y));

            V.push_back(v);

        }

        

        double r=0.98;

        point now(0,0);

         

        for(double d=10;d>EPS;d*=r){

            int mx=0;

            double mxd=0;

             

            for(int j=0;j<P.size();j++)

                if(dist(now,P[j])/V[j]>mxd)

		  mx=j,mxd=dist(now,P[j])/V[j];

             

            now=now+((P[mx]-now)/dist(P[mx],now)*d);

        }

         

        double ans=0;

        for(int i=0;i<P.size();i++){

	  ans=max(ans,dist(now,P[i])/V[i]);

        }

        printf("%.8f\n",ans);

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

 

using namespace std;

 

double EPS = 1e-10;

 

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

 

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

 

double dist(point a,point b){

	return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}

 

int main(void){

	int n,x,y,v;

	vector<point>P;

	vector<double>V;

	

	while(cin >> n,n){

		P.clear();

		V.clear();

		

		for(int i=0;i<n;i++){

			cin >> x >> y >> v;

			P.push_back(point(x,y));

			V.push_back(v);

		}

		

		

		double r=0.999;

		point now(0,0);

		

		for(double d=10;d>EPS;d*=r){

			int mx=0;

			double mxd=0;

			

			for(int j=0;j<P.size();j++){

				if(dist(now,P[j])/V[j]>mxd)mx=j,mxd=dist(now,P[j])/V[j];

			}

			

			now=now+((P[mx]-now)/dist(P[mx],now)*d);

		}

		

		double ans=0;

		for(int i=0;i<P.size();i++){

			ans=max(ans,dist(now,P[i])/V[i]);

		}

		printf("%.8f\n",ans);

	}

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.9056009860981327x):
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

  

using namespace std;

  

double EPS = 1e-6;

  

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

  

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

  

double dist(point a,point b){

    return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}



int main(void){

    int n,x,y,v;

    vector<point>P;

    vector<double>V;

     

    while(cin >> n,n){

        P.clear();

        V.clear();

         

        for(int i=0;i<n;i++){

            cin >> x >> y >> v;

            P.push_back(point(x,y));

            V.push_back(v);

        }

        

        double r=0.98;

        point now(0,0);

         

        for(double d=10;d>EPS;d*=r){

            int mx=0;

            double mxd=0;

             

            for(int j=0;j<P.size();j++)

                if(dist(now,P[j])/V[j]>mxd)

		  mx=j,mxd=dist(now,P[j])/V[j];

             

            now=now+((P[mx]-now)/dist(P[mx],now)*d);

        }

         

        double ans=0;

        for(int i=0;i<P.size();i++){

	  ans=max(ans,dist(now,P[i])/V[i]);

        }

        printf("%.8f\n",ans);

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

 

using namespace std;

 

double EPS = 1e-10;

 

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

 

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

 

double dist(point a,point b){

	return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}

 

int main(void){

	int n,x,y,v;

	vector<point>P;

	vector<double>V;

	

	while(cin >> n,n){

		P.clear();

		V.clear();

		

		for(int i=0;i<n;i++){

			cin >> x >> y >> v;

			P.push_back(point(x,y));

			V.push_back(v);

		}

		

		

		double r=0.99;

		point now(0,0);

		

		for(double d=10;d>1e-8;d*=r){

			int mx=0;

			double mxd=0;

			

			for(int j=0;j<P.size();j++){

				if(dist(now,P[j])/V[j]>mxd)mx=j,mxd=dist(now,P[j])/V[j];

			}

			

			now=now+((P[mx]-now)/dist(P[mx],now)*d);

		}

		

		double ans=0;

		for(int i=0;i<P.size();i++){

			ans=max(ans,dist(now,P[i])/V[i]);

		}

		printf("%.8f\n",ans);

	}

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1649030962449922x):
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

  

using namespace std;

  

double EPS = 1e-6;

  

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

  

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

  

double dist(point a,point b){

    return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}



int main(void){

    int n,x,y,v;

    vector<point>P;

    vector<double>V;

     

    while(cin >> n,n){

        P.clear();

        V.clear();

         

        for(int i=0;i<n;i++){

            cin >> x >> y >> v;

            P.push_back(point(x,y));

            V.push_back(v);

        }

        

        double r=0.98;

        point now(0,0);

         

        for(double d=10;d>EPS;d*=r){

            int mx=0;

            double mxd=0;

             

            for(int j=0;j<P.size();j++)

                if(dist(now,P[j])/V[j]>mxd)

		  mx=j,mxd=dist(now,P[j])/V[j];

             

            now=now+((P[mx]-now)/dist(P[mx],now)*d);

        }

         

        double ans=0;

        for(int i=0;i<P.size();i++){

	  ans=max(ans,dist(now,P[i])/V[i]);

        }

        printf("%.8f\n",ans);

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

 

using namespace std;

 

double EPS = 1e-10;

 

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

 

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

 

double dist(point a,point b){

	return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}

 

int main(void){

	int n,x,y,v;

	vector<point>P;

	vector<double>V;

	

	while(cin >> n,n){

		P.clear();

		V.clear();

		

		for(int i=0;i<n;i++){

			cin >> x >> y >> v;

			P.push_back(point(x,y));

			V.push_back(v);

		}

		

		

		double r=0.999;

		point now(0,0);

		

		for(double d=10;d>EPS;d*=r){

			int mx=0;

			double mxd=0;

			

			for(int j=0;j<P.size();j++){

				if(dist(now,P[j])/V[j]>mxd)mx=j,mxd=dist(now,P[j])/V[j];

			}

			

			now=now+((P[mx]-now)/dist(P[mx],now)*d);

		}

		

		double ans=0;

		for(int i=0;i<P.size();i++){

			ans=max(ans,dist(now,P[i])/V[i]);

		}

		printf("%.8f\n",ans);

	}

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.981508569237185x):
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

  

using namespace std;

  

double EPS = 1e-6;

  

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

  

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

  

double dist(point a,point b){

    return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}



int main(void){

    int n,x,y,v;

    vector<point>P;

    vector<double>V;

     

    while(cin >> n,n){

        P.clear();

        V.clear();

         

        for(int i=0;i<n;i++){

            cin >> x >> y >> v;

            P.push_back(point(x,y));

            V.push_back(v);

        }

        

        double r=0.975;

        point now(0,0);

         

        for(double d=10;d>EPS;d*=r){

            int mx=0;

            double mxd=0;

             

            for(int j=0;j<P.size();j++)

                if(dist(now,P[j])/V[j]>mxd)

		  mx=j,mxd=dist(now,P[j])/V[j];

             

            now=now+((P[mx]-now)/dist(P[mx],now)*d);

        }

         

        double ans=0;

        for(int i=0;i<P.size();i++){

	  ans=max(ans,dist(now,P[i])/V[i]);

        }

        printf("%.8f\n",ans);

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

 

using namespace std;

 

double EPS = 1e-10;

 

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

 

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

 

double dist(point a,point b){

	return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}

 

int main(void){

	int n,x,y,v;

	vector<point>P;

	vector<double>V;

	

	while(cin >> n,n){

		P.clear();

		V.clear();

		

		for(int i=0;i<n;i++){

			cin >> x >> y >> v;

			P.push_back(point(x,y));

			V.push_back(v);

		}

		

		

		double r=0.99;

		point now(0,0);

		

		for(double d=10;d>1e-8;d*=r){

			int mx=0;

			double mxd=0;

			

			for(int j=0;j<P.size();j++){

				if(dist(now,P[j])/V[j]>mxd)mx=j,mxd=dist(now,P[j])/V[j];

			}

			

			now=now+((P[mx]-now)/dist(P[mx],now)*d);

		}

		

		double ans=0;

		for(int i=0;i<P.size();i++){

			ans=max(ans,dist(now,P[i])/V[i]);

		}

		printf("%.8f\n",ans);

	}

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.187543652446689x):
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

  

using namespace std;

  

double EPS = 1e-6;

  

double add(double a,double b){

  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;

  return a+b;

}

  

struct point{

  double x,y;

  point() {}

  point(double x,double y):x(x),y(y){

  }

  point operator + (point p){

    return point(add(x,p.x),add(y,p.y));

  }

  point operator - (point p){

    return point(add(x,-p.x),add(y,-p.y));

  }

  point operator * (double d){

    return point(x*d,y*d);

  }

  point operator / (double d){

    return point(x/d,y/d);

  }

};

  

double dist(point a,point b){

    return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));

}



int main(void){

    int n,x,y,v;

    vector<point>P;

    vector<double>V;

     

    while(cin >> n,n){

        P.clear();

        V.clear();

         

        for(int i=0;i<n;i++){

            cin >> x >> y >> v;

            P.push_back(point(x,y));

            V.push_back(v);

        }

        

        double r=0.975;

        point now(0,0);

         

        for(double d=10;d>EPS;d*=r){

            int mx=0;

            double mxd=0;

             

            for(int j=0;j<P.size();j++)

                if(dist(now,P[j])/V[j]>mxd)

		  mx=j,mxd=dist(now,P[j])/V[j];

             

            now=now+((P[mx]-now)/dist(P[mx],now)*d);

        }

         

        double ans=0;

        for(int i=0;i<P.size();i++){

	  ans=max(ans,dist(now,P[i])/V[i]);

        }

        printf("%.8f\n",ans);

    }

    return 0;

}
// Slower C++ solution:
#include <set>

#include <cstdio>

#include <algorithm>

#include <queue>

#include <cstdlib>

#include <complex>



#define REP(i,n) for(int i=0; i<(int)(n); i++)

inline int getInt(){ int s; scanf("%d", &s); return s; }



using namespace std;



typedef complex<double> P;



int main(){

  while(const int n = getInt()){

    vector<P>   pos(n);

    vector<double> v(n);



    REP(i,n){

      const int x = getInt();

      const int y = getInt();

      v[i] = getInt();

      pos[i] = P(x, y);

    }



    const double r = 0.99;

    P p(0, 0);



    auto calc = [&](P p){

      auto mx = make_pair(0.0, 0);

      REP(i,n) mx = max(mx, make_pair(abs(p - pos[i]) / v[i], i));

      return mx;

    };



    for(double d = 1000; d > 1e-8; d *= r){

      auto mx = calc(p).second;

      p += (pos[mx] - p) / abs(pos[mx] - p) * d;

    }



    printf("%.8f\n", calc(p).first);

  }



  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.190363827538568x):
#include <set>

#include <cstdio>

#include <algorithm>

#include <queue>

#include <cstdlib>

#include <complex>



#define REP(i,n) for(int i=0; i<(int)(n); i++)

inline int getInt(){ int s; scanf("%d", &s); return s; }



using namespace std;



typedef complex<double> P;



int main(){

  while(const int n = getInt()){

    vector<P>   pos(n);

    vector<double> v(n);



    REP(i,n){

      const int x = getInt();

      const int y = getInt();

      v[i] = getInt();

      pos[i] = P(x, y);

    }



    const double r = 0.98;

    P p(0, 0);



    auto calc = [&](P p){

      auto mx = make_pair(0.0, 0);

      REP(i,n) mx = max(mx, make_pair(abs(p - pos[i]) / v[i], i));

      return mx;

    };



    for(double d = 1000; d > 1e-8; d *= r){

      auto mx = calc(p).second;

      p += (pos[mx] - p) / abs(pos[mx] - p) * d;

    }



    printf("%.8f\n", calc(p).first);

  }



  return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <algorithm>

#include <cmath>

using namespace std;



// 入力

int N;

double x[101], y[101], v[101];



// 2点間の距離

double dist(double x1, double y1, double x2, double y2){

	return sqrt( (x1-x2) * (x1-x2) + (y1-y2) * (y1-y2) );

}



// (x_,y_) => (x[i],y[i]) (0 <= i < N)の移動時間で最大のものを返す.

double g(double x_, double y_){

	double t = 0;

	for(int i=0 ; i < N ; i++ ){

		double d = dist( x_ , y_ , x[i] , y[i]);

		t = max( t , d / v[i] );

	}

	return t;

}



// x が与えられた時, y について三分探索 (0 <= y <= 100)

double f(double x, double low=0, double high=100){

	for (int i = 0 ; i < 100 ; i++ ){

		double a = (low * 2 + high) / 3;

		double b = (low + high * 2) / 3;

		if( g(x, a) < g(x, b) ){

			high = b;

		}else{

			low = a;

		}

	}

	return g(x, (low + high) / 2);

}



// x について三分探索 (0 <= x <= 100)

double search(double low=0, double high=100){

	for (int i = 0 ; i < 100 ; i++ ){

		double a = (low * 2 + high) / 3;

		double b = (low + high * 2) / 3;

		if( f(a) < f(b) ){

			high = b;

		}else{

			low = a;

		}

	}

	return f((low + high) / 2) ;

}



int main(){

	while( scanf("%d", &N) ){

		if( N == 0 ) break;

		

		for(int i=0 ; i <N ; i++ ){

			scanf("%lf %lf %lf", &x[i], &y[i], &v[i]);

		}

		double ans = search();

		printf("%.8f\n", ans);

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.3207815185441891x):
#include <cstdio>

#include <cmath>

#include <algorithm>

using namespace std;



const int MAX_LOOP = 86;

const int MAX_N = 100;

int n;

double x[MAX_N], y[MAX_N], v[MAX_N];



double dist(double x, double y, double x_, double y_){

	return sqrt((x - x_) * (x - x_) + (y - y_) * (y - y_));

}



double h(double px, double py){

	double res = 0;

	for(int i=0 ; i < n ; i++ ){

		double d = dist(px, py, x[i], y[i]);

		double t = d / v[i];

		res = max(res, t);

	}

	return res;

}



double g(double left, double right, double py){

	for(int i=0 ; i < MAX_LOOP ; i++ ){

		double mid1 = (left * 2 + right) / 3;

		double mid2 = (left + right * 2) / 3;

		if( h(mid1, py) < h(mid2, py) ){

			right = mid2;

		}else{

			left = mid1;

		}

	}

	return h((left + right) / 2, py);

}



double f(double left, double right){

	for(int i=0 ; i < MAX_LOOP ; i++ ){

		double mid1 = (left * 2 + right) / 3;

		double mid2 = (left + right * 2) / 3;

		if( g(0, 100, mid1) < g(0, 100, mid2) ){

			right = mid2;

		}else{

			left = mid1;

		}

	}

	return g(0, 100, (left + right) / 2);

}



int main(){

	while( scanf("%d", &n), n ){

		for(int i=0 ; i < n ; i++ ){

			scanf("%lf %lf %lf", &x[i], &y[i], &v[i]);

		}

		double ans = f(0,100);

		printf("%.8f\n", ans);

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>



#ifndef ONLINE_JUDGE

	#define W(x, y) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << y;

#else

	#define W(x, y)

#endif





#define ll long long

#define pii pair<int, int>

#define pll pair<ll, ll>

#define vi vector<int>

#define vii vector<pii>

#define vl vector<ll>

#define vll vector<pll>

#define pb push_back

#define mp make_pair

#define ff first

#define ss second

#define pi acos(-1)

#define ld long double

#define prime (1000000000 + 7)



using namespace std;



#define INF 1000000000







int main(){

	ios::sync_with_stdio(false);

	cin.tie(0); cout.tie(0);



	

	string s;

	cin >> s;



	stack<ll> pilha;

	for(int i = 0; i < s.size(); ++i){

		if(pilha.empty()){

			pilha.push(s[i]);

		} else{

			if(pilha.top() != s[i]){

				pilha.pop();

			} else{

				pilha.push(s[i]);

			}

		}

	}

	cout << s.size() - pilha.size() << endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1057823667528475x):
#include<cstdio>

#include<cstring>

#include<stack>

using namespace std;



char s[100005];

int main()

{

    int num=0;

    int i;

    stack<char>c;

    scanf("%s",s);

    int len=strlen(s);

    for(i=0;i<=len-1;i++)

    {

        if(c.empty()||c.top()==s[i])

            c.push(s[i]);

        else

        {

            c.pop();

            num+=2;

        }

    }

    printf("%d",num);

    return 0;

}