Language: C++

/* Author : Aaryan Srivastava ^__^ */ 
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define pb push_back
#define mp make_pair
#define ff first
#define ss second   
#define rep(i,n) for(int i = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define setval(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define trav(x , a) for(auto &x : a)
#define sz(a) ((int)a.size())
typedef long long ll ; 

#define int ll

using namespace std;

const int N = 3e5 +5 ;
const int mod = 1e9 + 7 ;
const ll inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace __gnu_pbds;
using ordered_set =  tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ;

typedef pair<int, int> pii; 
typedef pair<int , pii> ipii ;
typedef pair<pii , int> piii ; 
typedef unsigned long long ull ;
typedef long double ld;

ll po(ll x,ll y,ll p = mod) {ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}

int n , k , x[100] , y[100], c[100];

struct Point{
    ld x, y;
    Point(ld X = 0 , ld Y = 0){
        x = X , y = Y ;
    }
    
};


ld dist(Point A, Point B){
    ld res = (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y);
    res = sqrt(res);
    return res;
}

struct Circle{
    Point centre;
    ld r ;
    
    Circle(Point p = Point() , ld rad = 0){
        centre = p , r = rad;
    }
    
    bool inside(Point p){
        return dist(p , centre) < r + eps;
    }
};


bool intersect(Circle& A , Circle& B){
    return (dist(A.centre , B.centre) + eps > A.r + B.r);
}


vector<Point> get_inter(Circle& A , Circle& B){
    if(!intersect(A, B)) return {} ;
    ld d = dist(A.centre, B.centre) , l = ( A.r * A.r - B.r * B.r + d * d) / 2. / d , h = sqrt(A.r * A.r - l * l);
    int sign[] = {1 , -1};
    vector<Point> v;
    rep(i , 2){
        int mul = sign[i];
        ld x = l / d * (B.centre.x - A.centre.x) + mul * h / d * (B.centre.y - A.centre.y) + A.centre.x ;
        ld y = l / d * (B.centre.y - A.centre.y) - mul * h / d * (B.centre.x - A.centre.x) + A.centre.y ;
        v.push_back(Point(x , y));
    }
    return v; 
}

bool chck(ld t){
    vector<Circle> cir(n);
    rep(i , n){
        ld rad = t * 1. / c[i];
        cir[i] = Circle(Point(x[i] , y[i]) , rad);
        //cout << x[i] << ' ' << y[i] << ' ' << rad << '\n';
    }
    rep(i , n) repA(j , i + 1 , n - 1){
        auto v = get_inter(cir[i] , cir[j]);
        trav(p , v){
            int cnt = 0 ;
            //cout << p.x << ' ' << p.y << '\n';
            rep(q , n){
                cnt += cir[q].inside(p);
            }
            if(cnt >= k) return true ;
        }
        cout << '\n';
    }
    return false; 
}


void solve()
{
    cin >> n >> k ;
    rep(i , n) cin >> x[i] >> y[i] >> c[i] ;
    ld l = 0, r = 1 ;
    rep(_ , 100){
        ld m = l + (r - l) / 2. ;
        if(chck(m))
            l = m;
        else
            r = m;
    }
    cout << m << '\n';
    
}   

     
int32_t main(int32_t argc, char *argv[])
{
    ios::sync_with_stdio(0);    
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
//    cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case #" << t << ": " ;
        solve();
        //cout << "\n" ;
    }
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:127:13: error: 'm' was not declared in this scope
  127 |     cout << m << '\n';
      |             ^