Language: C++

#include <iostream>
#include <vector>
#include <math.h>
#include <cstdio>

using namespace std;

#define N 20
#define DELTA 0.000001

typedef struct Lab{
	double L;
	double a;
	double b;
}Lab_t;

Lab_t cl[N];
double slct[N];
int n,m;
double mx;

void combi(int,int);

int main(int argc, char const *argv[])
{
	cin>>n>>m;
		
	for(int i1=0;i1<n;i1++){
		cin>>cl[i1].L>>cl[i1].a>>cl[i1].b;
	}
	mx=0.0;
	combi(0,0);
	printf("%lf\n",mx);
	return 0;
}

void combi(int s,int r)
{
	slct[r]=s;
	if(r==(m-1)) {
		double sum=0.0;
		for(int i1=0;i1<m-1;i1++){
			for(int i2=i1+1;i2<m;i2++){
				sum+=((cl[slct[i1]].L-cl[slct[i2]].L)*(cl[slct[i1]].L-cl[slct[i2]].L));
				sum+=((cl[slct[i1]].a-cl[slct[i2]].a)*(cl[slct[i1]].a-cl[slct[i2]].a));
				sum+=((cl[slct[i1]].b-cl[slct[i2]].b)*(cl[slct[i1]].b-cl[slct[i2]].b));
			}
		}
		if(sum>mx+DELTA) mx=sum;
	}
	else {
		for(int i1=s+1;i1<n;i1++){
			combi(i1,r+1);
		}
	}
}

Compiler output:
a.cc: In function 'void combi(int, int)':
a.cc:44:42: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   44 |                                 sum+=((cl[slct[i1]].L-cl[slct[i2]].L)*(cl[slct[i1]].L-cl[slct[i2]].L));
      |                                          ^
a.cc:44:57: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   44 |                                 sum+=((cl[slct[i1]].L-cl[slct[i2]].L)*(cl[slct[i1]].L-cl[slct[i2]].L));
      |                                                         ^
a.cc:44:74: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   44 |                                 sum+=((cl[slct[i1]].L-cl[slct[i2]].L)*(cl[slct[i1]].L-cl[slct[i2]].L));
      |                                                                          ^
a.cc:44:89: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   44 |                                 sum+=((cl[slct[i1]].L-cl[slct[i2]].L)*(cl[slct[i1]].L-cl[slct[i2]].L));
      |                                                                                         ^
a.cc:45:42: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   45 |                                 sum+=((cl[slct[i1]].a-cl[slct[i2]].a)*(cl[slct[i1]].a-cl[slct[i2]].a));
      |                                          ^
a.cc:45:57: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   45 |                                 sum+=((cl[slct[i1]].a-cl[slct[i2]].a)*(cl[slct[i1]].a-cl[slct[i2]].a));
      |                                                         ^
a.cc:45:74: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   45 |                                 sum+=((cl[slct[i1]].a-cl[slct[i2]].a)*(cl[slct[i1]].a-cl[slct[i2]].a));
      |                                                                          ^
a.cc:45:89: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   45 |                                 sum+=((cl[slct[i1]].a-cl[slct[i2]].a)*(cl[slct[i1]].a-cl[slct[i2]].a));
      |                                                                                         ^
a.cc:46:42: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   46 |                                 sum+=((cl[slct[i1]].b-cl[slct[i2]].b)*(cl[slct[i1]].b-cl[slct[i2]].b));
      |                                          ^
a.cc:46:57: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   46 |                                 sum+=((cl[slct[i1]].b-cl[slct[i2]].b)*(cl[slct[i1]].b-cl[slct[i2]].b));
      |                                                         ^
a.cc:46:74: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   46 |                                 sum+=((cl[slct[i1]].b-cl[slct[i2]].b)*(cl[slct[i1]].b-cl[slct[i2]].b));
      |                                                                          ^
a.cc:46:89: error: invalid types 'Lab_t [20] {aka Lab [20]}[double]' for array subscript
   46 |                                 sum+=((cl[slct[i1]].b-cl[slct[i2]].b)*(cl[slct[i1]].b-cl[slct[i2]].b));
      |                                                                                         ^