#include using namespace std; #define FOR(i,a,b) for(auto i=a;i; using vvi=vector; using pii=pair; int main(){ ios::sync_with_stdio(false);cout.tie(0);cin.tie(0); while (1) { map d; map d2; int n; cin >> n; if (!cin) break; for (int i = 0; i < n; ++ i) { int x, y; cin >> x >> y; int dif = x + y; d[dif] ++; d2[x - y] ++; } ll good = 0; for (auto i = d.begin(); i != d.end(); ++ i) { good += (((i->bb))*((i->bb)-1)); } for (auto i = d2.begin(); i != d2.end(); ++ i) { good += (((i->bb))*((i->bb)-1)); } double res = (double)(good) / (double)(n*n); cout << res << endl; } return 0; }