import java.io.*;
import java.lang.*;

class Northwest {
	static BufferedReader in;
static Mesto m;
	public static void main(String[] args) throws IOException{
		in = new BufferedReader(new InputStreamReader(System.in));
		int me=0;
		Mesto[] mes = null;
		String line;
int counter ;
		while((line = in.readLine())!=null){
		counter = 0;
		String[]split=line.split(" ");
		me = Integer.parseInt(split[0]);
		mes = new Mesto[me];
		for(int i =0; i< me; i++){
line = in.readLine();
		split=line.split(" ");
		m = new Mesto(Integer.parseInt(split[0]),Integer.parseInt(split[1]));
		mes[i] = m;
		if(i>0){
		for(int j = i; j>0;j--){
			if(is45(mes[j],mes[j-1])){
			counter++;
		//System.out.println(j);
		}
		}
		}
		}
		
		

	System.out.println(1-(double)counter/(me*me));
}



}
		static boolean is45(Mesto a, Mesto b){
			return (Math.abs(a.getX()-b.getX()) == Math.abs(a.getY()-b.getY()));
		}
		public static class Mesto{
		private int x,y;
		public Mesto(int x, int y){
			this.x =x;
			this.y = y;
		}	
		public int getX(){
		return this.x;
		}
		public int getY(){
		return this.y;
		}
	}
}
