#include using namespace std; struct Point { int X; int Y; Point() { X = Y = 0; } Point(int x, int y) { X = x; Y = y; } }; int main() { std::ios_base::sync_with_stdio(false); Point* points; int pocet; while(true) { cin >> pocet; if(cin.eof()) break; points = new Point[pocet]; for(int i = 0; i < pocet; i++) { cin >> points[i].X; cin >> points[i].Y; } int celkem = pocet * pocet; int jeVyhra = 0; for(int i = 0; i < pocet; i++) { for(int j = i + 1; j < pocet; j++) { if(abs(points[i].X - points[j].X) == abs(points[i].Y - points[j].Y)) { jeVyhra+=2; } } } cout << (float)jeVyhra / celkem << endl; delete[] points; } return 0; }