// No.55 正方形を描くだけの簡単なお仕事です。 #include #include using namespace std; int main() { vector X(3); vector Y(3); for (int i = 0; i < 3; ++i) cin >> X[i] >> Y[i]; for (int i = 0; i < 3; ++i) { int dx1 = X[(i + 2) % 3] - X[i]; int dy1 = Y[(i + 2) % 3] - Y[i]; int dx2 = X[(i + 1) % 3] - X[i]; int dy2 = Y[(i + 1) % 3] - Y[i]; if (dx1 * dx2 + dy1 * dy2 != 0) continue; if (dx1 * dx1 + dy1 * dy1 != dx2 * dx2 + dy2 * dy2) continue; cout << X[(i + 1) % 3] + dx1 << " "; cout << Y[(i + 1) % 3] + dy1 << endl; return 0; } cout << -1 << endl; }