Greedy
๋ฌธ์ ์ด๋ค.
๊ฐ๋จํ ๋ฌธ์ ๋ผ์ ๊ฐ๋ตํ๊ฒ ์ ๋ฆฌํ๋ค.
N = int(input())
rope, _max = list(), 0
for _ in range(N):
rope.append(int(input()))
rope.sort(reverse=True)
for i in range(N):
weight = rope[i] * (i + 1)
_max = _max if _max > weight else weight
print(_max)