728x90
1) 문제
2) 코드
N = int(input())
tmp = list(map(int, input().split()))
x = []
for i in range(0, N):
x.append([])
x[i].append(tmp[i])
for i in range(0, N):
d = 0
for j in range(0, N):
d += abs(x[i][0] - x[j][0])
x[i].append(d)
x.sort(key=lambda k: (k[1], k[0]))
print(x[0][0])