import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {


    public static class Point{
        private int x;
        private int y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        public int getX() {
            return x;
        }

        public void setX(int x) {
            this.x = x;
        }

        public int getY() {
            return y;
        }

        public void setY(int y) {
            this.y = y;
        }

        @Override
        public String toString() {
            return "Point{" +
                    "x=" + x +
                    ", y=" + y +
                    '}';
        }
    }


    public static boolean isUhlopriecka(Point p1, Point p2)
    {
        return Math.abs(p1.getX() - p2.getX()) == Math.abs(p1.getY() - p2.getY());
    }


    public static void main(String[] args) throws IOException {


        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));


        while (true) {
            String tmp = in.readLine();
            if (tmp == null) break;

            int numCities = Integer.parseInt(tmp);




            ArrayList<Point> cities = new ArrayList<>();
            for (int i = 0; i < numCities; i++){
                StringTokenizer stringTokenizer = new StringTokenizer(in.readLine());
                cities.add(new Point(Integer.parseInt(stringTokenizer.nextToken()), Integer.parseInt(stringTokenizer.nextToken())));
            }

            int possibleWins = 0;

            HashMap<Integer, Integer> northeast = new HashMap<>();
            HashMap<Integer, Integer> northwest = new HashMap<>();

            for(Point currentCity : cities)
            {
                int keyPlus = currentCity.getX() + currentCity.getY();
                int keyMinus = currentCity.getX() - currentCity.getY();
                if(northeast.containsKey(keyPlus))
                {
                    northeast.put(keyPlus, northeast.get(keyPlus) + 1);
                } else  {
                    northeast.put(keyPlus, 0);
                }
                if(northwest.containsKey(keyMinus))
                {
                    northwest.put(keyMinus, northwest.get(keyMinus) + 1);
                } else  {
                    northwest.put(keyMinus, 0);
                }
            }

            for(Map.Entry<Integer, Integer> entry : northeast.entrySet())
            {
                possibleWins += (entry.getValue() * (entry.getValue()+1));
            }
            for(Map.Entry<Integer, Integer> entry : northwest.entrySet())
            {
                possibleWins += (entry.getValue() * (entry.getValue()+1));
            }
            System.out.println((float)possibleWins / (float)(numCities * numCities));

        }




    }
}
