#include #include #include using namespace std; struct point { int x; int y; }; int main(int argc, char** argv) { std::ios::sync_with_stdio(false); int m; while(cin >> m){ vector arr; for(int i =0; i < m ;++i){ int x,y; point p; cin >> x >> y; p.x = x; p.y = y; arr.push_back(p); } int matchCnt = 0; for(int i = 0; i < m; ++i){ for(int j = 0; j < m; ++j){ if(arr[i].x == arr[j].x && arr[i].y == arr[j].y) continue; if( abs(arr[i].x - arr[j].x) == abs(arr[i].y - arr[j].y) ){ matchCnt++; } } } cout << (float)matchCnt/((float)m*m) << endl; } return 0; }