ํ์ด
์ฐ์ ํ๊ท , ์ค์๊ฐ, ๋ฒ์ ๋ ํ์ด์ฌ ๊ธฐ๋ณธ ํจ์๋ก ์ด๋ ต์ง์๊ฒ ํ ์ ์๋ค.
์ต๋น๊ฐ ์ญ์ ์ ์ ๋ฒ์๊ฐ -4000 ์์ +4000 ๊น์ง ์ฃผ์ด์ ธ ์์๊ธฐ ๋๋ฌธ์ 0 ์ผ๋ก ๊ตฌ์ฑ๋ 8001๊ฐ ์ง๋ฆฌ ๋ฆฌ์คํธ๋ฅผ ๋ง๋ค์ด ์ธ๋ฑ์ค๊ฐ์ ํตํด ๊ตฌํ๋ ๋ฐฉ๋ฒ๋ ์์์ง๋ง, collections ๋ชจ๋์ ํตํด์ ๋ ๊ฐํธํ๊ฒ ๊ตฌํ ์ ์๋ค.
์์ค์ฝ๋
import collections
N = int(input())
nums = sorted([int(input()) for _ in range(N)])
most = collections.Counter(nums).most_common()
print(int(round(sum(nums)/N)))
print(nums[N//2])
if len(most) > 1:
print(most[1][0]) if most[0][1] == most[1][1] else print(most[0][0])
else:
print(most[0][0])
print(max(nums) - min(nums))