This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
import math
num=int(input())
x=[]
y=[]
xval={}
yval={}
for i in range(num):
x[i], y[i] = map(int, input().split())
for i in range(num):
for j in range(i+1,num):
xval[x[i]]=xval.get(x[i],0) + abs(x[i]-x[j])
xval[x[j]]=xval.get(x[j],0) + abs(x[i]-x[j])
for i in range(num):
for j in range(i+1,num):
yval[y[i]]= yval.get(y[i],0) + abs(y[i]-y[j])
yval[y[j]]= yval.get(y[j],0) + abs(y[i]-y[j])
print(min(xval, key=xval.get),min(yval, key=yval.get))
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |