Problem: Problem

Find the area of ​​a regular N / K polygon inscribed in a circle with a radius of 1.

However, a regular N / K polygon is defined as "the outermost figure that takes N points on the circumference at equal intervals and connects each point every K-1".

For example, a 5/2 polygon can be drawn as follows. First, take five points at equal intervals on the circumference of radius 1.

Sample Input 2 diagram


Next, connect each point every other 2-1 = 1.

Sample Input 2 diagram


The outermost figure is a regular 5/2 square.

Sample Input 2 diagram

Constraints

The input satisfies the following constraints.

* 5 ≤ N ≤ 106
* 1 <K <N / 2
* N and K are integers that are relatively prime

Input

The input is given in the following format.


N K


Two integers N and K are given on one line.

Output

Output the area of ​​a regular N / K polygon inscribed in a circle with a radius of 1 on one line. An error of 10-5 or less is acceptable.

Examples

Input

5 2


Output

1.12256994


Input

20 3


Output

2.93114293


Input

7 3


Output

1.08395920


Input

100000 3


Output

3.14159265

Solution (in CPP):

Solution:
#include <stdio.h>
#include <cmath>
#include <math.h>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


struct Point{
	void set(double arg_x,double arg_y){
		x = arg_x;
		y = arg_y;
	}
	double x,y;
};

Point point[1000000];

Point calc_Cross_Point(double x1,double x2,double x3,double x4,double y1,double y2,double y3,double y4){
	Point ret;
	ret.x = ((x2-x1)*(y3*(x4-x3)+x3*(y3-y4))-(x4-x3)*(y1*(x2-x1)+x1*(y1-y2)))/((y2-y1)*(x4-x3)-(y4-y3)*(x2-x1));
	if(x1 != x2){
		ret.y = ((y2-y1)*ret.x+y1*(x2-x1)+x1*(y1-y2))/(x2-x1);
	}else{
		ret.y = ((y4-y3)*ret.x+y3*(x4-x3)+x3*(y3-y4))/(x4-x3);
	}
	return ret;
}

double calc_S(Point a,Point b,Point c,Point d){
	return fabs((b.x*a.y - b.y*a.x)+(c.x*b.y - c.y*b.x)+(d.x*c.y - d.y*c.x)+(a.x*d.y - a.y*d.x))/2;
}


int main(){

	int N,K;
	scanf("%d %d",&N,&K);

	double base_degree = 360.0/(double)N;

	for(int i = 0; i < N; i++){
		point[i].x = cos((base_degree*i*M_PI)/180.0);
		point[i].y = sin((base_degree*i*M_PI)/180.0);
	}

	Point a,b,c,d,ret;
	a.set(point[0].x,point[0].y);

	ret = calc_Cross_Point(point[0].x,point[K].x,point[1].x,point[N+1-K].x,point[0].y,point[K].y,point[1].y,point[N+1-K].y);
	b.set(ret.x,ret.y);

	c.set(0,0);

	ret = calc_Cross_Point(point[0].x,point[N-K].x,point[N-1].x,point[(N-1+K)%N].x,point[0].y,point[N-K].y,point[N-1].y,point[(N-1+K)%N].y);
	d.set(ret.x,ret.y);

	printf("%.10lf\n",(double)N*calc_S(a,b,c,d));
}