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 <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

#include <complex>
#include <queue>
#include <cstdio>
using namespace std;
 
const double EPS = 1e-9;
const double PI = acos(-1);
 
typedef complex<double> P;
typedef vector<P> G;
 
struct L :public vector<P> {
    L(const P &a,const P &b){
        push_back(a);
        push_back(b);
    }
};
 
#define next(P,i) (P[(i+1)%P.size()])
#define curr(P,i) (P[(i+0)%P.size()])
 
double cross(const P &a,const P &b){
    return imag(conj(a)*b);
}
double dot(const P &a,const P &b){
    return real(conj(a)*b);
}
 
int ccw(P a,P b,P c){
    b -= a;
    c -= a;
    if( cross(b,c) > 0 ) return +1;
    if( cross(b,c) < 0 ) return -1;
    if( dot(b,c) < 0 ) return +2;
    if( norm(b) < norm(c) ) return -2;
    return 0;
}
 
P crosspoint(const L &l,const L &m){
    double A = cross(l[1]-l[0],m[1]-m[0]);
    double B = cross(l[1]-l[0],l[1]-m[0]);
    if( abs(A) < EPS && abs(B) < EPS) return m[0];
    return m[0]+B/A*(m[1]-m[0]);
}
 
 
G convex_cut(const G &poly,const L &l){
    G Q;
    for(int i = 0 ; i < poly.size() ; i++){
        P A = curr(poly,i) , B = next(poly,i);
        if( ccw(l[0],l[1],A)!=-1)Q.push_back(A);
        if( ccw(l[0],l[1],A)*ccw(l[0],l[1],B)<0)Q.push_back(crosspoint(L(A,B),l));
    }
    return Q;
          
}
 
L bisector(P a,P b){
    P A = (a+b) * P(0.5,0);
    return L(A,A+(b-a)*P(0,PI/2));
}
G voronoi(G g,vector<P> v,int s){
    for(int i = 0 ; i < v.size() ; i++){
        if( i != s ){
            g = convex_cut(g,bisector(v[s],v[i]));
        }
    }
    return g;
}
 
double Area(const G& poly) {
	double A = 0;
	for (int i = 0; i < poly.size(); ++i)A += cross(curr(poly, i), next(poly, i));
	return abs(A)/2;
}                                  


int main(){
    int n;
	int a,b,c,d,e,f;
	int t = 1;
    while(cin >> a >> b >> c >> d >> e >> f && a){
        G area,p;
        area.push_back(P(0,0));
        area.push_back(P(0,10000));
        area.push_back(P(10000,10000));
        area.push_back(P(10000,0));
        p.push_back(P(a,b));
		p.push_back(P(c,d));
		p.push_back(P(e,f));
        G v = voronoi(area,p,0);
        printf("%d %.8lf\n",t,(Area(v))/(10000.0*10000.0));
		t++;
    }
}