Problem E: Frisbee Dogs
Crane is trying to enter her beloved dog, Jack, into a Frisbee Dog competition. However, she is not confident that Jack will perform well. She would like you to create a program that simulates the competition and estimates Jack's performance.
The competition is held by N dogs on a two-dimensional plane. At the start of the competition, the i-th dog is at position (Dix, Diy). The i-th dog can run at a speed of Vi [m/s], and all dogs are small enough to be considered as points. At any time, two or more dogs can be in the same position.
The competition starts with the launch of the first Frisbee, and from that moment on, the dogs are allowed to move. The Frisbee can also be considered as a point, and the i-th Frisbee is launched from the position (FPix, FPin) with a velocity vector of (FVix, FViy) [m/s], and continues to move at constant speed in a straight line. When the position of a dog and the position of a Frisbee are the same, the dog can acquire the Frisbee.
When the first Frisbee is acquired by a dog, the second Frisbee is launched. When the second Frisbee is acquired, the third is launched, and so on, with the next Frisbee launched immediately after it is acquired. The competition ends when M Frisbees are acquired.
Needless to say, the goal of the dogs is to acquire as many Frisbees as possible. The dogs take the following strategy:
When a Frisbee is launched, a dog moves to be able to acquire it as soon as possible, and acquires the Frisbee. However, if the dog cannot acquire the Frisbee, it waits at its current location.
Whether a dog can acquire a Frisbee is determined independently of the actions of other dogs. That is, even if a dog moves to acquire a Frisbee, it may be acquired by another dog first. When a Frisbee is acquired by any dog and a new Frisbee is launched, the dogs take the above strategy for the new Frisbee.
Your program should output the number of Frisbees acquired by each dog.
Input
The input file consists of multiple datasets.
The first line of each dataset gives the number of dogs N (1 ≤ N ≤ 10) and the number of Frisbees M (1 ≤ M ≤ 1000).
The following N lines give the initial position and speed of the dogs, Dix, Diy, and Vi, separated by a single space.
The following M lines give the launch position and velocity of the Frisbees, FPix, FPin, FVix, and FViy, separated by a single space.
The given coordinate values are real numbers, and their absolute value does not exceed 1000. The given speed is a real number, and 1 ≤ Vi ≤ 100, -25 ≤ FVix, FViy ≤ 25. It can be assumed that there is no Frisbee that cannot be acquired by any dog.
If a Frisbee is acquired by a dog at time t, no dog can acquire it before t+1e-6.
During the simulation, the absolute values of the x and y coordinates of the dogs do not exceed 1e+8.
The end of the input is indicated by N=0 and M=0.
Output
Output the number of Frisbees acquired by each dog on a single line, separated by a space. The order of the output must be the same as the order of the input.
Sample Input
2 1
12 5 3
0 17 3
0 0 2 2
2 3
2 0 2
100 100 2
0 0 -1 0
-2 -5 0 3
100 100 1 1
0 0
Output for the Sample Input
1 0
2 1
