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<bits/stdc++.h>
#define eps (1e-11)
using namespace std;

class Point{
public:
  double x,y;
  Point(double x=0,double y=0):x(x),y(y){}
 
  Point operator+(Point p){return Point(x+p.x,y+p.y);}
  Point operator-(Point p){return Point(x-p.x,y-p.y);}
  Point operator*(double k){return Point(x*k,y*k);}
  Point operator/(double k){return Point(x/k,y/k);}
         
  double norm(){ return (x*x+y*y); }
};

typedef Point Vector;
typedef vector<Point> Polygon;

class Segment{
public:
  Point p1,p2;
  Segment(Point p1,Point p2):p1(p1),p2(p2){}
};
typedef Segment Line;

double norm(Vector a){return (a.x*a.x+a.y*a.y); }
double abs(Vector a){ return sqrt(norm(a)); }
double dot(Vector a,Vector b){ return (a.x*b.x+a.y*b.y); }
double cross(Vector a,Vector b){ return (a.x*b.y-a.y*b.x); }

int ccw(Point p0,Point p1,Point p2){
  Vector a=p1-p0;
  Vector b=p2-p0;
  if(cross(a,b)>eps)return 1;
  if(cross(a,b)<-eps)return -1;
  if(dot(a,b)<-eps)return 2;
  if(a.norm()<b.norm())return -2;
  return 0;
}

Point getCrossPointLL(Line a,Line b){
  double A=cross(a.p2-a.p1,b.p2-b.p1);
  double B=cross(a.p2-a.p1,a.p2-b.p1);
  if(abs(A)<eps || abs(B)<eps)return b.p1;
  return b.p1+(b.p2-b.p1)*(B/A);
}

double getPolygonArea(Polygon p){
  double res=0.0;
  int n=p.size();
  for(int i=0;i<n;i++)res+=cross(p[i],p[(i+1)%n]);
  return res/2.0;
}

Polygon convex_cut(Polygon p,Line l){
  Polygon ans;
  int n=p.size();
  for(int i=0;i<n;i++){
    Point A=p[i],B=p[(i+1)%n];
    if(ccw(l.p1,l.p2,A)!=-1)ans.push_back(A);
    if(ccw(l.p1,l.p2,A)*ccw(l.p1,l.p2,B)<0)
      ans.push_back(getCrossPointLL(l,Segment(A,B)));
  }
  return ans;
}

int main()
{
  int a,b,c,d,e,f,count=1;

  while(1){
    cin>>a>>b>>c>>d>>e>>f;
    if(a+b+c+d+e+f==0)break;
    Point ic(a,b),pc(c,d),acm(e,f);
    Polygon p;
    p.push_back(Point(0,0));
    p.push_back(Point(10000,0));
    p.push_back(Point(10000,10000));
    p.push_back(Point(0,10000));
    double area=getPolygonArea(p);

    Point m1=ic+(pc-ic)/2.0,m2=ic+(acm-ic)/2.0;
    Vector v1,v2;
    v1=ic-m1;
    v2=pc-m1;
    swap(v1.x,v1.y);
    v1.y=(-1)*v1.y;
    swap(v2.x,v2.y);
    v2.y=(-1)*v2.y;
    Segment s1(m1+v2,m1+v1);
    p=convex_cut(p,s1);
    v1=ic-m2;
    v2=acm-m2;
    swap(v1.x,v1.y);
    v1.y=(-1)*v1.y;
    swap(v2.x,v2.y);
    v2.y=(-1)*v2.y;
    s1 = Segment(m2+v2,m2+v1);
    p=convex_cut(p,s1);
    printf("%d %.10f\n",count,getPolygonArea(p)/area);
    count++;
  }

  return 0;
}