1.
/**
 * FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS11 
* Problem: 10432 Polygon Inside A Circle
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1373
*
* @author Burgmair Stefan
* @author YYY
* @version 1.0, 20/06/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.264
*/

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{
public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String[] arr;
double n, r, c, output, PI;
PI=2*Math.acos(0.0);

do{
arr = reader.readLine().split(" ");
r = Double.parseDouble(arr[0]);
n = Double.parseDouble(arr[1]);

c = Math.sin(2*PI/(double)n);
output = (double)(.5*r*r*c*n);
// h1 = Math.cos(Math.toRadians(360.0/n));
// c = Math.sqrt(2.0*r*r - 2.0*r*r*h1);
// h2 = Math.sqrt(r*r-c*c/4.0);
// output = c/2.0*h2*n;
System.out.printf("%.3f", output);
System.out.println();
}while (reader.ready());

}
}