Klein is trying to get her dog Jack into the Frisbee Dog Tournament. But she's not sure if Jack will get a good grade. For her, she simulates the tournament to get Jack's grade. I want you to create a program to estimate.

The tournament is held by N dogs on a two-dimensional plane. At the start of the tournament, the i-th dog is in the (Dix, Diy) position. The i-th dog is Vi [m / s] All dogs are small enough to be considered points. At any given time, two or more dogs may be in the same position.

The tournament begins with the launch of the first Frisbee, from which the dogs are allowed to move. Frisbee can also be considered a point, the i Frisbee from the (FPix, FPiy) position ( FVix, FViy) Fired at a velocity vector of [m / s] and continues a constant velocity linear motion. When a dog's position and a Frisbee's position are equal, the dog can get a Frisbee.

The moment the first Frisbee is acquired by one of the dogs, the second Frisbee is fired. The moment the second Frisbee is acquired, the third is fired, and so on. Immediately after, the next Frisbee will be fired. The tournament will end when the Mth Frisbee is acquired.

Needless to say, the dogs' goal is to get more Frisbee. Dogs take the following strategies.

When the Frisbee is fired, the dog moves to get it at the earliest possible time and gets the Frisbee. However, if it cannot get the Frisbee, it waits where it is.

The determination of whether a dog can get a frisbee is made regardless of the behavior of the other dog. That is, one dog moves to get a frisbee, but the other dog gets it first. The moment one of the dogs gets the Frisbee and a new Frisbee is launched, the dogs take the above strategy against the new Frisbee.

The program you create must output the number of Frisbees obtained by each dog.



Input

The input file consists of multiple datasets.

The first row of the dataset gives the number of dogs N (1 ≤ N ≤ 10) and the number of Frisbees M (1 ≤ M ≤ 1000).

The following N lines are given the dog's initial position and velocity Dix, Diy, Vi, separated by a single blank.

The following M lines are given the Frisbee launch position and velocity FPix, FPiy, FVix, FViy, separated by a single space character.

The coordinate values ​​given are real numbers and their absolute values ​​do not exceed 1000. The speeds given are real numbers 1 ≤ DVi ≤ 100, -25 ≤ FVix, FViy ≤ 25. Frisbees that cannot be obtained by any dog You can assume that there is no.

When a dog with any Frisbee was obtained at time t, no dog could get it before time t + 1e-6.

During the simulation, the absolute values ​​of the dog's x and y coordinates do not exceed 1e + 8.

When both N and M are 0, the end of input is indicated.

Output

Output the number of Frisbees obtained by each dog on one line separated by a space character. The order of output must be the same as the order given in the input.

Example

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

1 0
2 1
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define fi first
#define se second
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CCIN(...)                                                              \
    char __VA_ARGS__;                                                          \
    CIN(__VA_ARGS__)
#define DCIN(...)                                                              \
    double __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Printv(v)                                                              \
    {                                                                          \
        REP(x, v.size()) { cout << v[x] << (x == v.size() - 1 ? "\n" : " "); } \
    }
template <typename T = string> inline void eputs(T s) {
    cout << s << "\n";
    exit(0);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *)array, (T *)(array + N), val);
}
template <typename T> using PQG = priority_queue<T, vector<T>, greater<T>>;
template <typename T> using PQ = priority_queue<T>;

typedef long long ll;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<ll, ll> PL;

const int INF = 1e9;
const int MOD = 1e9 + 7;
const double PI = atan(1.0) * 4.0;
// const int MOD = 998244353;
const ll LINF = 1e18;
const ll dx[] = {1, 0, -1, 0};
const ll dy[] = {0, 1, 0, -1};

void cinfast() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

/* 基本要素 */

typedef double D;     // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P; // Point
typedef pair<P, P> L; // Line
typedef vector<P> VP;
const D EPS = 1e-9; // 許容誤差。問題によって変える;

#define X real()
#define Y imag()
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define EQ(n, m) (abs((n) - (m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) { return (conj(a) * b).X; }
// 外積　cross(a,b) = |a||b|sinθ
D cross(P a, P b) { return (conj(a) * b).Y; }

// 点の進行方向
int ccw(P a, P b, P c) {
    b -= a;
    c -= a;
    if(cross(b, c) > EPS) return +1;  // counter clockwise
    if(cross(b, c) < -EPS) return -1; // clockwise
    if(dot(b, c) < -EPS) return +2;   // c--a--b on line
    if(norm(b) < norm(c)) return -2;  // a--b--c on line or a==b
    return 0;                         // a--c--b on line or a==c or b==c
}

/* 交差判定　直線・線分は縮退してはならない。接する場合は交差するとみなす。isecはintersectの略
 */

// 直線と点
bool isecLP(P a1, P a2, P b) {
    return abs(ccw(a1, a2, b)) != 1; // return EQ(cross(a2-a1, b-a1), 0); と等価
}

// 直線と直線
bool isecLL(P a1, P a2, P b1, P b2) {
    return !isecLP(a2 - a1, b2 - b1, 0) || isecLP(a1, b1, b2);
}

// 直線と線分
bool isecLS(P a1, P a2, P b1, P b2) {
    return cross(a2 - a1, b1 - a1) * cross(a2 - a1, b2 - a1) < EPS;
}

// 線分と線分
bool isecSS(P a1, P a2, P b1, P b2) {
    return ccw(a1, a2, b1) * ccw(a1, a2, b2) <= 0 &&
           ccw(b1, b2, a1) * ccw(b1, b2, a2) <= 0;
}

// 線分と点
bool isecSP(P a1, P a2, P b) { return !ccw(a1, a2, b); }

/* 距離　各直線・線分は縮退してはならない */

// 点pの直線aへの射影点を返す
P proj(P a1, P a2, P p) {
    if(a1 == a2) eputs("same points");
    return a1 + dot(a2 - a1, p - a1) / norm(a2 - a1) * (a2 - a1);
}

// 点pの直線aへの反射点を返す
P reflection(P a1, P a2, P p) { return 2.0 * proj(a1, a2, p) - p; }

D distLP(P a1, P a2, P p) { return abs(proj(a1, a2, p) - p); }

D distLL(P a1, P a2, P b1, P b2) {
    return isecLL(a1, a2, b1, b2) ? 0 : distLP(a1, a2, b1);
}

D distLS(P a1, P a2, P b1, P b2) {
    return isecLS(a1, a2, b1, b2) ? 0
                                  : min(distLP(a1, a2, b1), distLP(a1, a2, b2));
}

D distSP(P a1, P a2, P p) {
    P r = proj(a1, a2, p);
    if(isecSP(a1, a2, r)) return abs(r - p);
    return min(abs(a1 - p), abs(a2 - p));
}

D distSS(P a1, P a2, P b1, P b2) {
    if(isecSS(a1, a2, b1, b2)) return 0;
    return min(min(distSP(a1, a2, b1), distSP(a1, a2, b2)),
               min(distSP(b1, b2, a1), distSP(b1, b2, a2)));
}

// 2直線の交点
P crosspointLL(P a1, P a2, P b1, P b2) {
    D d1 = cross(b2 - b1, b1 - a1);
    D d2 = cross(b2 - b1, a2 - a1);
    if(EQ(d1, 0) && EQ(d2, 0)) return a1; // same line
    if(EQ(d2, 0)) throw "kouten ga nai";  // 交点がない
    return a1 + d1 / d2 * (a2 - a1);
}

/* 円 */

D distLC(P a1, P a2, P c, D r) { return max(distLP(a1, a2, c) - r, 0.0); }

D distSC(P a1, P a2, P c, D r) {
    D dSqr1 = norm(c - a1), dSqr2 = norm(c - a2);
    if(dSqr1 < r * r ^ dSqr2 < r * r)
        return 0; // 円が線分を包含するとき距離0ならここをORに変える
    if(dSqr1 < r * r & dSqr2 < r * r) return r - sqrt(max(dSqr1, dSqr2));
    return max(distSP(a1, a2, c) - r, 0.0);
}

VP crosspointLC(P a1, P a2, P c, D r) {
    VP ps;
    P ft = proj(a1, a2, c);
    if(!GE(r * r, norm(ft - c))) return ps;

    P dir = sqrt(max(r * r - norm(ft - c), 0.0)) / abs(a2 - a1) * (a2 - a1);
    ps.push_back(ft + dir);
    if(!EQ(r * r, norm(ft - c))) ps.push_back(ft - dir);
    return ps;
}

D distCC(P a, D ar, P b, D br) {
    D d = abs(a - b);
    return GE(d, abs(ar - br)) ? max(d - ar - br, 0.0) : abs(ar - br) - d;
}

// 2円の交点
VP crosspointCC(P a, D ar, P b, D br) {
    VP ps;
    P ab = b - a;
    D d = abs(ab);
    D crL = (norm(ab) + ar * ar - br * br) / (2 * d);
    if(EQ(d, 0) || ar < abs(crL)) return ps;

    P abN = ab * P(0, sqrt(ar * ar - crL * crL) / d);
    P cp = a + crL / d * ab;
    ps.push_back(cp + abN);
    if(!EQ(norm(abN), 0)) ps.push_back(cp - abN);
    return ps;
}

// 点pから円aへの接線の接点
VP tangentPoints(P a, D ar, P p) {
    VP ps;
    D sin = ar / abs(p - a);
    if(!LE(sin, 1)) return ps; // ここでNaNも弾かれる
    D t = 2 * PI - asin(min(sin, 1.0));
    ps.push_back(a + (p - a) * polar(sin, t));
    if(!EQ(sin, 1)) ps.push_back(a + (p - a) * polar(sin, -t));
    return ps;
}

// 2円の共通接線。返される各直線に含まれる頂点は円との接点となる
vector<L> tangentLines(P a, D ar, P b, D br) {
    vector<L> ls;
    D d = abs(b - a);
    REP(i, 2) {
        D sin = (ar - (1 - i * 2) * br) / d;
        if(!LE(sin * sin, 1)) break;
        D cos = sqrt(max(1 - sin * sin, 0.0));
        REP(j, 2) {
            P n = (b - a) * P(sin, (1 - j * 2) * cos) / d;
            ls.push_back(L(a + ar * n, b + (1 - i * 2) * br * n));
            if(cos < EPS)
                break; // 重複する接線を無視（重複していいならこの行不要）
        }
    }
    return ls;
}

// 三角形の外心。点a,b,cは同一線上にあってはならない
P circumcenter(P a, P b, P c) {
    a = (a - c) * 0.5;
    b = (b - c) * 0.5;
    return c + crosspointLL(a, a * P(1, 1), b, b * P(1, 1));
}

// 点aと点bを通り、半径がrの円の中心を返す
VP circlesPointsRadius(P a, P b, D r) {
    VP cs;
    P abH = (b - a) * 0.5;
    D d = abs(abH);
    if(d == 0 || d > r)
        return cs; // 必要なら !LE(d,r) として円1つになる側へ丸める
    D dN = sqrt(r * r - d * d); // 必要なら max(r*r - d*d, 0) とする
    P n = abH * P(0, 1) * (dN / d);
    cs.push_back(a + abH + n);
    if(dN > 0) cs.push_back(a + abH - n);
    return cs;
}

// 点aと点bを通り、直線lに接する円の中心
VP circlesPointsTangent(P a, P b, P l1, P l2) {
    P n = (l2 - l1) * P(0, 1);
    P m = (b - a) * P(0, 0.5);
    D rC = dot((a + b) * 0.5 - l1, n);
    D qa = norm(n) * norm(m) - dot(n, m) * dot(n, m);
    D qb = -rC * dot(n, m);
    D qc = norm(n) * norm(m) - rC * rC;
    D qd = qb * qb - qa * qc; // qa*k^2 + 2*qb*k + qc = 0

    VP cs;
    if(qd < -EPS) return cs;
    if(EQ(qa, 0)) {
        if(!EQ(qb, 0)) cs.push_back((a + b) * 0.5 - m * (qc / qb / 2));
        return cs;
    }
    D t = -qb / qa;
    cs.push_back((a + b) * 0.5 + m * (t + sqrt(max(qd, 0.0)) / qa));
    if(qd > EPS)
        cs.push_back((a + b) * 0.5 + m * (t - sqrt(max(qd, 0.0)) / qa));
    return cs;
}

// 点集合を含む最小の円の中心
P minEnclosingCircle(const VP &ps) {
    P c;
    double move = 0.5;
    REP(i, 39) { // 2^(-39-1) \approx 0.9e-12
        REP(t, 50) {
            D max = 0;
            int k = 0;
            REP(j, ps.size()) if(max < norm(ps[j] - c)) {
                max = norm(ps[j] - c);
                k = j;
            }
            c += (ps[k] - c) * move;
        }
        move /= 2;
    }
    return c;
}

/* 多角形 */

// 頂点の順序（sortやmax_elementに必要）
namespace std {
bool operator<(const P a, const P b) {
    return a.X != b.X ? a.X < b.X : a.Y < b.Y;
}
} // namespace std

// 凸包
VP convexHull(VP ps) { // 元の点集合がソートされていいならVP&に
    int n = ps.size(), k = 0;
    sort(ps.begin(), ps.end());
    VP ch(2 * n);
    for(int i = 0; i < n; ch[k++] = ps[i++]) // lower-hull
        while(k >= 2 && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0)
            --k; // 余計な点も含むなら == -1 とする
    for(int i = n - 2, t = k + 1; i >= 0; ch[k++] = ps[i--]) // upper-hull
        while(k >= t && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
    ch.resize(k - 1);
    return ch;
}

// 凸判定。縮退を認めないならccwの判定部分を != 1 とする
bool isCcwConvex(const VP &ps) {
    int n = ps.size();
    REP(i, n)
    if(ccw(ps[i], ps[(i + 1) % n], ps[(i + 2) % n]) == -1) return false;
    return true;
}

// 凸多角形の内部判定　O(n)
// 点が領域内部なら1、境界上なら2、外部なら0を返す
int inConvex(P p, const VP &ps) {
    int n = ps.size();
    int dir = ccw(ps[0], ps[1], p);
    REP(i, n) {
        int ccwc = ccw(ps[i], ps[(i + 1) % n], p);
        if(!ccwc) return 2; // 線分上に存在
        if(ccwc != dir) return 0;
    }
    return 1;
}

// 凸多角形の内部判定　O(logn)
// 点が領域内部なら1、境界上なら2、外部なら0を返す
int inCcwConvex(const VP &ps, P p) {
    int n = ps.size();
    P g = (ps[0] + ps[n / 3] + ps[n * 2 / 3]) / 3.0;
    if(g == p) return 1;
    P gp = p - g;

    int l = 0, r = n;
    while(l + 1 < r) {
        int mid = (l + r) / 2;
        P gl = ps[l] - g;
        P gm = ps[mid] - g;
        if(cross(gl, gm) > 0) {
            if(cross(gl, gp) >= 0 && cross(gm, gp) <= 0)
                r = mid;
            else
                l = mid;
        } else {
            if(cross(gl, gp) <= 0 && cross(gm, gp) >= 0)
                l = mid;
            else
                r = mid;
        }
    }
    r %= n;
    D cr = cross(ps[l] - p, ps[r] - p);
    return EQ(cr, 0) ? 2 : cr < 0 ? 0 : 1;
}

// 多角形の内部判定
// 点が領域内部なら1、境界上なら2、外部なら0を返す
int inPolygon(const VP &ps, P p) {
    int n = ps.size();
    bool in = false;
    REP(i, n) {
        P a = ps[i] - p;
        P b = ps[(i + 1) % n] - p;
        if(EQ(cross(a, b), 0) && LE(dot(a, b), 0)) return 2;
        if(a.Y > b.Y) swap(a, b);
        if((a.Y * b.Y < 0 || (a.Y * b.Y < EPS && b.Y > EPS)) &&
           LE(cross(a, b), 0))
            in = !in;
    }
    return in;
}

// 凸多角形クリッピング
VP convexCut(const VP &ps, P a1, P a2) {
    int n = ps.size();
    VP ret;
    REP(i, n) {
        int ccwc = ccw(a1, a2, ps[i]);
        if(ccwc != -1) ret.push_back(ps[i]);
        int ccwn = ccw(a1, a2, ps[(i + 1) % n]);
        if(ccwc * ccwn == -1)
            ret.push_back(crosspointLL(a1, a2, ps[i], ps[(i + 1) % n]));
    }
    return ret;
}

// 凸多角形の直径（最遠点対）
pair<int, int> convexDiameter(const VP &ps) {
    int n = ps.size();
    int i = min_element(ps.begin(), ps.end()) - ps.begin();
    int j = max_element(ps.begin(), ps.end()) - ps.begin();
    int maxI, maxJ;
    D maxD = 0;
    REP(_, 2 * n) {
        if(maxD < norm(ps[i] - ps[j])) {
            maxD = norm(ps[i] - ps[j]);
            maxI = i;
            maxJ = j;
        }
        if(cross(ps[i] - ps[(i + 1) % n], ps[(j + 1) % n] - ps[j]) <= 0)
            j = (j + 1) % n;
        else
            i = (i + 1) % n;
    }
    return make_pair(maxI, maxJ);
}

// 多角形の符号付面積
D area(const VP &ps) {
    D a = 0;
    REP(i, ps.size()) a += cross(ps[i], ps[(i + 1) % ps.size()]);
    return a / 2;
}

// 多角形の幾何学的重心
P centroid(const VP &ps) {
    int n = ps.size();
    D aSum = 0;
    P c;
    REP(i, n) {
        D a = cross(ps[i], ps[(i + 1) % n]);
        aSum += a;
        c += (ps[i] + ps[(i + 1) % n]) * a;
    }
    return 1 / aSum / 3 * c;
}

// ボロノイ領域
VP voronoiCell(P p, const VP &ps, const VP &outer) {
    VP cl = outer;
    REP(i, ps.size()) {
        if(EQ(norm(ps[i] - p), 0)) continue;
        P h = (p + ps[i]) * 0.5;
        cl = convexCut(cl, h, h + (ps[i] - h) * P(0, 1));
    }
    return cl;
}

/* 幾何グラフ */

struct Edge {
    int from, to;
    D cost;
    Edge(int from, int to, D cost) : from(from), to(to), cost(cost) {}
};
struct Graph {
    int n;
    vector<vector<Edge>> edges;
    Graph(int n) : n(n), edges(n) {}
    void addEdge(Edge e) {
        edges[e.from].push_back(e);
        edges[e.to].push_back(Edge(e.to, e.from, e.cost));
    }
};

// 線分アレンジメント（線分の位置関係からグラフを作成）
Graph segmentArrangement(const vector<L> &segs, VP &ps) {
    int n = segs.size();
    REP(i, n) {
        ps.push_back(segs[i].first);
        ps.push_back(segs[i].second);
        REP(j, i) {
            if(isecSS(segs[i].first, segs[i].second, segs[j].first,
                      segs[j].second))
                ps.push_back(crosspointLL(segs[i].first, segs[i].second,
                                          segs[j].first, segs[j].second));
        }
    }
    sort(ps.begin(), ps.end());
    ps.erase(unique(ps.begin(), ps.end()), ps.end());

    int m = ps.size();
    Graph gr(m);
    vector<pair<D, int>> list;
    REP(i, n) {
        list.clear();
        REP(j, m) {
            if(isecSP(segs[i].first, segs[i].second, ps[j]))
                list.push_back(make_pair(norm(segs[i].first - ps[j]), j));
        }
        sort(list.begin(), list.end());
        REP(j, list.size() - 1) {
            int a = list[j].second;
            int b = list[j + 1].second;
            gr.addEdge(Edge(a, b, abs(ps[a] - ps[b])));
        }
    }
    return gr;
}

// 可視グラフ（点集合から見える位置へ辺を張ったグラフ）
Graph visibilityGraph(const VP &ps, const vector<VP> &objs) {
    int n = ps.size();
    Graph gr(n);
    REP(i, n) REP(j, i) {
        P a = ps[i], b = ps[j];
        if(!EQ(norm(a - b), 0)) REP(k, objs.size()) {
                const VP &obj = objs[k];
                int inStA = inConvex(a, obj);
                int inStB = inConvex(b, obj);
                if((inStA ^ inStB) % 2 ||
                   inStA * inStB != 1 && inConvex((a + b) * 0.5, obj) == 1)
                    goto skip;
                REP(l, obj.size()) {
                    P cur = obj[l];
                    P next = obj[(l + 1) % obj.size()];
                    if(isecSS(a, b, cur, next) && !isecSP(cur, next, a) &&
                       !isecSP(cur, next, b))
                        goto skip;
                }
            }
        gr.addEdge(Edge(i, j, abs(a - b)));
    skip : {}
    }
    return gr;
}

/* その他 */

// 重複する線分を併合する
vector<L> mergeSegments(vector<L> segs) {
    int n = segs.size();
    REP(i, n)
    if(segs[i].second < segs[i].first) swap(segs[i].second, segs[i].first);

    REP(i, n) REP(j, i) {
        L &l1 = segs[i], &l2 = segs[j];
        if(EQ(cross(l1.second - l1.first, l2.second - l2.first), 0) &&
           isecLP(l1.first, l1.second, l2.first) &&
           ccw(l1.first, l1.second, l2.second) != 2 &&
           ccw(l2.first, l2.second, l1.second) != 2) {
            segs[j] = L(min(l1.first, l2.first), max(l1.second, l2.second));
            segs[i--] = segs[--n];
            break;
        }
    }
    segs.resize(n);
    return segs;
}

inline double pp2(P a) { return a.X * a.X + a.Y * a.Y; }
inline double p2(double a) { return a * a; }
double pow2(double a) { return a * a; }

signed main() {
    for(;;) {
        int n, m;
        cin >> n >> m;
        if(n == 0) return 0;

        vector<double> x(n), y(n), v(n);
        for(int i = 0; i < n; ++i) cin >> x[i] >> y[i] >> v[i];

        vector<int> num(n, 0);
        while(--m >= 0) {
            double fpx, fpy, fvx, fvy;
            cin >> fpx >> fpy >> fvx >> fvy;

            vector<double> vy(n, 0.0), vx(n, 0.0);
            double minT = DBL_MAX;
            int getDog;
            for(int i = 0; i < n; ++i) {
                double a = pow2(fvx) + pow2(fvy) - pow2(v[i]);
                double b = 2 * (fvx * (fpx - x[i]) + fvy * (fpy - y[i]));
                double c = pow2(fpx - x[i]) + pow2(fpy - y[i]);
                double d = pow2(b) - 4 * a * c;
                if(d >= 0.0) {
                    double t;
                    if(fabs(a) < EPS) {
                        t = -c / b;
                        if(t < 0.0) continue;
                    } else {
                        double tmp = (-b - sqrt(d)) / (2 * a);
                        if(tmp >= 0.0)
                            t = tmp;
                        else {
                            tmp = (-b + sqrt(d)) / (2 * a);
                            if(tmp >= 0.0)
                                t = tmp;
                            else
                                continue;
                        }
                    }
                    vx[i] = (fpx - x[i] + fvx * t) / t;
                    vy[i] = (fpy - y[i] + fvy * t) / t;
                    if(t < minT) {
                        minT = t;
                        getDog = i;
                    }
                }
            }

            ++num[getDog];
            for(int i = 0; i < n; ++i) {
                x[i] += vx[i] * minT;
                y[i] += vy[i] * minT;
            }
        }

        Printv(num)
    }
}
