1.

/**
* Angewandte Mathematik, SS11
* Problem: 10432 Polygon inside a cricle
* Link:
*
* @author Schramm, Felix
* @author Vogel, Johannes
* @version 1.0, 06/20/2011
*
* Method : Ad-Hoc
* Status : Wrong Answer
* Runtime: 0.120
*/

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
StringBuffer output = new StringBuffer();

while (input.hasNextInt()) {
int radius = input.nextInt();
int sides = input.nextInt();
double area = 0;
double angle = 2.0*Math.PI/sides;

area = sides*0.5*radius*radius*Math.sin(angle);

output.append(String.format("%.3f\n", area));
}
System.out.print(output);
}
}

2.

/**
> * Angewandte Mathematik, SS11
> * Problem: 10432 - Polygon Inside A Circle
> * Link:
> http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1373
> * @author Brielbeck, Daniel
> * @author Weber, Georg
> * @version 1.0, 06/21/2011
> * Method : Ad-Hoc
> * Status : Accepted
> * Runtime: 0.204
> */
> import java.io.BufferedReader;
> import java.io.InputStreamReader;
> import java.text.DecimalFormat;
>
> public class Main {
> public static void main(String[] args) throws Exception {
> BufferedReader reader = new BufferedReader(new
> InputStreamReader(System.in));
> String input;
> while ((input = reader.readLine()) != null)
> {
> String[] values = input.split(" ");
> double r = Double.valueOf(values[0]);
> double n = Double.valueOf(values[1]);
> DecimalFormat f = new DecimalFormat("0.000");
> double out = Math.abs(((Math.pow(r,2)*n)/2)*Math.sin((Math.PI*2)/n));
> System.out.println(f.format(out));
> }
> }
> }

3.

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
* Angewandte Mathematik, 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 Unverzart Michael
* @author Wurth Manuel
* @version 1.0, 3/4/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.220
*/

public class Main {

public static void main(String[] args) throws Exception{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String inputLine;
while((inputLine = reader.readLine()) != null){
StringTokenizer st = new StringTokenizer(inputLine);
double r = new Double(st.nextToken());
double n = new Double(st.nextToken());
double A = Math.abs(((Math.pow(r, 2)*n)/2)*Math.sin(Math.toRadians(360)/n));
System.out.format("%.3f\n", A);
}
}
}

4.

/**
* Angewandte Mathematik, 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 Markus Schöllner
* @author Andreas Maier
* @version 1.0, 06/26/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.328
*/

import java.text.DecimalFormat;
import java.util.Locale;
import java.util.Scanner;


public class Main {


public static void main(String[] args) {
Scanner input = new Scanner(System.in);
DecimalFormat df = (DecimalFormat)DecimalFormat.getInstance(Locale.US);
df.applyPattern( "0.000" );

double r,n;
double firstPart, sinArg, sin,output;

while(input.hasNext()){
r = input.nextDouble();
n = input.nextDouble();

firstPart = (r*r*n)/((double)2.0);
sinArg=(360/n);
sinArg = (sinArg*Math.PI)/180.0;
sin = Math.sin(sinArg);
output=firstPart*sin;
System.out.println(df.format(output));


}
}

}