Language: C++

/*input
10 100
2
11
35
42
54
69
89
91
93
99
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define eb emplace_back
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define EL cout<<'\n'
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T> V){
	REP(i,SZ(V)) out<<V[i]<<((i!=SZ(V)-1)?" ":"");
	return out;
}
#define version 20190814
//}}}
const ll maxn=300005;
const ll maxlg=20;
const ll INF64=1e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

int n;
ll L;
ll a[maxn];
pdd p[maxn];

ld dis(pdd A,pdd B){
	return hypot(A.F-B.F,A.S-B.S);
}

pdd query(pdd A,pdd B,pdd C){
	ld a=dis(B,C);
	ld b=dis(A,C);
	ld c=dis(B,C);

	return MP((a*A.F+b*B.F+c*C.F)/p,(a*A.S+b*B.S+c*C.S)/p);
}

int main(){
	IOS;
	cin>>n>>L;
	REP(i,n) cin>>a[i];
	REP(i,n) p[i]=MP(cos(2*PI*a[i]/L),sin(2*PI*a[i]/L));

	pdd ans=MP(0,0);
	for(int i=1;i<n;i++) for(int j=i+1;j<n;j++){
		pdd I=query(p[0],p[i],p[j]);
		int coe=1+i-1+(n-j-1)-(j-i-1);
		ans.F+=coe*I.F;
		ans.S+=coe*I.S;
	}
	ans.F/=(n*(n-1)*(n-2))/6;
	ans.S/=(n*(n-1)*(n-2))/6;
	cout<<fixed<<setprecision(12)<<ans.F<<' '<<ans.S<<'\n';
	return 0;
}


Compiler output:
a.cc: In function 'pdd query(pdd, pdd, pdd)':
a.cc:80:38: error: invalid operands of types 'ld' {aka 'long double'} and 'pdd [300005]' {aka 'std::pair<long double, long double> [300005]'} to binary 'operator/'
   80 |         return MP((a*A.F+b*B.F+c*C.F)/p,(a*A.S+b*B.S+c*C.S)/p);
      |                   ~~~~~~~~~~~~~~~~~~~^~
      |                               |       |
      |                               |       pdd [300005] {aka std::pair<long double, long double> [300005]}
      |                               ld {aka long double}
a.cc:30:27: note: in definition of macro 'MP'
   30 | #define MP(a,b) make_pair(a,b)
      |                           ^
a.cc:80:60: error: invalid operands of types 'ld' {aka 'long double'} and 'pdd [300005]' {aka 'std::pair<long double, long double> [300005]'} to binary 'operator/'
   80 |         return MP((a*A.F+b*B.F+c*C.F)/p,(a*A.S+b*B.S+c*C.S)/p);
      |                                         ~~~~~~~~~~~~~~~~~~~^~
      |                                                     |       |
      |                                                     |       pdd [300005] {aka std::pair<long double, long double> [300005]}
      |                                                     ld {aka long double}
a.cc:30:29: note: in definition of macro 'MP'
   30 | #define MP(a,b) make_pair(a,b)
      |                             ^