import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Northwest {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		
		

		String pocetLine = bf.readLine();
		
		while (pocetLine != null) {
			
			int pocet = Integer.parseInt(pocetLine);
			
			long[] x = new long[pocet];
			long[] y = new long[pocet];
			
			for (int i = 0; i < pocet; i++) {
				String line = bf.readLine();
				String[] numbers = line.split(" ");
				x[i] = Integer.parseInt(numbers[0]);
				y[i] = Integer.parseInt(numbers[1]);
			}
			
			int diag = 0;
		
			for (int i = 0; i < pocet; i++) {
				for (int j = i+1; j < pocet; j++) {
					if ((Math.abs(x[i] - x[j]) == Math.abs(y[i] - y[j]))) {
						diag = diag +2;
					}
				}
			}
			int celkem = pocet*pocet;
			
			System.out.println(diag/(double)celkem);
			
			pocetLine = bf.readLine();
		}

	}

}
