// Arup Guha
// 1/23/2026
// Solution to Kattis Problem: Grazed Grains
// https://open.kattis.com/problems/grazedgrains
// For both COP 4516 and COP 3330 (for this class to illustrate use of Random class.)
// Edited version of grazedgrains2 which shows how to use a Random object and the nextInt
// method.

import java.util.*;

public class grazedgrains3 {

	final public static int NUMTRIALS = 100000;
	final public static int NUMSTEPS = 10000;
	final public static int MIN = 0;
	final public static int RANGE = 30;
	final public static double AREA = RANGE*RANGE;
	final public static int OFFSET = 10;

	public static void main(String[] args) {
	
		// Read in number of UFOs.
		Scanner stdin = new Scanner(System.in);
		int numUFOs = stdin.nextInt();
		
		// Create array to store circles.
		int[][] circles = new int[numUFOs][3];
		for (int i=0; i<numUFOs; i++) {
			for (int j=0; j<2; j++)
				circles[i][j] = stdin.nextInt() + OFFSET;
			circles[i][2] = stdin.nextInt();
		}
		
		// Create one random object.
		Random rndObj = new Random();
				
		int success = 0;
		for (int i=0; i<NUMTRIALS; i++) {
		
			// Random point.
			// The idea here is that because the nextInt method doesn't generate doubles, we can choose
			// a random integer from [NUMSTEPS*MIN, NUMTEPS*(MIN+RANGE)) and then divide that by NUMSTEPS
			// to get a double that's in the desired range. Based on my NUMSTEPS, we'll get a double that's
			// got exactly 4 digits past the decimal, a fraction over 10,000.
			double x = 1.0*(NUMSTEPS*MIN + rndObj.nextInt(RANGE*NUMSTEPS))/NUMSTEPS;
			double y = 1.0*(NUMSTEPS*MIN + rndObj.nextInt(RANGE*NUMSTEPS))/NUMSTEPS;
			
			// Initially we have no proof it's in a circle.
			boolean inCircle = false;
			
			// See if this point is in UFO number j.
			for (int j=0; j<numUFOs; j++) {
			
				// Get distance from my random point to the center of this circle.
				double distFromCenter = Math.pow(circles[j][0]-x,2) + Math.pow(circles[j][1]-y,2);
				distFromCenter = Math.sqrt(distFromCenter);
				
				// We hit the circle!
				if (distFromCenter <= circles[j][2]) {
					inCircle = true;
					break;
				}
			}
			
			// Update success.
			if (inCircle) success++;
		}
		
		// Here is my estimate.
		System.out.println(1.0*success/NUMTRIALS*AREA);
	}
}