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<stdio.h>
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <functional>
#include <stdio.h>
#include <array>
#include <algorithm>
#include <string>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <queue>
#include<iomanip>
#include<bitset>
#include<stack>
#include<set>
#include<limits>
#include <complex>
using namespace std;
template < class BidirectionalIterator >
bool next_combination(BidirectionalIterator first1,
	BidirectionalIterator last1,
	BidirectionalIterator first2,
	BidirectionalIterator last2)
{
	if ((first1 == last1) || (first2 == last2)) {
		return false;
	}
	BidirectionalIterator m1 = last1;
	BidirectionalIterator m2 = last2; --m2;
	while (--m1 != first1 && !(*m1 < *m2)) {
	}
	bool result = (m1 == first1) && !(*first1 < *m2);
	if (!result) {
		// ?
		while (first2 != m2 && !(*m1 < *first2)) {
			++first2;
		}
		first1 = m1;
		std::iter_swap(first1, first2);
		++first1;
		++first2;
	}
	if ((first1 != last1) && (first2 != last2)) {
		// ?
		m1 = last1; m2 = first2;
		while ((m1 != first1) && (m2 != last2)) {
			std::iter_swap(--m1, m2);
			++m2;
		}
		// ?
		std::reverse(first1, m1);
		std::reverse(first1, last1);
		std::reverse(m2, last2);
		std::reverse(first2, last2);
	}
	return !result;
}

template < class BidirectionalIterator >
bool next_combination(BidirectionalIterator first,
	BidirectionalIterator middle,
	BidirectionalIterator last)
{
	return next_combination(first, middle, middle, last);
}




#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>

using namespace std;

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

const int INF = 999999999;

long double times[100][100];
typedef int Weight;
struct Edge {
	int src, dst;
	Weight weight;
	Edge(int src, int dst, Weight weight) :
		src(src), dst(dst), weight(weight) { }
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

typedef vector<Weight> Array;
typedef vector<Array> Matrix;
#define RESIDUE(s,t) (capacity[s][t]-flow[s][t])
Weight maximumFlow(const Graph &g, int s, int t) {
	int n = g.size();
	Matrix flow(n, Array(n)), capacity(n, Array(n));
	REP(u, n) FOR(e, g[u]) capacity[e->src][e->dst] += e->weight;

	Weight total = 0;
	while (1) {
		queue<int> Q; Q.push(s);
		vector<int> prev(n, -1); prev[s] = s;
		while (!Q.empty() && prev[t] < 0) {
			int u = Q.front(); Q.pop();
			FOR(e, g[u]) if (prev[e->dst] < 0 && RESIDUE(u, e->dst) > 0) {
				prev[e->dst] = u;
				Q.push(e->dst);
			}
		}
		if (prev[t] < 0) return total; // prev[x] == -1 <=> t-side
		Weight inc = INF;
		for (int j = t; prev[j] != j; j = prev[j])
			inc = min(inc, RESIDUE(prev[j], j));
		for (int j = t; prev[j] != j; j = prev[j])
			flow[prev[j]][j] += inc, flow[j][prev[j]] -= inc;
		total += inc;
	}
}

struct tumiki {
	long long int x;
	long long int y;
	long long int id;
};

class Compare {
public:
	bool operator()(const pair<int,long long  int>&l, const pair<int, long long int >&r) {
		return l.second > r.second;
	}
};

int main() {
	while (1) {
		memset(times, 0, sizeof(times));
		int N, M; cin >> N >> M;
		if (!N)break;

		vector<complex<long double>>ts;
		vector<complex<long double>>bs;
		vector<long double>vs;
		for (int i = 0; i < N; ++i) {
			int x, y, v; cin >> x >> y >> v;
			ts.emplace_back(x, y);
			vs.emplace_back(v);
		}
		for (int i = 0; i < M; ++i) {
			int x, y; cin >> x >> y ;
			bs.emplace_back(x, y);
		}

		for (int i = 0; i < N; ++i) {
			for (int j = 0; j < M; ++j) {
				times[i][j] = abs(ts[i] - bs[j]) / vs[i];
			}
		}

		long double amin = 0;
		long double amax =4000000;
		while (amax - amin > 1e-9) {
			long double amid = (amax + amin) / 2;
			Graph g(2+N+M);
			for (int i = 0; i < N; ++i) {
				g[0].push_back(Edge(0, i + 1, 1));
			}
			for (int i = 0; i < M; ++i) {
				g[N + 1+i].push_back(Edge(N+1+i, M+N+1, 1));
			}
			for (int i = 0; i < N; ++i) {
				for (int j = 0; j < M; ++j) {
					if (times[i][j] < amid) {
						g[1+i].push_back(Edge(1+i, N + j+1, 1));
						g[N + j + 1].push_back(Edge(N + j + 1, 1+i, 0));
					}
					else {
					}
				}
			}
			if (maximumFlow(g, 0, M + N + 1) >= M) {
				amax = amid;
			}
			else {
				amin = amid;
			}
			
		}
		cout  <<fixed<<setprecision(33)<<amin << endl;
	}

	return 0;
	long long int N; cin >> N;
	vector<bool>used(N, false);
	vector<tumiki>tus;

	for (int i = 0; i < N; ++i) {
		int a, b; cin >> a >> b;
		tus.push_back(tumiki{a, b, i});
		tus.push_back(tumiki{ b, a, i });
	}
	sort(tus.begin(), tus.end(), [](const tumiki&l, const tumiki&r) {
		return l.x == r.x ? l.y > r.y : l.x < r.x; });

	vector<vector<pair<int, long long int>>>edges(2*N+2);
	for (int i = 0; i <2* N; ++i) {
		edges[0].push_back(make_pair(i + 1, tus[i].y));
		edges[i+1].push_back(make_pair(2*N+1, 0));
	}
	for (int i = 0; i < 2 * N; ++i) {
		for (int j = 0; j < 2 * N; ++j) {
			if (tus[i].id == tus[j].id) {
				continue;
			}
			else {
				if (tus[i].x < tus[j].x) {
					edges[i + 1].push_back(make_pair(j+1, tus[j].y));
				}
			}
		}
	}

	vector<int>ans(2 * N + 2,-1);

	priority_queue<pair<int, long long int>,vector<pair<int,long long int >>,Compare>que;
	que.push({ 0,0 });
	while (!que.empty()) {
		pair<int,long long int >atop(que.top());
		que.pop();
		if (ans[atop.first] < atop.second) {
			for (auto i : edges[atop.first]) {
				if (i.second + atop.second > ans[i.first]) {
					que.push({ i.first,ans[i.first] + atop.second });
					ans[i.first] = i.second + atop.second;
				}
			}
		}
	}
	cout << ans[2 * N + 1] << endl;
	



	return 0;

}