#include #include using namespace std; struct Mesto { int x, y; }; int main(void) { while(true) { int pocet; cin >> pocet; if(cin.eof()) break; Mesto * pole = new Mesto[pocet]; for(int i = 0; i < pocet; i++) { cin >> pole[i].x >> pole[i].y; } int pocitadlo = 0; for(int i = 0; i < pocet; i++) { for(int j = 0; j < pocet; j++) { if(i == j) continue; if(fabs(pole[i].x - pole[j].x) == fabs(pole[i].y - pole[j].y)) pocitadlo++; } } double vysledek = (double)pocitadlo / (double)(pocet*pocet); cout << vysledek << endl; delete [] pole; } return 0; }