1. 
package acm_438_the_circumference_of_the_circle;

/**
* FWP, Ausgew¦hlte Probleme aus dem ACM Programming Contest, SS10
* Problem: 438 - The circumference of the circle
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=379
*
* @author Martin Lambeck
* @version 1.0, 01/08/2010
*
* Method : geometry
* Status : Accepted
* Runtime: 0.240
*/

import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main
{
final static double PI = 3.141592653589793d;
static Point p1;
static Point p2;
static Point p3;

static Scanner sc = new Scanner(new BufferedInputStream(System.in));

public static void main (String...args)
{
while (testcase());
}

public static boolean testcase()
{
double x, y;
double frac, denom;
double r;


if (!sc.hasNextDouble())
return false;

p1 = new Point(sc.nextDouble(), sc.nextDouble());
p2 = new Point(sc.nextDouble(), sc.nextDouble());
p3 = new Point(sc.nextDouble(), sc.nextDouble());

Point m1 = mid(p1, p2); //middle point of p1->p2
Point m2 = mid(p2, p3); //middle point of p2->p3

Vector v1 = ortho(m1, p2); //v1 orthogonal to m1->p2
Vector v2 = ortho(m2, p3); //v2 orthogonal to m2->p3


// m1 + t * v1 = m2 + s * v2
//
// I) m1.x + t * v1.x = m2.x + s * v2.x
// II) m1.y + t * v1.y = m2.y + s * v2.y
//
// t = ... * s
// eliminate t => s = ... = frac
//
// x,y = center of circle = m2 + v2 * s = m2 + v2 * frac

denom = (v1.y * v2.x - v1.x * v2.y);
frac = (v1.x * (m2.y - m1.y) - v1.y * (m2.x - m1.x)) / denom;

if (denom == 0)
throw new IllegalArgumentException(); //wont happen, there is no such testcase

x = m2.x + v2.x * frac;
y = m2.y + v2.y * frac;


// circumference = r * 2 pi = | p1->(center) | * 2 pi = sqrt( (p1.x - x)^2 + (p1.y - y)^2 ) * 2 pi

r = Math.sqrt(Math.pow(p1.x - x, 2) + Math.pow(p1.y - y, 2));

System.out.printf("%.2f%n", r * 2 * PI);

return true;
}

public static Point mid(Point p1, Point p2)
{
double x = (p2.x - p1.x) / 2.0 + p1.x;
double y = (p2.y - p1.y) / 2.0 + p1.y;

return new Point (x, y);
}
public static Vector ortho(Point p0, Point q)
{
double x = q.x - p0.x;
double y = q.y - p0.y;

return new Vector(y, -x);
}

}

class Point
{
double x;
double y;

public Point(double xx, double yy)
{
x = xx;
y = yy;
}
}

class Vector
{
double x;
double y;

public Vector(double xx, double yy)
{
x = xx;
y = yy;
}
}

2.

/**
* FWP, Ausgew¦hlte Probleme aus dem ACM Programming Contest, SS10
* Problem: 438 - The circumference of the circle
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=379
*
* @author Michael Haus
* @version 1.0, 02/08/2010
*
* Method : geometry
* Status : Accepted
* Runtime: 0.240
*/

import java.util.Scanner;

public class Main {

public static void main(String[] args){

Scanner input = new Scanner(System.in);
while(input.hasNext()){

double ax = input.nextDouble();
double ay = input.nextDouble();

double bx = input.nextDouble();
double by = input.nextDouble();

double cx = input.nextDouble();
double cy = input.nextDouble();

double[] eins = new double[]{1,-1*ax,-1*ay,-1*(ax*ax+ay*ay)};
double[] zwei = new double[]{1,-1*bx,-1*by,-1*(bx*bx+by*by)};
double[] drei = new double[]{1,-1*cx,-1*cy,-1*(cx*cx+cy*cy)};

for(int i = 0; i < eins.length; i++){
zwei[i] = zwei[i] - eins[i];
drei[i] = drei[i] - eins[i];
}

//Cramersche Regel
double detA = (zwei[1]*drei[2])-(zwei[2]*drei[1]);
double detA1 = (zwei[3]*drei[2])-(zwei[2]*drei[3]);
double detA2 = (zwei[1]*drei[3])-(zwei[3]*drei[1]);

//b ,c
double b = detA1/detA;
double c = detA2/detA;

//a
eins[1] = eins[1] * b;
eins[2] = eins[2] * c;

double a = (eins[3]-eins[1])-eins[2];

double x = b/2;
double y = c/2;

double r = Math.sqrt(x*x+y*y-a);

System.out.println(Math.round(2*Math.PI*r * 100.)/100.);
}
}
}