/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.Random; import java.util.Scanner; /** * * @author cteam037 */ public class Northwest { void run() { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(); Town[] t = new Town[n]; for (int i = 0; i < n; i++) { t[i] = new Town(sc.nextInt(), sc.nextInt()); } double sum = n * n; double counterValid = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int a = t[i].x - t[j].x; int b = t[i].y - t[j].y; if (a == b && b == 0) { continue; } if ((a == b && b > 0) || (a == -b && b > 0)) { counterValid++; } } } //System.out.println(new Random().nextDouble()); System.out.println(counterValid * 2 / sum); } } public static void main(String[] args) { new Northwest().run(); } class Town { int x; int y; Town(int x, int y) { this.x = x; this.y = y; } } }