#include <iostream>                                                                                                                                                 
#include <math.h>                                                                                                                                                   
                                                                                                                                                                    
int main(void){                                                                                                                                                     
  int N;                                                                                                                                                            
  long int L;                                                                                                                                                       
  std::vector<int> T;                                                                                                                                               
  std::vector<double> angles;                                                                                                                                       
  std::vector<double> cos_, sin_, cos_2, sin_2;                                                                                                                     
  std::cin >> N;                                                                                                                                                    
  std::cin >> L;                                                                                                                                                    
  for(size_t i = 0 ; i<N; i++){                                                                                                                                     
    int tmp;                                                                                                                                                        
    std::cin >> tmp;                                                                                                                                                
    T.push_back(tmp);                                                                                                                                               
    angles.push_back(2 * tmp*M_PI / L);                                                                                                                             
    cos_.push_back(cos(angles[i]));                                                                                                                                 
    sin_.push_back(sin(angles[i]));                                                                                                                                 
    //cos_2.push_back(cos(0.5*angles[i]));                                                                                                                          
    sin_2.push_back(sin(0.5*angles[i]));                                                                                                                            
  }                                                                                                                                                                 
                                                                                                                                                                    
  double Ex = 0;                                                                                                                                                    
  double Ey = 0;                                                                                                                                                    
  int count =0;                                                                                                                                                     
  for(size_t i = 0; i < N -2; i++){                                                                                                                                 
    for(size_t j=i+1; j < N-1; j++){                                                                                                                                
      for(size_t k=j+1; k < N; k++){                                                                                                                                
        double a = abs(sin(0.5*(angles[i]-angles[j])));                                                                                                             
        double b = abs(sin(0.5*(angles[j]-angles[k])));                                                                                                             
        double c = abs(sin(0.5*(angles[k]-angles[i])));                                                                                                             
        double mother =a+b+c;                                                                                                                                       
        Ex += (b*cos_[i] + c*cos_[j] + a*cos_[k])/mother;                                                                                                           
        Ey += (b*sin_[i] + c*sin_[j] + a*sin_[k])/mother;                                                                                                           
        count++;                                                                                                                                                    
      }                                                                                                                                                             
    }                                                                                                                                                               
  }                                                                                                                                                                 
  std::cout << Ex/count << " " << Ey/count;                                                                                                                         
  return 0;                                                                                                                                                         
}     