#include <bits/stdc++.h>
using namespace std;
int k, n;
double X[4010], Y[4010];
double eps = 1e4, mx = 2e6;
double sqr(double x) { return x * x; }
double dis(int a, int b, int c, int d) { return sqrt(sqr(c - a) + sqr(d - b)); }
double avg1[10010], avg2[10010];
double getval(double x, double y) {
  vector<double> V(0);
  for (int s = 1; s <= k * n; s++) V.push_back(pow(dis(x, y, X[s], Y[s]), 2));
  sort(V.begin(), V.end());
  for (int i = 0; i < V.size(); i++) avg1[i] = V[i], avg2[i] = V[i] * V[i];
  for (int i = 1; i < V.size(); i++)
    avg1[i] += avg1[i - 1], avg2[i] += avg2[i - 1];
  double magic = 1e100;
  int n = ::n - 2;
  for (int i = n; i < V.size(); i++)
    magic = min(magic, avg2[i] - avg2[i - n] - sqr(avg1[i] - avg1[i - n]) / n);
  return magic;
}
double getr(double x, double y) {
  vector<double> V(0);
  for (int s = 1; s <= k * n; s++) V.push_back(dis(x, y, X[s], Y[s]));
  sort(V.begin(), V.end());
  for (int i = 0; i < V.size(); i++) avg1[i] = V[i], avg2[i] = V[i] * V[i];
  for (int i = 1; i < V.size(); i++)
    avg1[i] += avg1[i - 1], avg2[i] += avg2[i - 1];
  double magic = 1e100;
  int v;
  int n = ::n - 2;
  for (int i = n; i < V.size(); i++) {
    double s = avg2[i] - avg2[i - n] - sqr(avg1[i] - avg1[i - n]) / n;
    if (s < magic) magic = s, v = i;
  }
  return (avg1[v] - avg1[v - n]) / n;
}
double Ansx[200000], Ansy[1200000], qwq[200000];
int tmp[200000];
int cnt = 0;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
double rd() { return (double)rng() / pow(2, 63) - 1; }
bool cmp(int x, int y) { return qwq[x] < qwq[y]; }
int main() {
  scanf("%d%d", &k, &n);
  for (int i = 1; i <= k * n; i++) {
    scanf("%lf%lf", &X[i], &Y[i]);
  }
  for (int i = -100; i <= 100; i++)
    for (int j = -100; j <= 100; j++)
      if (dis(0, 0, i * 10000, j * 10000) <= 1e6)
        Ansx[++cnt] = i * 10000, Ansy[cnt] = j * 10000,
        qwq[cnt] = getval(i * 10000, j * 10000);
  for (int i = 1; i <= k; i++) {
    for (int i = 1; i <= cnt; i++) tmp[i] = i;
    sort(tmp + 1, tmp + cnt + 1, cmp);
    printf("%.12lf %.12lf %.12lf\n", Ansx[tmp[1]], Ansy[tmp[1]],
           getr(Ansx[tmp[1]], Ansy[tmp[1]]));
    double x = Ansx[tmp[1]], y = Ansy[tmp[1]];
    for (int i = 1; i <= cnt; i++)
      if (dis(Ansx[i], Ansy[i], x, y) <= 4e5) qwq[i] = 1e100;
  }
  return 0;
}

### Prompt

Your challenge is to write a Cpp solution to the following problem:

The Cybermen have again outwitted the Daleks! Unfortunately, this time the Daleks decided to abandon these tasks altogether, which means the Doctor has to deal with them.

The Doctor can handle the Daleks on his own, but Heidi now has to make sure that the Cybermen are kept busy with this next task.

There are k rings on a plane. For each ring, n points are uniformly sampled with a small random noise. The task is to recover the rings given only the noisy samples.

The rings and the samples are generated as follows. The center of a ring is uniformly sampled from a disk of radius 1 000 000 centered at the origin, and the radius of the ring is uniformly sampled from [250 000, 750 000]. Let R be a ring with center (x, y) and radius r. To sample a point from R, an angle θ is uniformly sampled from [0, 2π] and a distance d is uniformly sampled from [0.9r, 1.1r]. The coordinates of the sampled point are then (x+dcos(θ), y+dsin(θ)) rounded to the closest integers.

The distance between rings is measured by their Hausdorff distance. In our case, the distance between two rings R_1, R_2 can be written as follow. Let d be the distance between the two centers and r_1, r_2 be the radii. Then the distance is $$$dist(R_1, R_2)=max(min(d_{--}, d_{-+}),min(d_{+-}, d_{++}), min(d_{--}, d_{+-}), min(d_{-+}, d_{++})), where d_{++}=|d+r_1+r_2|, d_{+-}=|d+r_1-r_2|, d_{-+}=|d-r_1+r_2|, d_{--}=|d-r_1-r_2|$$$.

We say that a ring R_0 is recovered if one of the rings R in the output has Hausdorff distance less than 100 000 from R_0. 

An output is accepted if all the rings are recovered. It is guaranteed that the distances between any two rings is greater than 600 000.

Remember that a human can very easily solve this task, so make sure that no human traitors are helping the Cybermen complete this task.

Input

The first line contains an integer k (1 ≤ k ≤ 4), the number of rings.

The second line contains an integer n (100 ≤ n ≤ 1 000), the number of samples per ring.

The following n × k lines contain the samples, one sample per line.

Each line contains a pair of integers x_i, y_i, where (x_i, y_i) are the coordinates of the i-th sample.

Output

Print k lines, each describing a single ring.

For each line, print three real numbers x_i, y_i, r_i, where (x_i, y_i) and r_i are the coordinates and the radius of the i-th ring.

The order of the rings does not matter.

Note

Here is how one of tests with k=4 and n=100 looks like. 

<image>

You can download the sample input and output [here](//assets.codeforces.com/rounds/1184/c1.zip).

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int k, n;
double X[4010], Y[4010];
double eps = 1e4, mx = 2e6;
double sqr(double x) { return x * x; }
double dis(int a, int b, int c, int d) { return sqrt(sqr(c - a) + sqr(d - b)); }
double avg1[10010], avg2[10010];
double getval(double x, double y) {
  vector<double> V(0);
  for (int s = 1; s <= k * n; s++) V.push_back(pow(dis(x, y, X[s], Y[s]), 2));
  sort(V.begin(), V.end());
  for (int i = 0; i < V.size(); i++) avg1[i] = V[i], avg2[i] = V[i] * V[i];
  for (int i = 1; i < V.size(); i++)
    avg1[i] += avg1[i - 1], avg2[i] += avg2[i - 1];
  double magic = 1e100;
  int n = ::n - 2;
  for (int i = n; i < V.size(); i++)
    magic = min(magic, avg2[i] - avg2[i - n] - sqr(avg1[i] - avg1[i - n]) / n);
  return magic;
}
double getr(double x, double y) {
  vector<double> V(0);
  for (int s = 1; s <= k * n; s++) V.push_back(dis(x, y, X[s], Y[s]));
  sort(V.begin(), V.end());
  for (int i = 0; i < V.size(); i++) avg1[i] = V[i], avg2[i] = V[i] * V[i];
  for (int i = 1; i < V.size(); i++)
    avg1[i] += avg1[i - 1], avg2[i] += avg2[i - 1];
  double magic = 1e100;
  int v;
  int n = ::n - 2;
  for (int i = n; i < V.size(); i++) {
    double s = avg2[i] - avg2[i - n] - sqr(avg1[i] - avg1[i - n]) / n;
    if (s < magic) magic = s, v = i;
  }
  return (avg1[v] - avg1[v - n]) / n;
}
double Ansx[200000], Ansy[1200000], qwq[200000];
int tmp[200000];
int cnt = 0;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
double rd() { return (double)rng() / pow(2, 63) - 1; }
bool cmp(int x, int y) { return qwq[x] < qwq[y]; }
int main() {
  scanf("%d%d", &k, &n);
  for (int i = 1; i <= k * n; i++) {
    scanf("%lf%lf", &X[i], &Y[i]);
  }
  for (int i = -100; i <= 100; i++)
    for (int j = -100; j <= 100; j++)
      if (dis(0, 0, i * 10000, j * 10000) <= 1e6)
        Ansx[++cnt] = i * 10000, Ansy[cnt] = j * 10000,
        qwq[cnt] = getval(i * 10000, j * 10000);
  for (int i = 1; i <= k; i++) {
    for (int i = 1; i <= cnt; i++) tmp[i] = i;
    sort(tmp + 1, tmp + cnt + 1, cmp);
    printf("%.12lf %.12lf %.12lf\n", Ansx[tmp[1]], Ansy[tmp[1]],
           getr(Ansx[tmp[1]], Ansy[tmp[1]]));
    double x = Ansx[tmp[1]], y = Ansy[tmp[1]];
    for (int i = 1; i <= cnt; i++)
      if (dis(Ansx[i], Ansy[i], x, y) <= 4e5) qwq[i] = 1e100;
  }
  return 0;
}

```