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:
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
const static int tx[] = {0,1,1,1,0,-1,-1,-1};
const static int ty[] = {-1,-1,0,1,1,1,0,-1};
 
static const double EPS = 1e-12;

class BipartiteGraph {
private:
  int V;
  vector<int>* G;
  int* match;
  bool* used;
public:
  BipartiteGraph(int n){
    V = n;
    match = new int[n];
    used = new bool[n];
    G = new vector<int>[n];
  }

  ~BipartiteGraph(){
    delete[] match;
    delete[] used;
    delete[] G;
  }

  void add_edge(int u,int v){
    G[u].push_back(v);
    G[v].push_back(u);
  }

  bool dfs(int v){
    used[v] = true;
    for(int i=0;i<G[v].size();i++){
      int u = G[v][i];
      int w = match[u];
      if(w < 0 || (!used[w] && dfs(w))){
	match[v] = u;
	match[u] = v;
	return true;
      }
    }
    return false;
  }

  int bipartite_matching() {
    int res = 0;
    fill(match,match+V,-1);
    for(int v=0; v < V;v++){
      if(match[v] < 0){
	fill(used,used+V,false);
	if(dfs(v)){
	  res++;
	}
      }
    }
    return res;
  }
};

class Point{
public:
  int x;
  int y;
  Point() : x(0),y(0) {}
  Point(int _x,int _y) : x(_x),y(_y) {}
};

class Troop{
public:
  Point point;
  int velocity;
  Troop() : point(),velocity(0){}
  Troop(const Point& _p,int _v) : point(_p),velocity(_v){}
};

double compute_distance(const Point& p1,const Point& p2){
  return sqrt((p1.x - p2.x) * (p1.x - p2.x)
	      + (p1.y - p2.y) * (p1.y - p2.y));
}

double compute_time(double distance,double velocity){
  return distance / velocity;
}

bool check(double time,int total_troops,int total_bases,
	   double times[101][101]){
  BipartiteGraph bg(total_troops + total_bases);

  for(int troop_idx = 0; troop_idx < total_troops; troop_idx++){
    for(int base_idx = 0; base_idx < total_bases; base_idx++){
      if(time >= times[troop_idx][base_idx] - EPS){
	bg.add_edge(troop_idx,total_troops + base_idx);
      }
    }
  }

  return (bg.bipartite_matching() == total_bases);
}

int main(){
  int total_troops;
  int total_bases;
  while(~scanf("%d %d",&total_troops,&total_bases)){
    if(total_troops == 0 && total_bases == 0) break;

    vector<Troop> troops;
    vector<Point> bases;
    for(int troop_idx = 0; troop_idx < total_troops; troop_idx++){
      int x,y,v;
      scanf("%d %d %d",&x,&y,&v);
      troops.push_back(Troop(Point(x,y),v));
    }
    for(int base_idx = 0; base_idx < total_bases; base_idx++){
      int x,y;
      scanf("%d %d",&x,&y);
      bases.push_back(Point(x,y));
    }

    double times[101][101];
    for(int troop_idx = 0; troop_idx < total_troops; troop_idx++){
      for(int base_idx = 0; base_idx < total_bases; base_idx++){
	times[troop_idx][base_idx]
	  = compute_time(
	    compute_distance(bases[base_idx],troops[troop_idx].point),
	    troops[troop_idx].velocity);
      }
    }

    double upper_time = 1000000000000.0;
    double lower_time = 0;
    for(int round=0;round<100;round++){
      double mid = (upper_time + lower_time) / 2.0;
      if(check(mid,total_troops,total_bases,times)){
	upper_time = mid;
      }
      else{
	lower_time = mid;
      }
    }

    printf("%.10f\n",upper_time);
  }
}