Problem: There is a flat island whose shape is a perfect square. On this island, there are three habitants whose names are IC, PC, and ACM Every day, one jewel is dropped from the heaven. Just as the jewel touches the ground, IC, PC, and ACM leave their houses simultaneously, run with the same speed, and then a person who first touched the jewel can get the jewel. Hence, the person whose house is nearest to the location of the jewel is the winner of that day.

They always have a quarrel with each other, and therefore their houses are located at distinct places. The locations of their houses are fixed. This jewel falls at a random point on the island, that is, all points on the island have even chance.

When three are two or more persons whose houses are simultaneously nearest, the last person in the order of

IC, PC, ACM

obtains the jewel.

Our interest is to know the probability for IC to get the jewel under this situation.



Input

The input describes one problem instance per line. Each line contains the x- and y-coordinates of IC's home, those of PC's, and those of ACM's in this order. Note that the houses of IC, PC and ACM are located at distinct places. The end of the input is indicated by a line with six zeros.

The coordinates of the whole island are given by (0, 10000) × (0, 10000) and coordinates of houses are given in integer numbers between 1 and 9999, inclusive. It should be noted that the locations of the jewels are arbitrary places on the island and their coordinate values are not necessarily integers.

Output

For each input line, your program should output its sequence number starting from 1, and the probability for the instance. The computed probability values should have errors less than 10-5.

The sequence number and the probability should be printed on the same line. The two numbers should be separated by a space.

Example

Input

2000 2000 8000 8000 9000 9500
2500 2500 7500 2500 2500 7500
0 0 0 0 0 0


Output

1 0.50000
2 0.25000

Solution (in CPP):

Solution:
#include <cstdio>
#include <cmath>
#include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
#include <cfloat>
using namespace std;

typedef complex<double> P;
typedef const P &rP;
typedef vector<P> polygon;

inline double dot(rP va, rP vb){
	return real(va) * real(vb) + imag(va) * imag(vb);
}

inline double cross(rP va, rP vb){
	return real(va) * imag(vb) - imag(va) * real(vb);
}

inline int ccw(rP a, P b, P c) {
	b -= a;
	c -= a;
	if (cross(b, c) > 0)	 return +1;			 // counter clockwise
	if (cross(b, c) < 0)	 return -1;			 // clockwise
	if (dot(b, c) < 0)		 return +2;			 // c--a--b on line
	if (norm(b) < norm(c)) return -2;			 // a--b--c on line
	return 0;
}

P crosspoint(rP pa1, rP pa2, rP pb1, rP pb2){
	P da12 = pa2 - pa1;
	P db21 = pb1 - pb2;
	P dab1 = pb1 - pa1;
	double D = cross(da12, db21);

	return pa1 + da12 * (cross(dab1, db21) / D);
}

polygon convex_cut(const polygon &plg, rP a, rP b) {
	polygon ret;

	for (int i = 0; i < plg.size(); ++i) {
		P c = plg[i];
		P d = plg[(i + 1) % plg.size()];

		if (ccw(a, b, c) != -1) ret.push_back(c);
		if (ccw(a, b, c) * ccw(a, b, d) < 0){
			ret.push_back( crosspoint(a, b, c, d) );
		}
	}
	return ret;
}

double area(const polygon &pl){
	double sum = 0.0;
	for(int i = 2; i < pl.size(); ++i){
		sum += cross(pl[i-1] - pl[0], pl[i] - pl[0]);
	}
	return 0.5 * abs(sum);
}

int main(){
	double xa, ya;
	int dataset = 0;
	
	while( scanf("%lf%lf", &xa, &ya), xa != 0 ){
		polygon pl;
		pl.push_back( P(0.0, 0.0) );
		pl.push_back( P(0.0, 1e4) );
		pl.push_back( P(1e4, 1e4) );
		pl.push_back( P(1e4, 0.0) );

		P pa(xa, ya);

		double xb, yb;
		for(int i = 0; i < 2; ++i){
			scanf("%lf%lf", &xb, &yb);
			P pb(xb, yb);
			
			P vd = pb - pa;
			P pc = 0.5 * (pa + pb);
			P pd = pc + P(vd.imag(), -vd.real());
			
			if( ccw(pc, pd, pa) < 0 ){
				swap(pc, pd);
			}
			
			pl = convex_cut(pl, pc, pd);
		}

		
		printf("%d %f\n", ++dataset, area(pl) * 1e-8);
	}
}