Problem: It was decided in IT City to distinguish successes of local IT companies by awards in the form of stars covered with gold from one side. To order the stars it is necessary to estimate order cost that depends on the area of gold-plating. Write a program that can calculate the area of a star.

A "star" figure having n ≥ 5 corners where n is a prime number is constructed the following way. On the circle of radius r n points are selected so that the distances between the adjacent ones are equal. Then every point is connected by a segment with two maximally distant points. All areas bounded by the segments parts are the figure parts.

<image>

Input

The only line of the input contains two integers n (5 ≤ n < 109, n is prime) and r (1 ≤ r ≤ 109) — the number of the star corners and the radius of the circumcircle correspondingly.

Output

Output one number — the star area. The relative error of your answer should not be greater than 10 - 7.

Examples

Input

7 10


Output

108.395919545675

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
public class p {
public static void main(String[] args) throws IOException {
	input.init(System.in);
	PrintWriter out = new PrintWriter(System.out);
	int n = input.nextInt();
	r = input.nextInt();
	double iter = 2*Math.PI / n;
	Point a = get(0);
	Point b = get(iter * (n/2+1));
	Point c = get(iter * -1);
	Point d = get(iter * (n/2 - 1));
	Point p = segmentIntersection(new Segment(a, b), new Segment(c, d));
	Point[] poly = new Point[]{a, c, p};
	double res = Math.PI * r * r;
	//out.println(res);
	res -= n * area(poly);
	//out.println(res);
	double arcArea = Math.PI * r * r / n - area(new Point[]{a, c, new Point(0, 0)});
	res -= n * arcArea;
	out.println(res);
	out.close();
}
static int r;
static Point get(double ang)
{
	return new Point(r*Math.cos(ang), r*Math.sin(ang));
}
public static double area(Point[] p)
{
	double res = 0;
	int n = p.length;
	for(int i = 0; i<n; i++)
	{
		res+= p[i].cross(p[(i+1)%n]);
	}
	return Math.abs(res/2);
}
public static Point segmentIntersection(Segment s1, Segment s2)
{
	Point p = lineIntersection(s1, s2);
	if(p==null)
	{
		//segments are parallel
		return null;
	}
	if(!(p.x >= Math.min(s1.start.x,s1.end.x)-1E-9 && p.x <= Math.max(s1.end.x,s1.start.x)+1E-9))
		return null;
	if(!(p.x >= Math.min(s2.start.x,s2.end.x)-1E-9 && p.x <= Math.max(s2.end.x,s2.start.x)+1E-9))
		return null;
	if(!(p.y >= Math.min(s1.start.y,s1.end.y)-1E-9 && p.y <= Math.max(s1.end.y,s1.start.y)+1E-9))
		return null;
	if(!(p.y >= Math.min(s2.start.y,s2.end.y)-1E-9 && p.y <= Math.max(s2.end.y,s2.start.y)+1E-9))
		return null;
	return p;
}
public static Point lineIntersection(Segment s1, Segment s2)
{
	double a1 = s1.end.y - s1.start.y;
	double b1 = s1.start.x - s1.end.x;
	double c1 = a1*s1.start.x + b1*s1.start.y;
	double a2 = s2.end.y - s2.start.y;
	double b2 = s2.start.x - s2.end.x;
	double c2 = a2*s2.start.x + b2*s2.start.y;
	double det = a1*b2 - a2*b1;
	if(det == 0)
	{
		//lines are parallel
		return null;
	}
	double x = (b2*c1 - b1*c2)/det;
	double y = (a1*c2 - a2*c1)/det;
	if(x == -0) x=0;
	if(y == -0) y=0;
	return new Point(x, y);
}
public static class Segment
{
	Point start, end;
	public Segment(Point a, Point b)
	{
		start = a; end = b;
	}
	//returns vector representation
	public Point diff()
	{
		return end.minus(start);
	}
	public boolean isFlat()
	{
		return start.y == end.y;
	}
	//shifts by dy in the direction perpendicular to the segment
	public Segment raise(double dy)
	{
		Point delta = diff().normal().mult(dy);
		return new Segment(start.plus(delta), end.plus(delta));
	}
	//returns endpoint when the segment is projected over vector from start and p
	public Point proj(Point p)
	{
		Point at = diff();
		double k = at.dot(p.minus(start))/at.magSquared();
		return at.mult(k).plus(start);
	}
	//returns shortest distance from line to p
	public double dist(Point p)
	{
		Point at = diff();
		double t = at.dot(p.minus(start))/at.magSquared();
		return p.dist(at.mult(t).plus(start));
	}
	public double eval(double x)
	{
		double slope = (end.y-start.y)/(end.x-start.x);
		return start.y + (x - start.x)*slope;
	}
}
public static class Point
{
	double x, y; //x and y represent the coordinates of a point or the components of a vector
	public Point(double myx, double myy)
	{
		x = myx; y = myy;
	}
	//returns this + that
	public Point plus(Point p)
	{
		return new Point(this.x+p.x, this.y+p.y);
	}
	//returns this - that
	public Point minus(Point p)
	{
		return new Point(this.x-p.x,this.y-p.y);
	}
	//scales vector by multiple of d
	public Point mult(double d)
	{
		return new Point(this.x*d, this.y*d);
	}
	//returns this (dot) that
	public double dot(Point p)
	{
		return this.x*p.x + this.y*p.y;
	}
	//returns this x that
	public double cross(Point p)
	{
		return this.x*p.y - this.y*p.x;
	}
	//returns magnitude squared of vector
	public double magSquared()
	{
		return this.x*this.x + this.y*this.y;
	}
	//returns magnitude of vector
	public double mag()
	{
		return Math.sqrt(magSquared());
	}
	//returns a vector normal to this one
	public Point normal()
	{
		return new Point(this.y/mag(), -1*this.x/mag());
	}
	//rotates vector clockwise by angle theta
	public Point rotate(double theta)
	{
		double nx = x*Math.cos(theta) - y*Math.sin(theta);
		double ny = x*Math.sin(theta) + y*Math.cos(theta);
		return new Point(nx, ny);
	}
	//returns unit vector
	public Point normalize()
	{
		double d = mag();
		return new Point(x/d, y/d);
	}
	public double dist(Point p)
	{
		return this.minus(p).mag();
	}
}
public static class input {
	static BufferedReader reader;
	static StringTokenizer tokenizer;

	static void init(InputStream input) {
		reader = new BufferedReader(new InputStreamReader(input));
		tokenizer = new StringTokenizer("");
	}

	static String next() throws IOException {
		while (!tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(reader.readLine());
		return tokenizer.nextToken();
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}
}
}