/* Reference: locate the range of these vertices, and use two vertices (E1 and E2 in the Code). 2. Generate num vertices within the range (Num-customized) 3. For each generated vertex I, generate num points around it. If it is a bit better than I, replace it. 4. narrow the range D. If D is less than precision, exit. Otherwise, 35 is executed to traverse all num points, find the maximum value of Val */# include <iostream> # include <cstdio> # include <cstdlib> # include <cmath> # include <cstring> # include <string> # include <Algorithm> # include <set> # include <map> # include <ctime> using namespace STD; const int num = 30; const int rad = 1000; struct point {Double X, Y, Val; point () {} Point (double _ x, double _ y ): X (_ x), y (_ y) {}} P [101], may [num], E1, E2; int N; double DIS (point a, point B) {Return SQRT (. x-b.x) * (. x-b.x) +. y-b.y) * (. y-b.y);} double judge (point t) // evaluation function, get the evaluation value of point t Val {double Len = 0; For (INT I = 0; I <N; I ++) Len + = DIS (T, P [I]); Return Len;} double rand () {return rand () % (RAD + 1) /(1.0 * rad);} // randomly generate a floating point number of 0-1. Point rand_point (point a, point B) // At, point {point TMP = point (. X + (B. x-a.x) * rand (),. Y + (B. y-a.y) * rand (); TMP. val = judge (TMP); Return TMP;} void solve (double D) {for (INT I = 0; I <num; I ++) May [I] = rand_point (E1, E2); // Step 2 while (D> 0.1) // step 3 {for (INT I = 0; I <num; I ++) for (Int J = 0; j <num; j ++) {point TMP = rand_point (point (may [I]. x-D, may [I]. y-d), point (may [I]. X + D, may [I]. Y + D); If (TMP. val <may [I]. val) {may [I] = TMP ;}d * = 0.9;} double ans = 1ll <45; For (INT I = 0; I <num; I ++) if (may [I]. val <ans) ans = may [I]. val; printf ("% 0. f \ n ", ANS);} int main () {srand (time (0); e1 = point (-10001,-10001); E2 = point (10001,10001 ); while (scanf ("% D", & N )! = EOF) {for (INT I = 0; I <n; I ++) {scanf ("% lf", & P [I]. x, & P [I]. y); e1.x = min (e1.x, P [I]. x); // set the initial range to e1.y = min (e1.y, P [I]. y); e2.x = max (e2.x, P [I]. x); e2.y = max (e2.y, P [I]. y);} solve (max (e2.y-e1.y, e2.x-e1.x ));}}