Hdu 3265 Posters
/// Give you a number of circles without intersection, and create a circle with the center of one of the circles as the center. // make sure the circle contains at least half of all the circular areas, find the smallest radius of the circle # include
# Include
# Include
# Include
# Include
Using namespace std; struct node {double x; double y; double r ;}; int t1, t2; double rr; const double d = 1e-10; const double pi = acos (-1.0); struct node a [25]; double ss; double cal (int x1, int y1) /// the distance between the two circles {return sqrt (a [x1]. x-a [y1]. x) * (a [x1]. x-a [y1]. x) * 1.0 + (a [x1]. y-a [y1]. y) * (a [x1]. y-a [y1]. y) * 1.0);} double area (double mid) // calculates the cross area of the two circles {double a = cal (t1, t2), B = rr, c = mid; double cta1 = acos (a * a + B * B-c * c)/2/(a * B), cta2 = acos (a * a + c * c-B * B) /2/(a * c); double s1 = rr * cta1-rr * sin (cta1) * (a * a + B * B-c * c)/2/(a * B); double s2 = mid * cta2-mid * sin (cta2) * (a * a + c * c-B * B)/2/(a * c); return s1 + s2;} double f (double m) {if (area (m)-ss> = 1e-20) return 1; else return 0;} int main () {int t, n, I, j; double min1, max1, min2, max2, jj; while (~ Scanf ("% d", & t) {while (t --) {scanf ("% d", & n); for (I = 0; I
D) // binning area {double mid = (l + r)/2; if (f (mid) = 1) r = mid; else l = mid ;} ll = max (ll, l) ;}} lll = min (lll, ll);} printf ("%. 4lf \ n ", lll) ;}} return 0 ;}