#include using namespace std; typedef long long ll; typedef pair ii; typedef vector vi; typedef vector vii; #define ALL(x) (x).begin(),(x).end() #define ff first #define ss second #define D(a) cerr << ">> " << #a << " = >" << a << "<" << endl #define PB push_back #define F(i,a,b) for ( int i = (a); i < (b); ++i ) #define FD(i,a,b) for ( int i = (a); i >= (b); --i ) #define R1(a) scanf("%d",&a) #define R2(a,b) scanf("%d%d",&a,&b) #define R3(a,b,c) scanf("%d%d%d",&a,&b,&c) #define DR1(a) int a; scanf("%d",&a) #define DR2(a,b) int a,b; scanf("%d%d",&a,&b) #define DR3(a,b,c) int a,b,c; scanf("%d%d%d",&a,&b,&c) const int INF = 1e9+7; const int DEBUG = 0; const ii T = { 1, 100 }; const ii M = { 1, 100 }; // size of photo const ii C = { -1e9, +1e9 }; // range of coordinates const ii N = { 1, 1e6 }; bool between(int value, int lower, int upper) { return value >= lower && value <= upper; } int main( ) { int n, x, y; char garbage; // assert(cin >> t && between(t, T.first, T.second)); while (R1(n) == 1) { map diag1, diag2; long res = 0; assert(between(n, N.first, N.second)); for (int i = 0; i < n; ++i) { assert(R2(x,y) == 2 && between(x, C.first, C.second) && between(y, C.first, C.second)); int d1 = x + y; int d2 = x - y; res += diag1[d1]; res += diag2[d2]; ++diag1[d1]; ++diag2[d2]; } printf("%e\n", 2.0 * res / n / n); } assert(scanf("%c", &garbage) == EOF); return 0; }