Problem: Dr. Extreme experimentally made an extremely precise telescope to investigate extremely curi- ous phenomena at an extremely distant place. In order to make the telescope so precise as to investigate phenomena at such an extremely distant place, even quite a small distortion is not allowed. However, he forgot the influence of the internal gas affected by low-frequency vibration of magnetic flux passing through the telescope. The cylinder of the telescope is not affected by the low-frequency vibration, but the internal gas is.

The cross section of the telescope forms a perfect circle. If he forms a coil by putting extremely thin wire along the (inner) circumference, he can measure (the average vertical component of) the temporal variation of magnetic flux:such measurement would be useful to estimate the influence. But points on the circumference at which the wire can be fixed are limited; furthermore, the number of special clips to fix the wire is also limited. To obtain the highest sensitivity, he wishes to form a coil of a polygon shape with the largest area by stringing the wire among carefully selected points on the circumference.

Your job is to write a program which reports the maximum area of all possible m-polygons (polygons with exactly m vertices) each of whose vertices is one of the n points given on a circumference with a radius of 1. An example of the case n = 4 and m = 3 is illustrated below.


<image>


In the figure above, the equations such as "p1 = 0.0" indicate the locations of the n given points, and the decimals such as "1.000000" on m-polygons indicate the areas of m-polygons.

Parameter pi denotes the location of the i-th given point on the circumference (1 ≤ i ≤ n). The location p of a point on the circumference is in the range 0 ≤ p < 1, corresponding to the range of rotation angles from 0 to 2π radians. That is, the rotation angle of a point at p to the point at 0 equals 2π radians. (π is the circular constant 3.14159265358979323846....)

You may rely on the fact that the area of an isosceles triangle ABC (AB = AC = 1) with an interior angle BAC of α radians (0 < α < π) is (1/2)sinα, and the area of a polygon inside a circle with a radius of 1 is less than π.



Input

The input consists of multiple subproblems followed by a line containing two zeros that indicates the end of the input. Each subproblem is given in the following format.


n m
p1 p2 ... pn


n is the number of points on the circumference (3 ≤ n ≤ 40). m is the number of vertices to form m-polygons (3 ≤ m ≤ n). The locations of n points, p1, p2,..., pn, are given as decimals and they are separated by either a space character or a newline. In addition, you may assume that 0 ≤ p1 < p2 < ... < pn < 1.

Output

For each subproblem, the maximum area should be output, each in a separate line. Each value in the output may not have an error greater than 0.000001 and its fractional part should be represented by 6 decimal digits after the decimal point.

Example

Input

4 3
0.0 0.25 0.5 0.666666666666666666667
4 4
0.0 0.25 0.5 0.75
30 15
0.00 0.03 0.06 0.09 0.12 0.15 0.18 0.21 0.24 0.27
0.30 0.33 0.36 0.39 0.42 0.45 0.48 0.51 0.54 0.57
0.61 0.64 0.66 0.69 0.72 0.75 0.78 0.81 0.84 0.87
40 20
0.351 0.353 0.355 0.357 0.359 0.361 0.363 0.365 0.367 0.369
0.371 0.373 0.375 0.377 0.379 0.381 0.383 0.385 0.387 0.389
0.611 0.613 0.615 0.617 0.619 0.621 0.623 0.625 0.627 0.629
0.631 0.633 0.635 0.637 0.639 0.641 0.643 0.645 0.647 0.649
0 0


Output

1.183013
2.000000
3.026998
0.253581

Solution (in CPP):

Solution:
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
#include <iterator>
#include <complex>
#include <assert.h>
 
using namespace std;
 
typedef long long ll;
typedef pair <double,double> P;
typedef pair <int,P > PP;
 
int tx[] = {0,1,0,-1};//URDL
int ty[] = {-1,0,1,0};
 
static const double EPS = 1e-8;

typedef complex<double> Point;

namespace std {
  bool operator < (const Point& a, const Point& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}

double cross(const Point& a, const Point& b) {
  return imag(conj(a)*b);
}
double dot(const Point& a, const Point& b) {
  return real(conj(a)*b);
}

struct Line : public vector<Point> {
  Line(const Point &a, const Point &b) {
    push_back(a); push_back(b);
  }
};

struct Circle {
  Point p; double r;
  Circle(const Point &p, double r) : p(p), r(r) { }
};

int ccw(Point a, Point b, Point c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

bool intersectSS(const Line &s, const Line &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
    ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}

vector<Point> crosspointsCC(const Circle& s,const Circle& t){
  //ax + by + c = 0
  double a = real(t.p) - real(s.p); //x1-x2;
  double b = imag(t.p) - imag(s.p); //y1-y2;
  double d = sqrt(a * a + b * b);
  double theta = 0.0;

  if(d > 0) {
    theta = acos((d * d + s.r * s.r - t.r * t.r) / (2 * d * s.r));
  }

  double angle = atan2(b,a);
  
  vector<Point> res;
  if(d < s.r + t.r){
    res.push_back(Point(s.p.real() + s.r * cos(angle + theta), s.p.imag() + s.r * sin(angle + theta)));
    res.push_back(Point(s.p.real() + s.r * cos(angle - theta), s.p.imag() + s.r * sin(angle - theta)));
  }

  else if(s.r + t.r - EPS <= d && d <= s.r + t.r + EPS){
    res.push_back(Point(s.p.real() + s.r * cos(angle), s.p.imag() + s.r * sin(angle)));
  }
  
  return res;
}

Point crosspointLL(const Line &l, const Line &m) {
  double A = cross(l[1] - l[0], m[1] - m[0]);
  double B = cross(l[1] - l[0], l[1] - m[0]);
  if (abs(A) < EPS && abs(B) < EPS) return m[0]; // same line
  if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
  return m[0] + B / A * (m[1] - m[0]);
}

bool EQ(double lhs,double rhs) {
  return (lhs - EPS <= rhs
          && rhs <= lhs + EPS);
}

bool on_seg(const Point& p1,const Point&p2,
            const Point& q){
  return abs(cross(p1-q,p2-q)) < EPS && dot(p1-q,p2-q) < EPS;
}

vector<Point> crosspointCL(const Circle &ci,const Line& l){
  vector<Point> res;
  // (x-a)^2 + (y-b)^2 = c^2

  if(EQ(real(l[0]),real(l[1])) && EQ(real(l[0]),0)){
    // x = 0
    double a = ci.p.real();
    double b = ci.p.imag();
    double c = ci.r;

    double A = 1.0;
    double B = -2.0 * b;
    double C = a * a + b * b - c * c;
    double D = B * B - 4.0 * A * C;
    if(D < -EPS) return res;
    if(-EPS <= D && D <= EPS) {
      double x = 0;
      double y = -B / (2.0 * A);
      if(ccw(l[0],l[1],Point(x,y)) == 0){
        res.push_back(Point(x,y));
      }
      return res;
    }

    double x = 0.0;
    double y = (-B + sqrt(D)) / (2.0 * A);
    if(on_seg(l[0],l[1],Point(x,y))){
      res.push_back(Point(x,y));
    }
    y = (-B - sqrt(D)) / (2 * A);
    if(on_seg(l[0],l[1],Point(x,y))){
      res.push_back(Point(x,y));
    }
    return res;
  }
  else if(EQ(imag(l[0]),imag(l[1])) && EQ(imag(l[0]),0)){
    // y = 0
    double a = ci.p.real();
    double b = ci.p.imag();
    double c = ci.r;

    double A = 1.0;
    double B = -2.0 * a;
    double C = a * a + b * b - c * c;
    double D = B * B - 4.0 * A * C;
    if(D < -EPS) return res;
    if(-EPS <= D && D <= EPS) {
      double x = -B / (2.0 * A);
      double y = 0;
      if(ccw(l[0],l[1],Point(x,y)) == 0){
        res.push_back(Point(x,y));
      }
      return res;
    }

    double x = (-B + sqrt(D)) / (2.0 * A);
    double y = 0.0;
    if(on_seg(l[0],l[1],Point(x,y))){
      res.push_back(Point(x,y));
    }
    x = (-B - sqrt(D)) / (2 * A);
    if(on_seg(l[0],l[1],Point(x,y))){
      res.push_back(Point(x,y));
    }
    return res;
  }
  else{
    //y = px + q
    double p = (imag(l[0]) - imag(l[1])) / (real(l[0]) - real(l[1]));
    double q = 0;//imag(l[1]) - p * real(l[1]);

    double a = ci.p.real();
    double b = ci.p.imag();
    double c = ci.r;

    double A = 1.0 + p * p;
    double B = (-2.0 * a - 2.0 * b * p + 2.0 * p * q);
    double C = a * a + b * b - 2.0 * b * q + q * q - c * c;
    double D = B * B - 4.0 * A * C;
    if(D < -EPS) return res;
    if(-EPS <= D && D <= EPS) {
      double x = -B / (2.0 * A);
      double y = p * x + q;
      printf("last\n");
      if(ccw(l[0],l[1],Point(x,y)) == 0){
        res.push_back(Point(x,y));
      }
      return res;
    }

    double x = (-B + sqrt(D)) / (2.0 * A);
    double y = p * x + q;
    
    if(on_seg(l[0],l[1],Point(x,y))){
      res.push_back(Point(x,y));
    }
    
    x = (-B - sqrt(D)) / (2.0 * A);
    y = p * x + q;
    if(on_seg(l[0],l[1],Point(x,y))){
      res.push_back(Point(x,y));
    }
    return res;
  }
}

double compute_area(const Point &l,const Point &m){
  return abs(cross(l,m)) / 2.0;
}

bool is_equal(const Point &l,const Point &m){
  return ((abs(real(l) - real(m)) < EPS) && (abs(imag(l) - imag(m) < EPS)));
}

bool include(const Circle& s,Point t){
  t -= s.p;
  return dot(t,t) <= s.r * s.r + EPS;
}

int main(){
  int num_of_circumference_points;
  int num_of_polygon_vertices;
  while(~scanf("%d %d",
               &num_of_circumference_points,
               &num_of_polygon_vertices)){
    if(num_of_circumference_points == 0
       && num_of_polygon_vertices == 0) break;

    vector<Point> polygon;
    for(int i = 0; i < num_of_circumference_points; i++){
      double p;
      cin >> p;
      //y = ax + b
      double rad = M_PI * 2.0 * p;
      Line l(Point(0,0),Point(0,0));

      if(EQ(p,0.0)){
        l = Line(Point(0,0),Point(10.0,0));
      }
      else if(EQ(p,0.25)){
        l = Line(Point(0,0),Point(0,10.0));
      }
      else if(EQ(p,0.5)){
        l = Line(Point(0,0),Point(-10.0,0));
      }
      else if(EQ(p,0.75)){
        l = Line(Point(0,0),Point(0,-10.0));
      }
      else{
        double a = tan(rad);
        double x;
        if((0 < p && p < 0.25)
           || (0.75 < p && p < 1.0)){
          x = 10.0;
        }
        else{
          x = -10.0;
        }
        double y = a * x;
        Point t = Point(x,y) / abs(Point(x,y));
        l = Line(Point(0,0),10.0 * t);
      }

      Circle ci(Point(0,0),1.0);
      vector<Point> tmp = crosspointCL(ci,l);

      if(tmp.size() == 1){
        polygon.push_back(tmp[0]);
      }
      else{
        assert(false);
      }
    }

    double dp[41][41][41];
    double res = 0.0;
    memset(dp,0,sizeof(dp));

    for(int used = 2; used < num_of_polygon_vertices; used++){
      for(int start_i = 0; start_i < polygon.size(); start_i++){
        for(int mid_i = start_i; mid_i < polygon.size(); mid_i++){
          for(int end_i = mid_i + 1; end_i < polygon.size(); end_i++){
            dp[used + 1][start_i][end_i]
              = max(dp[used + 1][start_i][end_i],
                    dp[used][start_i][mid_i]
                    + compute_area(polygon[start_i] - polygon[end_i],
                                   polygon[mid_i] - polygon[end_i]));
          }
        }
      }
    }
    for(int start_i = 0; start_i < polygon.size(); start_i++){
      for(int end_i = 0; end_i < polygon.size(); end_i++){
        res = max(res,dp[num_of_polygon_vertices][start_i][end_i]);
      }
    }
    printf("%lf\n",res);
  }
}