#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
#include <complex>
inline double sq(double x){ return x * x; }
typedef complex<double> Point;
vector<Point> cross(Point p1, double r1, Point p2, double r2){
  vector<Point> res;
  double d = abs(p2 - p1);
  double a = arg(p2 - p1);
  if(d < abs(r1 - r2) || d > r1 + r2) return res;
  double th = acos((sq(d) + sq(r1) - sq(r2)) / (2 * d * r1));
  Point pp(r1 * cos(a + th), r1 * sin(a + th));
  Point pm(r1 * cos(a - th), r1 * sin(a - th));
  res.push_back(pp + p1);
  res.push_back(pm + p1);
  return res;
}

bool ok(vector<Point>& p, vector<double>& r, Point c){
  REP(i, p.size()){
    if(abs(p[i] - c) > r[i] + EPS) return false;
  }
  return true;
}

int main(){
  int N;
  while(cin>>N && N){
    double x[100], y[100], l[100];
    REP(i, N) cin>>x[i]>>y[i]>>l[i];
    vector<Point> p(N);
    REP(i, N) p[i] = Point(x[i], y[i]);
    double lb = 0, ub = 1000000;
    REP(_, 100){
      double mid_is_ok = false;
      double mid = (ub + lb) / 2;
      vector<Point> cand = p;
      vector<double> r(N);
      REP(i, N) r[i] = l[i] * mid;
      REP(i, N) FOR(j, i + 1, N){
        vector<Point> v = cross(p[i], r[i], p[j], r[j]);
        cand.insert(cand.end(), v.begin(), v.end());
      }
      REP(i, cand.size()) if(ok(p, r, cand[i])) mid_is_ok = true;
      if(mid_is_ok){
        ub = mid;
      }else{
        lb = mid;
      }
    }
    printf("%.8lf\n", ub);
  }
  return 0;
}