class BIT: def __init__(self, n): self.n = n self.data = [0] * (n + 1) if n == 0: self.n0 = 0 else: self.n0 = 1 << (n.bit_length() - 1) def sum_(self, i): s = 0 while i > 0: s += self.data[i] i -= i & -i return s def sum(self, l, r=-1): if r == -1: return self.sum_(l) else: return self.sum_(r) - self.sum_(l) def get(self, i): return self.sum(i, i + 1) def add(self, i, x): i += 1 while i <= self.n: self.data[i] += x i += i & -i def lower_bound(self, x): if x <= 0: return 0 i = 0 k = self.n0 while k > 0: if i + k <= self.n and self.data[i + k] < x: x -= self.data[i + k] i += k k //= 2 return i + 1 n = int(input()) xy = [list(map(int, input().split())) for _ in range(n)] xy.sort(key=lambda x: x[0]) Y_ = sorted(set(y for _, y in xy)) dic = {y: i for i, y in enumerate(Y_)} add = [] b = xy[0][0] bit = BIT(len(Y_)) p = 0 q = 0 for x, y in xy: y = dic[y] if b == x: add.append(y) else: for y_ in add: bit.add(y_, 1) add = [y] b = x p += bit.sum(y) q += bit.sum(y + 1, len(Y_)) X = [x for x, _ in xy] X.sort() r = n * (n - 1) // 2 row = 0 b = X[0] for x in X: if b == x: r -= row row += 1 else: row = 1 b = x Y = [y for _, y in xy] Y.sort() s = n * (n - 1) // 2 row = 0 b = Y[0] for y in Y: if b == y: s -= row row += 1 else: row = 1 b = y ans = (p - q) / ((r * s) ** 0.5) print(ans)