1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
/*
hdu3007
*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
using namespace std;
const double eps=1e-9;
void read(int& A);
struct POINT
{
double x,y;
inline POINT(){x=y=0;}
inline POINT(double xx,double yy):x(xx),y(yy){}
inline void inPut(){scanf("%lf%lf",&x,&y);}
}point[503];
struct LINE
{
POINT p1,p2;
inline LINE(){}
inline LINE(POINT pp1,POINT pp2):p1(pp1),p2(pp2){}
inline void inPut(){p1.inPut(),p2.inPut();}
inline void init(POINT pp1,POINT pp2){p1=pp1,p2=pp2;}
inline int dx(){return p2.x-p1.x;}
inline int dy(){return p2.y-p1.y;}
};
int n;
template<typename T>
inline bool Min(T a,T b){return a>b?b:a;}
template<typename T>
inline bool Max(T a,T b){return a<b?b:a;}
template<typename T>
inline T Abs(T a){return a<0?-a:a;}
inline double dis(POINT a,POINT b)
{
return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
inline POINT mid(POINT a,POINT b)
{
return POINT((a.x+b.x)/2,(a.y+b.y)/2);
}
/*
inline POINT cross(LINE a,LINE b)
{
double
Cabd=(crossPdt(a.p1,a.p2,b.p2)),
Cabc=(crossPdt(a.p1,b.p1,a.p2));
double
x=(Cabd*b.p1.x+Cabc*b.p2.x)/(Cabd+Cabc),
y=(Cabd*b.p1.y+Cabc*b.p2.y)/(Cabd+Cabc);
//cout<<Cabd+Cabc<<endl;
return POINT(x,y);
}
*/
struct CIRCLE
{
POINT O;
double r;
inline CIRCLE(){r=0;}
inline CIRCLE(POINT a,double rr):O(a),r(rr){}
inline void clear(){O.x=O.y=r=0;}
inline void init(POINT a,double rr){O=a,r=rr;}
inline void outPut(){printf("%.2f %.2f %.2f\n",O.x,O.y,r);}
inline void init(POINT a,POINT b)//two point as d
{
r=dis(a,b)/2.0;
O=mid(a,b);
}
inline void init(POINT a,POINT b,POINT c)
{
double
c1=(a.x*a.x+a.y*a.y-b.x*b.x-b.y*b.y)/2.0,
c2=(a.x*a.x+a.y*a.y-c.x*c.x-c.y*c.y)/2.0,
x=(c1*(a.y-c.y)-c2*(a.y-b.y))/((a.x-b.x)*(a.y-c.y)-(a.x-c.x)*(a.y-b.y)),
y=(c1*(a.x-c.x)-c2*(a.x-b.x))/((a.y-b.y)*(a.x-c.x)-(a.y-c.y)*(a.x-b.x));
O=POINT(x,y);
r=dis(O,a);
}
inline bool inCircle(POINT p)
{
return dis(p,O)+eps<r;
}
inline bool onCircle(POINT p)
{
return Abs(r-dis(p,O))<eps;
}
inline bool outCircle(POINT p)
{
return dis(O,p)>r+eps;
}
};
CIRCLE now;
int main()
{
//freopen("hdu3007.in","r",stdin);
//freopen("hdu3007.out","w",stdout);
while(scanf("%d",&n)!=EOF&&n!=0)
{
now.clear();
for(int i=1;i<=n;++i)
{
point[i].inPut();
}
now.init(point[1],point[2]);
for(int i=3;i<=n;++i)
{
if(now.outCircle(point[i]))
{
now.O=point[i];
for(int j=1;j<=i-1;++j)
{
if(now.outCircle(point[j]))
{
now.init(now.O,point[j]);
for(int k=1;k<=j-1;++k)
{
if(now.outCircle(point[k]))
{
now.init(point[i],point[j],point[k]);
}
}
}
}
}
}
now.outPut();
}
return 0;
}
void read(int& A)
{
char r;bool f=false;
for(r=getchar();(r<48||r>57)&&r!='-';r=getchar());
if(r=='-')f=true,r=getchar();
for(A=0;r>=48&&r<=57;r=getchar())A=A*10+r-48;
if(f)A=-A;
}
|