/* -*- coding: utf-8 -*- * * 55.cc: No.55 正方形を描くだけの簡単なお仕事です。 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ template struct Pt { T x, y; Pt() {} Pt(T _x, T _y) : x(_x), y(_y) {} Pt(const Pt& pt) : x(pt.x), y(pt.y) {} bool operator==(const Pt pt) const { return x == pt.x && y == pt.y; } Pt operator+(const Pt pt) const { return Pt(x + pt.x, y + pt.y); } Pt operator-() const { return Pt(-x, -y); } Pt operator-(const Pt pt) const { return Pt(x - pt.x, y - pt.y); } T dot(Pt v) const { return x * v.x + y * v.y; } T cross(Pt v) const { return x * v.y - y * v.x; } T d2() { return x * x + y * y; } }; typedef Pt pt; /* global variables */ pt pts[3]; /* subroutines */ /* main */ int main() { for (int i = 0; i < 3; i++) cin >> pts[i].x >> pts[i].y; for (int i = 0; i < 3; i++) { pt &p = pts[i]; pt v0 = pts[(i + 1) % 3] - p; pt v1 = pts[(i + 2) % 3] - p; if (v0.dot(v1) == 0 && v0.d2() == v1.d2()) { pt p3 = p + v0 + v1; printf("%d %d\n", p3.x, p3.y); return 0; } } puts("-1"); return 0; }