Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<stdlib.h>
#include<ctype.h>
#include<math.h>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<vector>
using namespace std;
#define _pi acos(-1.0)
int _gcd(int x, int y){ return x%y==0?y:_gcd(y,x%y);}
int _abs(int x){return x>0?x:-x;}
double _max(double x,double y){return x>y?x:y;}
int _min(int x,int y){return x<y?x:y;}
void swap(int &a,int& b){int t=a;a=b;b=t;}

double l[25],a[25],b[25],dis[25][25],ans;
int n,m,select[25];

void dfs(int cnum,int pnum)
{
	if(pnum==m)
	{
		double t=0;
		for(int i=0;i<m;i++)
			for(int j=0;j<i;j++)
				t+=dis[select[i]][select[j]];
		ans=_max(ans,t);
		return;
	}
	if(cnum==n || n-cnum+pnum<m)
		return;
	select[pnum]=cnum;
	dfs(cnum+1,pnum+1);
	dfs(cnum+1,pnum);
}

double clu(int i,int j)
{
	return (l[i]-l[j])*(l[i]-l[j])+(a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]);
}

int main()
{
	int i,j;
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		for(i=0;i<n;i++)
			scanf("%lf%lf%lf",&l[i],&a[i],&b[i]);
		if(n==0 || m<=1)
			printf("0.00000000000000000000\n");
		else
		{
			for(i=0;i<n;i++)
				for(j=0;j<n;j++)
					dis[i][j]=clu(i,j);
			ans=0;
			dfs(0,0);
			printf("%.8lf\n",ans);
		}
	}
	return 0;
}

Compiler output:
a.cc:23:18: error: 'int select [25]' redeclared as different kind of entity
   23 | int n,m,select[25];
      |                  ^
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
                 from /usr/include/stdlib.h:514,
                 from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/x86_64-linux-gnu/sys/select.h:102:12: note: previous declaration 'int select(int, fd_set*, fd_set*, fd_set*, timeval*)'
  102 | extern int select (int __nfds, fd_set *__restrict __readfds,
      |            ^~~~~~
a.cc: In function 'void dfs(int, int)':
a.cc:32:48: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                 t+=dis[select[i]][select[j]];
      |                                                ^
a.cc:32:39: error: invalid types 'double [25][25][int(int, fd_set*, fd_set*, fd_set*, timeval*)]' for array subscript
   32 |                                 t+=dis[select[i]][select[j]];
      |                                       ^
a.cc:32:59: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                 t+=dis[select[i]][select[j]];
      |                                                           ^
a.cc:38:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |         select[pnum]=cnum;
      |                    ^
a.cc:38:21: error: assignment of read-only location '*(select + ((sizetype)pnum))'
   38 |         select[pnum]=cnum;
      |         ~~~~~~~~~~~~^~~~~