Language: C++

#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;
 
int main(){
  int n, k;
  cin>>n>>k;
  double x[n], y[n], c[n];
  REP(i, n){
    cin>>x[i]>>y[i]>>c[i];
  }
  double ans = 1010010;
  for(double X = -1000; X<=1000; x+= 1){
    for(double Y = -1000; Y<=1000; Y+= 1){
      vector<double> t(n);
      REP(i, n){
        t[i] = c[i] * hypot(X - x[i], Y - y[i]);
      }
      sort(ALL(t));
      ans = min(ans, t[k-1]);
    }
  }
  cout<<fixed<<setprecision(7)<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   71 |   cin>>n>>k;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:77:35: error: incompatible types in assignment of 'int' to 'double [n]'
   77 |   for(double X = -1000; X<=1000; x+= 1){
      |                                  ~^~~~
a.cc:79:7: error: 'vector' was not declared in this scope
   79 |       vector<double> t(n);
      |       ^~~~~~
a.cc:79:7: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:79:14: error: expected primary-expression before 'double'
   79 |       vector<double> t(n);
      |              ^~~~~~
a.cc:81:9: error: 't' was not declared in this scope
   81 |         t[i] = c[i] * hypot(X - x[i], Y - y[i]);
      |         ^
a.cc:83:16: error: 't' was not declared in this scope
   83 |       sort(ALL(t));
      |                ^
a.cc:8:19: note: in definition of macro 'ALL'
    8 | #define ALL(obj) (obj).begin(), (obj).end()
      |                   ^~~
a.cc:83:7: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   83 |       sort(ALL(t));
      |       ^~~~
      |       std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:84:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   84 |       ans = min(ans, t[k-1]);
      |             ^~~
      |             std::min
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:87:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   87 |   cout<<fixed<<setprecision(7)<<ans<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:87:9: error: 'fixed' was not declared in this scope
   87 |   cout<<fixed<<setprecision(7)<<ans<<endl;
      |         ^~~~~
a.cc:87:9: note: suggested alternatives:
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/ios_base.h:1104:3: note:   'std::fixed'
 1104 |   fixed(ios_base& __base)
      |   ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:198:
/usr/include/c++/14/charconv:622:21: note:   'std::chars_format::fixed'
  622 |     scientific = 1, fixed = 2, hex = 4, general = fixed | scientific
      |                     ^~~~~
a.cc:87:16: error: 'setprecision' was not declared in this scope; did you mean 'std::setprecision'?
   87 |   cout<<fixed<<setprecision(7)<<ans<<endl;
      |                ^~~~~~~~~~~~
      |                std::setprecision
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:202:3: note: 'std::setprecision' declared here
  202 |   setprecision(int __n)
      |   ^~~~~~~~~~~~
a.cc:87:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   87 |   cout<<fixed<<setprecision(7)<<ans<<endl;
      |                                      ^~~~
      |                                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~