#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; class UnionFind { using data_type = size_t; const data_type none = -1; vector data_; set roots_; vector size_; data_type root(data_type index) { if(data_[index] == none) return index; data_[index] = root(data_[index]); return data_[index]; } public: UnionFind(data_type size) : data_(size, none), size_(size, 1) { } void unite(data_type a, data_type b) { a = root(a); b = root(b); if(a == b) return; if(size_[a] < size_[b]) { data_[b] = a; size_[b] = size_[a] + size_[b]; roots_.erase(a); roots_.insert(b); } else { data_[a] = b; size_[a] = size_[a] + size_[b]; roots_.erase(b); roots_.insert(a); } } bool isUnion(data_type a, data_type b) { return root(a) == root(b); } const set& roots() { return roots_; } }; int main() { constexpr int repeater_range = 10; constexpr int tranceiver_range = 1; int N; cin >> N; if(N == 0) { cout << 1 << endl; return 0; } vector X(N), Y(N); UnionFind uf(N); for(int i=0; i> X[i] >> Y[i]; for(int i=0; i max_length) max_length = distance_squared; } } cout << setprecision(11) << sqrt(max_length) + 2 << endl; }