#include<stdio.h>
#include<math.h>

int main(void) {
 unsigned long long int i, sumx = 0, sumy = 0;
 unsigned long long int x[1000000000]
 unsigned long long int y[1000000000];
	unsigned long long int N, L;
	unsigned long long int T[1000000000];

	scanf("%lld %lld", &N, &L);

	for(i = 0;i < N;i++) {
		scanf("%lld", T);
			x[i] = sin(2*3.14159*T[i]/L); sumx = sumx + x[i]
				y[i] = cos(2*3.14159*T[i]/L); sumy = sumy + y[i]
	}

	sumx = sumx / N;	sumy = sumy / N;

	printf("%llf %llf", (long long double) sumx, (long long double) sumy);
 return 0;
}