1.

/**
* Angewandte Mathematik, SS11
* Problem: 11152 Colourful Flowers
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2093
*
* @author Florian Stein
* @author Franz Sommer
* @version 1.1, 01/05/2011
*
* Method : Plain Geometry
* Status : Accepted
* Runtime: 2.096
* Formulas: see Taschenbuch der Mathematik, 7 Aufglabe , Bronstein et. al., S147
*/


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

public class Main {
public static void main(String args[]) throws IOException
{

//Inputhandling
BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));

int a,b,c;

String line = inputReader.readLine();
String[] splitLine;

while (line != null) {
splitLine = line.split(" ");

a = Integer.parseInt(splitLine[0]);
b = Integer.parseInt(splitLine[1]);
c = Integer.parseInt(splitLine[2]);

areas(a,b,c);

line = inputReader.readLine();
}
}

public static void areas(double a, double b,double c)
{
double ri,ro,s,D,I,O,V,R,S;
s= (a+b+c)/2.0;

//Flöche Dreieck
D =Math.sqrt(((s-a)*(s-b)*(s-c)*s));

// calc radius Inkreis:
ri = 2.0*D/(a+b+c);
// calc radius Umkreis
ro= (a*b*c)/(4.0*D);

// Fläche Inkreis
I = Math.PI*ri*ri;
//Fläche Umkreis
O = ro*ro*Math.PI;

// Results:
V = D-I; //Violets
R = I; //Roses
S = O-V-R; //Sunflowers
//Output
System.out.printf("%.4f %.4f %.4f\n", S, V, R);



}
}

2.

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


public class Main {

/**
* Angewandte Mathematik, SS11
* Problem: 11152 - Colourful Flowers
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2093
*
* @author Pirmin Schneider
* @version 1.0, 28/06/2011
*
* Status : Accepted
* Runtime: 2.084
*/
public static void main(String[] args) throws IOException {

int a,b,c;

double s, outline,
aTriangle, aIncircle, aOutercircle,
rIncircle, rOutercircle;

BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));

String line = inputReader.readLine();
String[] splitLine;

while (line!= null) {
splitLine = line.split(" ");

a = Integer.parseInt(splitLine[0]);
b = Integer.parseInt(splitLine[1]);
c = Integer.parseInt(splitLine[2]);

// outline is the sum of the 3 sites
outline = a + b + c;

// Heron's Formula for the area of the triangle
s = outline / 2.0;
aTriangle = Math.sqrt(s * (s-a) * (s-b) * (s-c));

// radius and area des inscribed circle (Pi * r²)
rIncircle = 2.0 * aTriangle / outline;
aIncircle = Math.PI * rIncircle * rIncircle;

// radius and area of the circumscribed circle
rOutercircle = (a * b * c) / (4.0 * aTriangle);
aOutercircle = Math.PI * rOutercircle * rOutercircle;

// substract overlaying areas from each other
aOutercircle -= aTriangle;
aTriangle -= aIncircle;

System.out.printf("%.4f %.4f %.4f\n", aOutercircle, aTriangle, aIncircle);

line = inputReader.readLine();
}

}


}


-------------------------------------------------------------------

1.

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS10/11
* Problem: 11152 Colourful Flowers
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=23&page=show_problem&problem=2093
*
* @author Fabian Liebl
* @version 1.0, 10/06/2010
*
* Method : Geometry
* Status : Accepted
* Runtime: 1.852
*/

import java.io.*;

public class Main {

public static void main(String[] args) throws IOException {
BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));

int a, b, c;
double s;
double radiusOuterCircle, radiusInnerCircle;
double areaTriangle, areaOuterCircle, areaInnerCircle;

String line = inputReader.readLine();
String[] splitLine;

while (line != null) {
splitLine = line.split(" ");

a = Integer.parseInt(splitLine[0]);
b = Integer.parseInt(splitLine[1]);
c = Integer.parseInt(splitLine[2]);

s = (a + b + c) / 2.0;

areaTriangle = Math.sqrt(s*(s - a)*(s - b)*(s - c));

radiusOuterCircle = (a*b*c)/(4.0*areaTriangle);
areaOuterCircle = radiusOuterCircle*radiusOuterCircle*Math.PI;

radiusInnerCircle = (2.0*areaTriangle)/(a+b+c);
areaInnerCircle = radiusInnerCircle*radiusInnerCircle*Math.PI;

areaOuterCircle -= areaTriangle;
areaTriangle -= areaInnerCircle;

System.out.printf("%.4f %.4f %.4f\n", areaOuterCircle, areaTriangle, areaInnerCircle);

line = inputReader.readLine();
}
}

}



2.


/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 11152 Colorfoul Flower
*
* @author Reichart Robert
*
* Status : Accepted
* Runtime: 1.792
*/

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

public class Main {
public static void main(String... args) throws IOException{
Main a = new Main();
}

Main() throws IOException{
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String line;
while((line = input.readLine()) != null){
String[] splited = line.split(" ");
int a = Integer.parseInt(splited[0]);
int b = Integer.parseInt(splited[1]);
int c = Integer.parseInt(splited[2]);


double alpha = Math.acos((b*b+c*c-a*a)/(2.0*b*c));
double beta = Math.acos((a*a+c*c-b*b)/(2.0*a*c));
double gamma = Math.acos((a*a+b*b-c*c)/(2.0*a*b));

double ur = a/(2*Math.sin(alpha));
double ir = 4*ur*Math.sin(alpha/2)*Math.sin(beta/2)*Math.sin(gamma/2);

double Ad = a*(c*Math.sin(beta)*0.5);
double Ai = ir*ir*Math.PI;

double tmp = ((ur*ur*Math.PI)-Ad);
tmp *= 10000;
tmp = Math.round(tmp);
tmp /= 10000;

System.out.printf("%.4f " ,tmp);

tmp = Ad-Ai;
tmp *= 10000;
tmp = Math.round(tmp);
tmp /= 10000;

System.out.printf("%.4f " ,tmp);

tmp = Ai;
tmp *= 10000;
tmp = Math.round(tmp);
tmp /= 10000;

System.out.printf("%.4f" ,tmp);
System.out.println();

}
}

}