Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int main()
{
  int N, M; cin >> N >> M;
  double L[N], a[N], b[N]; FOR(i,0,N) cin >> L[i] >> a[i] >> b[i];
  double ans = 0;
  FOR(i,0,1<<N) {
    vector<double> v;
    FOR(j,0,N) {
      if((i>>j)&1) v.push_back(j);
    }
    if((int)v.size() == M) {
      double mx = 0;
      FOR(j,0,M) {
        FOR(k,j+1,M) {
          mx += (L[v[k]] - L[v[j]]) * (L[v[k]] - L[v[j]]);
          mx += (a[v[k]] - a[v[j]]) * (a[v[k]] - a[v[j]]);
          mx += (b[v[k]] - b[v[j]]) * (b[v[k]] - b[v[j]]);
        }
      }
      ans = max(ans, mx);
    }
  }
  printf("%.10lf\n", ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   34 |           mx += (L[v[k]] - L[v[j]]) * (L[v[k]] - L[v[j]]);
      |                   ^
a.cc:34:29: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   34 |           mx += (L[v[k]] - L[v[j]]) * (L[v[k]] - L[v[j]]);
      |                             ^
a.cc:34:41: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   34 |           mx += (L[v[k]] - L[v[j]]) * (L[v[k]] - L[v[j]]);
      |                                         ^
a.cc:34:51: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   34 |           mx += (L[v[k]] - L[v[j]]) * (L[v[k]] - L[v[j]]);
      |                                                   ^
a.cc:35:19: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   35 |           mx += (a[v[k]] - a[v[j]]) * (a[v[k]] - a[v[j]]);
      |                   ^
a.cc:35:29: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   35 |           mx += (a[v[k]] - a[v[j]]) * (a[v[k]] - a[v[j]]);
      |                             ^
a.cc:35:41: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   35 |           mx += (a[v[k]] - a[v[j]]) * (a[v[k]] - a[v[j]]);
      |                                         ^
a.cc:35:51: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   35 |           mx += (a[v[k]] - a[v[j]]) * (a[v[k]] - a[v[j]]);
      |                                                   ^
a.cc:36:19: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   36 |           mx += (b[v[k]] - b[v[j]]) * (b[v[k]] - b[v[j]]);
      |                   ^
a.cc:36:29: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   36 |           mx += (b[v[k]] - b[v[j]]) * (b[v[k]] - b[v[j]]);
      |                             ^
a.cc:36:41: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   36 |           mx += (b[v[k]] - b[v[j]]) * (b[v[k]] - b[v[j]]);
      |                                         ^
a.cc:36:51: error: invalid types 'double [N][__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}]' for array subscript
   36 |           mx += (b[v[k]] - b[v[j]]) * (b[v[k]] - b[v[j]]);
      |                                                   ^