#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) {
    return cout << "(" << p.first << ", " << p.second << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
    cout << "{"; for (int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "}"; }
const ld EPS = 0.0000000000001;
const int TIMES = 1000;
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n, k; cin >> n >> k;
    vector<ld> x(n), y(n), c(n);
    map<pair<ll, ll>, int> cnt;
    cout << fixed << setprecision(100);
    for (int i = 0; i < n; i++) {
        ll xx, yy, cc; cin >> xx >> yy >> cc;
        x[i] = xx; y[i] = yy; c[i] = cc;
        cnt[make_pair(xx, yy)]++;
    }
    for (auto p: cnt) {
        if (p.second >= k) {
            cout << 0 << '\n';
            return 0;
        }
    }
    auto dist = [&](ld a, ld b, ld c, ld d) -> ld {
        return sqrt((a - c) * (a - c) + (b - d) * (b - d));
    };
    auto check = [&](ld xx, ld yy, ld t) -> bool {
        int res = 0;
        for (int i = 0; i < n; i++) {
            ld d = dist(xx, yy, x[i], y[i]);
            if (d * c[i] <= t + EPS) {
                res++;
            }
        }
        return res >= k;
    };
    ld lo = 0;
    ld hi = 1e6;
    for (int iter = 0; iter < TIMES; iter++) {
        ld mid = (lo + hi) / 2;
        ld t = mid;
        bool ok = false;
        for (int i = 0; i < n && !ok; i++) {
            for (int j = i + 1; j < n && !ok; j++) {
                ld ri = t / c[i];
                ld rj = t / c[j];
                ld d = dist(x[i], y[i], x[j], y[j]);
                ld ri2 = ri * ri;
                ld rj2 = rj * rj;
                ld d2 = d * d;
                ld sq = (2 * (ri2 + rj2) / d2 - (ri2 - rj2) * (ri2 - rj2) / (d2 * d2) - 1);;
                if (sq < 0) continue;
                sq = sqrt(sq);
                ld xx = (x[i] + x[j]) / 2;
                xx += (ri2 - rj2) / (2 * d2) * (x[j] - x[i]);
                ld yy = (y[i] + y[j]) / 2;
                yy += (ri2 - rj2) / (2 * d2) * (y[j] - y[i]);
                ld xa = sq / 2 * (y[j] - y[i]);
                ld ya = sq / 2 * (x[i] - x[j]);
                ok |= check(xx + xa, yy + ya, t);
                ok |= check(xx - xa, yy - ya, t);
            }
        }
        for (int i = 0; i < n; i++) {
            ok |= check(x[i], y[i], t);
        }
        if (ok) hi = mid;
        else lo = mid;
    }
    cout << (lo + hi) / 2 << '\n';
    return 0;
}

### Prompt

Create a solution in CPP for the following problem:

Takahashi wants to grill N pieces of meat on a grilling net, which can be seen as a two-dimensional plane. The coordinates of the i-th piece of meat are \left(x_i, y_i\right), and its hardness is c_i.

Takahashi can use one heat source to grill the meat. If he puts the heat source at coordinates \left(X, Y\right), where X and Y are real numbers, the i-th piece of meat will be ready to eat in c_i \times \sqrt{\left(X - x_i\right)^2 + \left(Y-y_i\right)^2} seconds.

Takahashi wants to eat K pieces of meat. Find the time required to have K or more pieces of meat ready if he put the heat source to minimize this time.

Constraints

* All values in input are integers.
* 1 \leq N \leq 60
* 1 \leq K \leq N
* -1000 \leq x_i , y_i \leq 1000
* \left(x_i, y_i\right) \neq \left(x_j, y_j\right) \left(i \neq j \right)
* 1 \leq c_i \leq 100

Input

Input is given from Standard Input in the following format:


N K
x_1 y_1 c_1
\vdots
x_N y_N c_N


Output

Print the answer.

It will be considered correct if its absolute or relative error from our answer is at most 10^{-6}.

Examples

Input

4 3
-1 0 3
0 0 3
1 0 2
1 1 40


Output

2.4


Input

10 5
-879 981 26
890 -406 81
512 859 97
362 -955 25
128 553 17
-885 763 2
449 310 57
-656 -204 11
-270 76 40
184 170 16


Output

7411.2252

### Response

```cpp
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) {
    return cout << "(" << p.first << ", " << p.second << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
    cout << "{"; for (int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "}"; }
const ld EPS = 0.0000000000001;
const int TIMES = 1000;
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n, k; cin >> n >> k;
    vector<ld> x(n), y(n), c(n);
    map<pair<ll, ll>, int> cnt;
    cout << fixed << setprecision(100);
    for (int i = 0; i < n; i++) {
        ll xx, yy, cc; cin >> xx >> yy >> cc;
        x[i] = xx; y[i] = yy; c[i] = cc;
        cnt[make_pair(xx, yy)]++;
    }
    for (auto p: cnt) {
        if (p.second >= k) {
            cout << 0 << '\n';
            return 0;
        }
    }
    auto dist = [&](ld a, ld b, ld c, ld d) -> ld {
        return sqrt((a - c) * (a - c) + (b - d) * (b - d));
    };
    auto check = [&](ld xx, ld yy, ld t) -> bool {
        int res = 0;
        for (int i = 0; i < n; i++) {
            ld d = dist(xx, yy, x[i], y[i]);
            if (d * c[i] <= t + EPS) {
                res++;
            }
        }
        return res >= k;
    };
    ld lo = 0;
    ld hi = 1e6;
    for (int iter = 0; iter < TIMES; iter++) {
        ld mid = (lo + hi) / 2;
        ld t = mid;
        bool ok = false;
        for (int i = 0; i < n && !ok; i++) {
            for (int j = i + 1; j < n && !ok; j++) {
                ld ri = t / c[i];
                ld rj = t / c[j];
                ld d = dist(x[i], y[i], x[j], y[j]);
                ld ri2 = ri * ri;
                ld rj2 = rj * rj;
                ld d2 = d * d;
                ld sq = (2 * (ri2 + rj2) / d2 - (ri2 - rj2) * (ri2 - rj2) / (d2 * d2) - 1);;
                if (sq < 0) continue;
                sq = sqrt(sq);
                ld xx = (x[i] + x[j]) / 2;
                xx += (ri2 - rj2) / (2 * d2) * (x[j] - x[i]);
                ld yy = (y[i] + y[j]) / 2;
                yy += (ri2 - rj2) / (2 * d2) * (y[j] - y[i]);
                ld xa = sq / 2 * (y[j] - y[i]);
                ld ya = sq / 2 * (x[i] - x[j]);
                ok |= check(xx + xa, yy + ya, t);
                ok |= check(xx - xa, yy - ya, t);
            }
        }
        for (int i = 0; i < n; i++) {
            ok |= check(x[i], y[i], t);
        }
        if (ok) hi = mid;
        else lo = mid;
    }
    cout << (lo + hi) / 2 << '\n';
    return 0;
}

```