Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

using vp = vector<point>;
using ld = long double;

struct point {
    ld x, y, c;
};

const int M = 40;
const ld EPS = 1e-12;

ld dis(point a, point b) {
    ld dx = a.x - b.x;
    ld dy = a.y - b.y;
    return sqrt(dx * dx + dy * dy);
}

vp cyc_intersec(point a, point b) {
    ld d = dis(a, b);
    if (d > a.c + b.c + EPS || d < abs(a.c - b.c) - EPS) {
        return {};
    }

    ld p = acos(max(0.0, min(1.0, (a.c * a.c + d * d - b.c * b.c) / (2 * a.c * d))));
    ld t = atan2(b.y - a.y, b.x - a.x);

    point p1, p2;
    p1.x = a.x + a.c * cos(t + p);
    p1.y = a.y + a.c * sin(t + p);
    p2.x = a.x + a.c * cos(t - p);
    p2.y = a.y + a.c * sin(t - p);

    return {p1, p2};
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n, k;
    cin >> n >> k;
    vp p(n);
    for (int i = 0; i < n; i++) {
        cin >> p.at(i).x >> p.at(i).y >> p.at(i).c;
    }

    if (k == 1) {
        cout << 0 << endl;
        return 0;
    }

    ld l = 0, r = 2e5;
    for (int q = 0; q < M; q++) {
        ld mid = (l + r) / 2;

        vp cyc(n);
        for (int i = 0; i < n; i++) {
            cyc.at(i).x = p.at(i).x;
            cyc.at(i).y = p.at(i).y;
            cyc.at(i).c = mid / p.at(i).c;
        }

        bool f = false;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                vp t = cyc_intersec(cyc.at(i), cyc.at(j));
                for (point x : t) {
                    int cur = 0;
                    for (int y = 0; y < n; y++) {
                        if (dis(x, cyc.at(y)) < cyc.at(y).c + EPS) {
                            cur++;
                        }
                    }

                    if (cur >= k) {
                        f = true;
                    }
                }
            }
        }

        if (f) {
            r = mid;
        } else {
            l = mid;
        }
    }

    cout << fixed << setprecision(7) << r << endl;

    return 0;
}


Compiler output:
a.cc:8:19: error: 'point' was not declared in this scope
    8 | using vp = vector<point>;
      |                   ^~~~~
a.cc:8:24: error: template argument 1 is invalid
    8 | using vp = vector<point>;
      |                        ^
a.cc:8:24: error: template argument 2 is invalid
a.cc:24:1: error: 'vp' does not name a type
   24 | vp cyc_intersec(point a, point b) {
      | ^~
a.cc: In function 'int main()':
a.cc:48:5: error: 'vp' was not declared in this scope
   48 |     vp p(n);
      |     ^~
a.cc:50:16: error: 'p' was not declared in this scope
   50 |         cin >> p.at(i).x >> p.at(i).y >> p.at(i).c;
      |                ^
a.cc:62:11: error: expected ';' before 'cyc'
   62 |         vp cyc(n);
      |           ^~~~
      |           ;
a.cc:64:13: error: 'cyc' was not declared in this scope
   64 |             cyc.at(i).x = p.at(i).x;
      |             ^~~
a.cc:64:27: error: 'p' was not declared in this scope
   64 |             cyc.at(i).x = p.at(i).x;
      |                           ^
a.cc:72:19: error: expected ';' before 't'
   72 |                 vp t = cyc_intersec(cyc.at(i), cyc.at(j));
      |                   ^~
      |                   ;
a.cc:73:32: error: 't' was not declared in this scope
   73 |                 for (point x : t) {
      |                                ^
a.cc:76:36: error: 'cyc' was not declared in this scope
   76 |                         if (dis(x, cyc.at(y)) < cyc.at(y).c + EPS) {
      |                                    ^~~