#include <bits/stdc++.h>
using namespace std;
int main ()
{
double r , x ,y ,a ,s ,v ,d ,pi=acos(-1) ;
int n ;
while (scanf ("%lf %d",&r,&n) == 2)
{
d=360/n ;
d=(d*pi)/180.0 ;
x=r*sqrt(2.0-2.0*cos(d)) ;
s=0.5*(r+r+x) ;
v=sqrt(s*(s-r)*(s-r)*(s-x)) ;
v=v*n ;
printf ("%.3lf\n",v) ;
}
return 0 ;
}
using namespace std;
int main ()
{
double r , x ,y ,a ,s ,v ,d ,pi=acos(-1) ;
int n ;
while (scanf ("%lf %d",&r,&n) == 2)
{
d=360/n ;
d=(d*pi)/180.0 ;
x=r*sqrt(2.0-2.0*cos(d)) ;
s=0.5*(r+r+x) ;
v=sqrt(s*(s-r)*(s-r)*(s-x)) ;
v=v*n ;
printf ("%.3lf\n",v) ;
}
return 0 ;
}