import numpy as np import scipy import time import random p = float(input()) ax, ay = map(float, input().split()) bx, by = map(float, input().split()) cx, cy = map(float, input().split()) dx = (ax + bx + cx) / 3 dy = (ay + by + cy) / 3 def my_pow(x): return np.abs(x) ** p def f(point): x, y = point anorm = my_pow(ax - x) + my_pow(ay - y) bnorm = my_pow(bx - x) + my_pow(by - y) cnorm = my_pow(cx - x) + my_pow(cy - y) return pow(max(anorm, bnorm, cnorm) - min(anorm, bnorm, cnorm), 1.0 / p) def f2(point): x, y = point anorm = my_pow(ax - x) + my_pow(ay - y) bnorm = my_pow(bx - x) + my_pow(by - y) cnorm = my_pow(cx - x) + my_pow(cy - y) return max(anorm, bnorm, cnorm) - min(anorm, bnorm, cnorm) start = time.time() ans = [] best = 1e9 def check(X, Y): global ans, best cur = scipy.optimize.fmin(f, [X, Y], disp=False, maxiter=500, ftol=1e-12) if f(cur) < best: ans = cur best = f(cur) def check2(X, Y): global ans, best cur = scipy.optimize.fmin(f2, [X, Y], disp=False, maxiter=500, ftol=1e-12) if f(cur) < best: ans = cur best = f(cur) for scale in range(5, 7): for X in [-(10**scale), 10**scale]: for Y in [-(10**scale), 10**scale]: if time.time() - start < 1.3: # check(X, Y) check(X + dx, Y + dy) for scale in range(5, 7): for X in [-(10**scale), 10**scale]: for Y in [-(10**scale), 10**scale]: if time.time() - start < 1.3: check2(X + dx, Y + dy) while time.time() - start < 1.3: scale = random.randint(1, 6) X = random.randint(-(10**scale), 10**scale) Y = random.randint(-(10**scale), 10**scale) check(X + dx, Y + dy) print("{:.10f} {:.10f}".format(ans[0], ans[1]))