
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
using namespace std;
using ll = long long;
using ld = long double;

ll n, k;

const ld PI = acos(-1);

ld len_m[234567];
inline ld len(int d)
{
	if (len_m[d] >= 0)return len_m[d];
	return len_m[d] = sqrt(2 - 2 * cos(PI * 2 / n * d));
}

inline ld cosform(int a_, int b_, int c_)
{
	ld a = len(a_);
	ld b = len(b_);
	ld c = len(c_);
	ld up = a * a + b * b - c * c;
	ld dn = a * b * 2;
	return (ld)up / dn;
}

bool cond(ld s)
{
	ll cnt = 0;
	for (int f = 1; f < n - 1; ++f)
	{
		int hi = (n - f) / 2. + 1;
		int lo = 0;
		while (lo + 1 < hi)
		{
			int md = (hi + lo) / 2;
			int oth = n - md - f;
			ld costh = cosform(md, f, oth);
			ld sinth = sqrt(1. - costh * costh);
			ld area = len(md) * len(f) * sinth / 2.;
			if (area <= s)
			{
				lo = md;
			}
			else
			{
				hi = md;
			}
		}
		ll plus = lo + lo;
		if (plus > n - f - 1)plus = n - f - 1;
		cnt += plus;
	}
	return (cnt > k);
}

const ld EPS = 1e-15;

int main(void)
{
	cin >> n >> k;
	k--;
	k *= 3;
	k /= (n);
	fill(len_m, len_m + 234567, -1.);
	ld hi = PI, lo = 0;
	while(hi - lo >= EPS)
	{
		ld md = (hi + lo) / 2;
		if (cond(md))
		{
			hi = md;
		}
		else
		{
			lo = md;
		}
	}
	cout.precision(20);
	cout << hi << endl;
	return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

Input

The input is given from Standard Input in the following format:


> $N \ K$

Output

* Please output the $K$-th triangle area.
* Print a floating number denoting the answer. The relative or absolute error of your answer should not be higher than $10^{−9}$.



Constraints

* $3 \le N \le 200,000$
* $1 \le K \le \frac{N(N-1)(N-2)}{6}$



Subtasks

Subtask 1 [ $160$ points ]


* $N \le 100$

Subtask 2 [ $240$ points ]


* $N \le 1000$

Subtask 3 [ $450$ points ]


* $N \le 200,000$

Output

* Please output the $K$-th triangle area.
* Print a floating number denoting the answer. The relative or absolute error of your answer should not be higher than $10^{−9}$.



Constraints

* $3 \le N \le 200,000$
* $1 \le K \le \frac{N(N-1)(N-2)}{6}$



Subtasks

Subtask 1 [ $160$ points ]


* $N \le 100$

Subtask 2 [ $240$ points ]


* $N \le 1000$

Subtask 3 [ $450$ points ]


* $N \le 200,000$

Input

The input is given from Standard Input in the following format:


> $N \ K$

Examples

Input

4 3


Output

1.0000000000000


Input

6 9


Output

0.86602540378


Input

12 220


Output

1.29903810568

### Response

```cpp

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
using namespace std;
using ll = long long;
using ld = long double;

ll n, k;

const ld PI = acos(-1);

ld len_m[234567];
inline ld len(int d)
{
	if (len_m[d] >= 0)return len_m[d];
	return len_m[d] = sqrt(2 - 2 * cos(PI * 2 / n * d));
}

inline ld cosform(int a_, int b_, int c_)
{
	ld a = len(a_);
	ld b = len(b_);
	ld c = len(c_);
	ld up = a * a + b * b - c * c;
	ld dn = a * b * 2;
	return (ld)up / dn;
}

bool cond(ld s)
{
	ll cnt = 0;
	for (int f = 1; f < n - 1; ++f)
	{
		int hi = (n - f) / 2. + 1;
		int lo = 0;
		while (lo + 1 < hi)
		{
			int md = (hi + lo) / 2;
			int oth = n - md - f;
			ld costh = cosform(md, f, oth);
			ld sinth = sqrt(1. - costh * costh);
			ld area = len(md) * len(f) * sinth / 2.;
			if (area <= s)
			{
				lo = md;
			}
			else
			{
				hi = md;
			}
		}
		ll plus = lo + lo;
		if (plus > n - f - 1)plus = n - f - 1;
		cnt += plus;
	}
	return (cnt > k);
}

const ld EPS = 1e-15;

int main(void)
{
	cin >> n >> k;
	k--;
	k *= 3;
	k /= (n);
	fill(len_m, len_m + 234567, -1.);
	ld hi = PI, lo = 0;
	while(hi - lo >= EPS)
	{
		ld md = (hi + lo) / 2;
		if (cond(md))
		{
			hi = md;
		}
		else
		{
			lo = md;
		}
	}
	cout.precision(20);
	cout << hi << endl;
	return 0;
}

```