Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=70554
- from math import dist
- data = open('demo_2025_27_А.txt').readlines()
- a = []
- for i in range(1, len(data)):
- a.append(list(map(float, data[i].replace(',', '.').split())))
- min_sum = 10000000000000
- answ = ()
- for c1 in a:
- for c2 in a:
- sm = 0
- for x in a:
- sm += min(dist(x, c1), dist(x, c2))
- if sm < min_sum:
- min_sum = sm
- answ = (c1, c2)
- print(int(((answ[0][0] + answ[1][0]) / 2) * 10000), int(((answ[0][1] + answ[1][1]) / 2) * 10000))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement