Problem: A country Gizevom is being under a sneak and fierce attack by their foe. They have to deploy one or more troops to every base immediately in order to defend their country. Otherwise their foe would take all the bases and declare "All your base are belong to us."

You are asked to write a program that calculates the minimum time required for deployment, given the present positions and marching speeds of troops and the positions of the bases.



Input

The input consists of multiple datasets. Each dataset has the following format:

N M
x1 y1 v1
x2 y2 v2
...
xN yN vN
x'1 y'1
x'2 y'2
...
x'M y'M


N is the number of troops (1 ≤ N ≤ 100); M is the number of bases (1 ≤ M ≤ 100); (xi, yi ) denotes the present position of i-th troop; vi is the speed of the i-th troop (1 ≤ vi ≤ 100); (x'j, y'j) is the position of the j-th base.

All the coordinates are integers between 0 and 10000 inclusive.

The last dataset is followed by a line containing two zeros. This line is not a part of any dataset and should not be processed.

Output

For each dataset, print the minimum required time in a line.

Example

Input

2 2
10 20 1
0 10 1
0 10
10 0
0 0


Output

14.14213562

Solution (in CPP):

Solution:
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100;
const int MAX_M = 100;
const int MAX_GN = MAX_N + MAX_M + 2;

const int INF = 1 << 30;

/* typedef */

struct Pt {
  double x, y;
};

struct Edge {
  int i, c;
  double t;

  Edge() {}
  Edge(int _i, int _c, double _t): i(_i), c(_c), t(_t) {}
};

typedef vector<Edge> ve;

/* global variables */

int n, m;
Pt spts[MAX_N], gpts[MAX_M];
double vs[MAX_N];
ve nbrs[MAX_GN];
int gn, st, gl;
int minfs[MAX_GN], flows[MAX_GN][MAX_GN], prvs[MAX_GN];

/* subroutines */

int maxflow(double max_t) {
  memset(flows, 0, sizeof(flows));
  int max_flow = 0;

  for (;;) {
    //printf("max_flow = %lld\n", max_flow);

    memset(prvs, -1, sizeof(prvs));
    prvs[st] = st;
    minfs[st] = INF;

    queue<int> q;
    q.push(st);

    while (! q.empty()) {
      int ui = q.front(); q.pop();

      if (ui == gl) break;
      ve& nbru = nbrs[ui];
      for (ve::iterator vit = nbru.begin(); vit != nbru.end(); vit++) {
	int vi = vit->i;
	int vc = vit->c - flows[ui][vi];
	double vt = vit->t;
	if (vt <= max_t && prvs[vi] < 0 && vc > 0) {
	  prvs[vi] = ui;
	  minfs[vi] = (minfs[ui] < vc) ? minfs[ui] : vc;
	  q.push(vi);
	}
      }
    }

    if (prvs[gl] < 0) break;

    int min_flow = minfs[gl];
    for (int j = gl; j != st;) {
      int i = prvs[j];
      flows[i][j] += min_flow;
      flows[j][i] -= min_flow;
      j = i;
    }

    max_flow += min_flow;
  }

  return max_flow;
}

/* main */

int main() {
  for (;;) {
    cin >> n >> m;
    if (n == 0) break;

    for (int i = 0; i < n; i++) cin >> spts[i].x >> spts[i].y >> vs[i];
    for (int i = 0; i < m; i++) cin >> gpts[i].x >> gpts[i].y;

    gn = n + m + 2;
    st = n + m;
    gl = st + 1;

    for (int i = 0; i < gn; i++) nbrs[i].clear();

    double max_t = 0.0;
    
    for (int i = 0; i < n; i++) {
      Pt& spt = spts[i];
      for (int j = 0; j < m; j++) {
	Pt& gpt = gpts[j];
	double dx = gpt.x - spt.x, dy = gpt.y - spt.y;
	double t = sqrt(dx * dx + dy * dy) / vs[i];
	if (max_t < t) max_t = t;

	nbrs[i].push_back(Edge(n + j, 1, t));
	nbrs[n + j].push_back(Edge(i, 0, t));
      }
    }

    for (int i = 0; i < n; i++) nbrs[st].push_back(Edge(i, 1, 0.0));
    for (int i = 0; i < m; i++) nbrs[n + i].push_back(Edge(gl, 1, 0.0));

    //printf("max_t=%.8lf\n", max_t);
    double t0 = 0.0, t1 = max_t;

    for (int i = 0; i < 50; i++) {
      double mt = (t0 + t1) / 2;
      if (maxflow(mt) >= m) t1 = mt;
      else t0 = mt;
    }

    printf("%.8lf\n", t1);
  }

  return 0;
}