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 <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <assert.h>
#include <array>
#include <cstdio>
#include <cstring>
#include <random>
#include <functional>
#include <numeric>
#include <bitset>
#include <fstream>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }

typedef long long ll;
int const inf = 1<<29;
double const EPS = 1e-7;

typedef complex<double> P;

double dot(P a, P b) { return real(conj(a)*b); }
double cross(P a, P b) { return imag(conj(a)*b); }

int ccw(P p0, P p1, P p2) {
  auto a = p1 - p0;
  auto 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(norm(a) < norm(b)) return -2;
  return 0;
}

double area(vector<P> &g) {
  double ret = 0;
  rep(i, g.size()) {
    ret += cross(g[i], g[(i+1)%g.size()]);
  }
  return abs(ret) / 2.0;
}

struct Line: public vector<P> {
  Line(P a, P b) {
    push_back(a), push_back(b);
  }
};

Line perpendicular_bisector(P& a, P& b) {
  P c = (a + b) / 2.0;
  P p = P(c.real() + (a.imag() - b.imag()), c.imag() - (a.real() - b.real()));
  return Line(c, p);
}

P crosspointLL(Line const& a, Line const& b) {
  P va = a[1] - a[0], vb = b[1] - b[0];
  double d = cross(vb, va);
  if(abs(d) < EPS) return b[0];
  return a[0] + va * cross(vb, b[1] - a[0]) * (1.0 / d);
}

vector<P> convex_cut(vector<P>& g, Line const& l) {
  vector<P> ret;
  rep(i, g.size()) {
    if(ccw(l[0], l[1], g[i]) != -1) ret.push_back(g[i]);
    if(ccw(l[0], l[1], g[i]) * ccw(l[0], l[1], g[(i+1)%g.size()]) < 0) {
      ret.push_back(crosspointLL(Line(g[i], g[(i+1)%g.size()]), l));
    }
  }
  return ret;
}

vector<P> ps;

bool input() {
  ps.clear();
  rep(i, 3) {
    int x, y;
    cin >> x >> y;
    if (x == 0)
      return 0;
    ps.push_back(P(x, y));
  }
  return 1;
}

int main() {

  int tc = 1;
  while(input()) {
    vector<P> U = {P(0,0), P(10000,0), P(10000,10000), P(0,10000)};
    REP(i, 1, ps.size()) {
      U = convex_cut(U, perpendicular_bisector(ps[0], ps[i]));
    }
    printf("%d %.10f\n", tc++, area(U) / 100000000.0);
  }

  return 0;
}