#include <bits/stdc++.h>
#define ll long long
#define db double 

using namespace std;

const db pi = acos(-1.0); 
const int N = 3003; 

int n, L;
int a[N]; 
db X, Y; 

int main () {
  scanf("%d %d", &n, &L); 
  for(int i = 1; i <= n; i++) {
    scanf("%d", &a[i]); 
  }
  for(int i = 1; i <= n; i++) {
    for(int j = i + 1; j <= n; j++) {
      db t = 1.0 * (a[i] + a[j]) / L; 
      db x = cos(pi * t); 
      db y = sin(pi * t); 
      X += x * (2 * (j - i) - n), Y += y * (2 * (j - i) - n); 
    }
  }
  db P = 1.0 * n * (n - 1) * (n - 2) / 6; 
  printf("%.10lf %.10lf\n", -1.0 * X / P, -1.0 * Y / P); 
  return 0; 
}
