문제 주소: https://www.acmicpc.net/problem/2217
난이도: silver 4
n = int(input())
ropes = []
for i in range(n):
ropes.append(int(input()))
ropes.sort()
ans = 0
for rope in ropes:
if rope*n > ans:
ans = rope*n
n -= 1
print(ans)
import heapq
ans = 0
n = int(input())
ropes = []
for i in range(n):
heapq.heappush(ropes, int(input()))
for i in range(n):
if ropes[0] * n > ans:
ans = ropes[0] * n
heapq.heappop(ropes)
n -= 1
print(ans)