/* ACM ICPC Asia 98 Tokyo Problem C: Mobile Phone Coverage by Naoyuki Tamura (tamura@kobe-u.ac.jp) */ import java.io.*; import java.util.*; import java.text.*; public class C { static boolean dbg = false; static DataInputStream in = new DataInputStream(System.in); static int N; static C_Rect rect[]; static Vector area; static void debug(String msg) { if (dbg) System.err.print(msg); } static boolean read() throws Exception { String line = null; debug("# Enter\n"); line = in.readLine(); N = Integer.parseInt(line); if (N == 0) return false; rect = new C_Rect[N]; for (int i = 0; i < N; i++) { line = in.readLine(); StringTokenizer st = new StringTokenizer(line); double x = Double.valueOf(st.nextToken()).doubleValue(); double y = Double.valueOf(st.nextToken()).doubleValue(); double r = Double.valueOf(st.nextToken()).doubleValue(); rect[i] = new C_Rect(x-r, y-r, x+r, y+r); } return true; } static void addRect(int k) throws Exception { Vector newArea = new Vector(); newArea.addElement(rect[k]); for (int i = 0; i < area.size(); i++) { C_Rect r = (C_Rect)area.elementAt(i); C_Rect c = r.common(rect[k]); if (c == null) { newArea.addElement(r); } else { add(newArea, r.x0, r.y0, c.x1, c.y0); add(newArea, c.x1, r.y0, r.x1, c.y1); add(newArea, r.x0, c.y0, c.x0, r.y1); add(newArea, c.x0, c.y1, r.x1, r.y1); } } area = newArea; } static void add(Vector newArea, double x0, double y0, double x1, double y1) { if (x0 < x1 && y0 < y1) newArea.addElement(new C_Rect(x0, y0, x1, y1)); } static void printArea() throws Exception { debug("#"); for (int i = 0; i < area.size(); i++) { C_Rect r = (C_Rect)area.elementAt(i); debug(" " + r.toString()); } debug("\n"); } static double solve() throws Exception { C_Rect r; area = new Vector(); for (int i = 0; i < N; i++) { addRect(i); printArea(); } double a = 0.0; for (int i = 0; i < area.size(); i++) { a += ((C_Rect)area.elementAt(i)).area(); } return a; } public static void main(String args[]) { if (args.length > 0) dbg = true; DecimalFormat fmt = new DecimalFormat("0.00"); int c = 0; double a; try { while (read()) { c++; a = solve(); a = Math.round(100 * a) / 100.0; System.out.println(c + " " + fmt.format(a)); } } catch (Exception e) { e.printStackTrace(); } } } class C_Rect { double x0; double y0; double x1; double y1; C_Rect(double x0, double y0, double x1, double y1) { this.x0 = x0; this.y0 = y0; this.x1 = x1; this.y1 = y1; if (x0 > x1 || y0 > y1) { C.debug("# "+this+"\n"); } } double area() { return (x1 - x0) * (y1 - y0); } C_Rect common(C_Rect r) { double p0 = Math.max(x0, r.x0); double q0 = Math.max(y0, r.y0); double p1 = Math.min(x1, r.x1); double q1 = Math.min(y1, r.y1); if (p0 > p1 || q0 > q1) return null; return new C_Rect(p0, q0, p1, q1); } public String toString() { return "("+x0+","+y0+")-("+x1+","+y1+")"; } }