#include #include #include #include #include using namespace std; const double e = 0.001; struct Point{ double x, y; }; struct Line{ double a, b, c; }; bool pos(Line a, Point b) { return (a.a * b.x + a.b * b.y + a.c < e); } int main() { int n, m = 0; cin >> n; vector p(n); vector bis(n); for (int i = 0; i < n; ++i) cin >> p[i].x >> p[i].y; for (int i = 0; i < n; ++i) { int l = i - 1, r = (i + 1) % n; if (i == 0) l = n - 1; double a, b; Point v1 = { p[l].x - p[i].x, p[l].y - p[i].y }, v2 = { p[r].x - p[i].x, p[r].y - p[i].y }, mid; a = sqrt(v1.x * v1.x + v1.y * v1.y ); b = sqrt(v2.x * v2.x + v2.y * v2.y); v1.x /= a; v1.y /= a; v2.x /= b; v2.y /= b; mid.x = (v1.x + v2.x) / 2; mid.y = (v1.y + v2.y) / 2; bis[m].a = mid.x - p[i].x; bis[m].b = mid.y - p[i].y; bis[m].c = -1 * (bis[m].a * p[i].x + bis[m].b * p[i].y); m++; } Point rez; rez.x = -1 * (bis[0].a * bis[1].c - bis[1].a * bis[0].c) / (bis[1].a * bis[0].b - bis[0].a * bis[1].b); rez.y = -1 * (bis[1].c * bis[0].b - bis[0].c * bis[1].b) / (bis[1].a * bis[0].b - bis[0].a * bis[1].b); bool t = true; for (int i = 2; i < n; ++i) if (!pos(bis[i], rez)) t = false; if (t) { double d = abs(bis[0].a * rez.x + bis[0].b + rez.y + bis[0].c) / sqrt(bis[0].a * bis[0].a + bis[0].b * bis[0].b); cout << "YES" << endl << fixed << setprecision(3) << rez.x << " " << rez.y << " " << d << endl; } else cout << "NO" << endl; }