Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define IFOR(i,a,b) for(int i=(b-1);i>=(a);--i)
#define RPT(i,a,b) for(int i=(a);i<((a)+(b));++i)
#define IRPT(i,a,b) for(int i=((a)+(b)-1);i>=(a);--i)
#define LBIT(x,a) (((x)>>(a))&1LL)
#define IBIT(x,a) (((x)>>(a))&1)
#define BCOUNT(x) (__builtin_popcount(x))
int debug = 0;


namespace qweqwe {
  using i32 = int;
  using i64 = long long int;
  using ui32 = unsigned int;
  using ui64 = unsigned long long int;
  using d32 = float;
  using d64 = double;
  using d128 = long double;
  namespace constnumber{//ver 1.1
    constexpr qweqwe::i32  INF_i32 = ((qweqwe::i32)1)<<29;
    constexpr qweqwe::i64  INF_i64 = ((qweqwe::i64)1)<<60;
    constexpr qweqwe::d64  PI_d64 = 3.14159265358979323846264338327950288;
    constexpr qweqwe::d128 PI_d128 = 3.14159265358979323846264338327950288;
    constexpr qweqwe::d64  LN2_d64 = 0.693147180559945309417232121458;
    constexpr qweqwe::d128 LN2_d128 = 0.693147180559945309417232121458;
    constexpr qweqwe::d64  LN10_d64  = 2.302585092994045684017991454684;
    constexpr qweqwe::d128 LN10_d128 = 2.302585092994045684017991454684;
    constexpr qweqwe::d64  GOLDRATIO_d64  = 1.61803398874989484820458683436563811;
    constexpr qweqwe::d128 GOLDRATIO_d128 = 1.61803398874989484820458683436563811;
    constexpr qweqwe::d64  SILVERRATIO_d64  = 2.414213562373095048801688724210;
    constexpr qweqwe::d128 SILVERRATIO_d128 = 2.414213562373095048801688724210;
    constexpr qweqwe::d64  E_d64  = 2.71828182845904523536028747135266249;
    constexpr qweqwe::d128 E_d128 = 2.71828182845904523536028747135266249;
    constexpr qweqwe::d64  OMEGA_d64  = 0.5671432904097838729999686622;
    constexpr qweqwe::d128 OMEGA_d128 = 0.5671432904097838729999686622;
    constexpr qweqwe::d128 EPS = 1e-10;
  }
  namespace stdplus{//ver 1.3
    namespace iosplus{
      inline void iosFast(){
        std::cin.tie(0);
        std::ios::sync_with_stdio(false);
      }
      inline void iosDouble(i32 N){
        std::cout << std::fixed << std::setprecision(N);
      }
      template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
      template<typename T1, typename T2> std::istream &operator>>(std::istream &is, std::pair<T1,T2> &p){is >> p.first >> p.second; return is; }
      template<typename T> std::ostream &operator<<(std::ostream &os, const std::vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
      template<typename T> std::ostream &operator<<(std::ostream &os, const std::deque<T> &vec){ os << "deque["; for (auto v : vec) os << v << ","; os << "]"; return os; }
      template<typename T> std::ostream &operator<<(std::ostream &os, const std::set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
      template<typename T> std::ostream &operator<<(std::ostream &os, const std::unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
      template<typename T> std::ostream &operator<<(std::ostream &os, const std::multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
      template<typename T> std::ostream &operator<<(std::ostream &os, const std::unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
      template<typename T1, typename T2> std::ostream &operator<<(std::ostream &os, const std::pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
      template<typename TK, typename TV> std::ostream &operator<<(std::ostream &os, const std::map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
      template<typename TK, typename TV> std::ostream &operator<<(std::ostream &os, const std::unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
    }
    namespace math{
      template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
      template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }
      template<typename T1, typename T2> std::pair<T1, T2> operator+(const std::pair<T1, T2> &l, const std::pair<T1, T2> &r) { return std::make_pair(l.first + r.first, l.second + r.second); }
      template<typename T1, typename T2> std::pair<T1, T2> operator-(const std::pair<T1, T2> &l, const std::pair<T1, T2> &r) { return std::make_pair(l.first - r.first, l.second - r.second); }
      inline i64 Bit_i64(i64 x,i32 a){return (((x)>>(a))&((i64)1));}
      inline i32 Bit_i32(i32 x,i32 a){return (((x)>>(a))&((i64)1));}
    }
  }
}


using ld = long double;
using P = pair<int,int>;
template <class T> using V = std::vector<T>;
constexpr ld eps = qweqwe::constnumber::EPS;

void solve(){
  using namespace qweqwe::stdplus::iosplus;
  qweqwe::stdplus::iosplus::iosDouble(20);
  int n, k;
  cin >> n >> k;
  if(k==1) {cout << "0" << endl; return 0;}
  V<P> xy(n); V<int> c(n);
  FOR(i,0,n) cin >> xy[i] >> c[i];
  auto time = [&](ld x, ld y){
    ld tl=0, tr=284000, tm;
    while(tr-tl>eps){
      tm = (tl+tr)/2;
      int cnt=0;
      FOR(i,0,n){
        ld tt = 0;
        tt = c[i]*sqrt( (x-xy[i].first)*(x-xy[i].first) + (y-xy[i].second)*(y-xy[i].second) );
        if(tm-tt>=0) ++cnt;
      }
      if(cnt>=k) tr = tm;
      else tl = tm;
    }
    return (tl+tr)/2;
  };
  ld xl = -1020, xr = 1020, xml, xmr, ans=300000;
  while(xr-xl>eps){
    xml = (2*xl+xr)/3; xmr = (xl+2*xr)/3;
    auto f = [&](ld x){
      ld yl = -1020, yr = 1020, yml, ymr;
      while(yr-yl>eps){
        yml = (2*yl+yr)/3; ymr = (yl+2*yr)/3;
        ld tml = time(x, yml), tmr=time(x,ymr);
        if(tml>tmr){
          yl = yml;
        }else{
          yr = ymr;
        }
      }
      return (yr+yl)/2;
    };
    ld yml = f(xml), ymr=f(xmr);
    ld tml = time(xml,yml), tmr= time(xmr,ymr);
    if(tml>tmr) {
      xl = xml;
      ans = tml;
    }
    else {
      xr = xmr;
      ans = tmr;
    }
  }
  cout << ans << endl;
}

int main(){
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:88:41: error: return-statement with a value, in function returning 'void' [-fpermissive]
   88 |   if(k==1) {cout << "0" << endl; return 0;}
      |                                         ^