#include"iostream" #include"algorithm" #include"cstring" #include"cstdio" #include"cmath" #include"vector" #include"map" #include"set" #include"queue" usingnamespace std; #define MAXN 1000006 //#define int long long #define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i) #define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i) #define pii pair<int,int> #define fi first #define se second #define mp make_pair #define pb push_back #define eb emplace_back #define vi vector<int> #define all(x) (x).begin() , (x).end() #define mem( a ) memset( a , 0 , sizeof a ) typedeflonglong ll; constdouble pi = acos( -1 ); int n , m; int R[MAXN];
boolchk( double x ){ double re = 0; rep( i , 1 , n ) if( x < 2 * R[i] * R[i] ) { re += acos( x / ( R[i] * R[i] ) - 1 ); } // printf("%.6lf\n",re); return re < 2 * pi; }
voidsolve(){ cin >> n; rep( i , 1 , n ) scanf("%d",R + i); double l = 0 , r = 3e12; rep( i , 1 , 100 ) { double mid = ( l + r ) / 2; if( chk( mid ) ) r = mid; else l = mid; } double re = 0; rep( i , 1 , n ) if( l < 2 * R[i] * R[i] ) { double th = acos( l / ( R[i] * R[i] ) - 1 ); re += R[i] * R[i] * ( th + sin( th ) ); } printf("%.10lf",re); }