stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

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

#define endl '\n'

#define ll long long





double table[100000];

double cusum[100000];



signed main() {

    int n,k;

    cin >> n >> k;



    vector<double> a(n);

    rep(i,n) cin >> a[i];



    table[0] = 0;

    table[1] = 1;

    for(int i = 2; i < 100000; i++){

        table[i] = table[i-1] + i;

    }

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

        a[i] = table[(int)a[i]] / a[i];

    }

    cusum[0] = a[0];

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

        cusum[i] = cusum[i-1] + a[i];

    }



    double ans = 0;

    for(int i = k - 1; i < n; i++){

        if(i == k - 1) ans = cusum[i];

        else ans = max(ans,cusum[i] - cusum[i - k]);

    }

    cout << fixed << setprecision(10) << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.7951730885609085x):
#include <bits/stdc++.h>

using namespace std;

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

#define int long long



signed main() {

    int n,k;

    cin >> n >> k;



    vector<int> a(n);

    int m = 0;

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

        cin >> a[i];

        m = max(m,a[i]);

    }



    vector<int> sum(m + 1);

    for (int i = 1; i <= m; i++) {

        sum[i] = sum[i - 1] + i;

    }



    vector<double> exp(n);

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

        exp[i] = (double)sum[a[i]] / (double)a[i];

    }



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

        exp[i] += exp[i - 1];

    }



    double ans = 0.0;

    for (int i = k - 1; i < n; i++) {

        double res = 0.0;

        if(i == k - 1) res = exp[i];

        else {

            res = exp[i] - exp[i - k];

        }

        ans = max(ans,res);

    }

    cout << fixed << setprecision(10) <<  ans << endl;

}
// 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.352726075402877x):
#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;

}
// 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.2376217450212215x):
#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>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.2376217450212215x):
#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>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.7014932339959947x):
#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.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.1040249488772234x):
#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.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.801340009983159x):
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

  

using namespace std;

  

double EPS = 1e-8;

  

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.1338057224154152x):
#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<algorithm>

  

using namespace std;

  

double EPS = 1e-8;

  

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;

}