n = int(input())
arr_num = []
for _ in range(n):
arr_num.append(int(input()))
arr_num.sort(reverse=True)
result = []
for i in range(n):
result.append(arr_num[i] * (i+1))
print(max(result))
import sys
ex = int(input())
for _ in range(ex):
arr_n = []
n = int(input())
count = 1
for _ in range(n):
arr_n.append(list(map(int, sys.stdin.readline().split())))
arr_n.sort()
min_n = arr_n[0][1]
for ar in arr_n:
if ar[1] < min_n:
count += 1
min_n = ar[1]
print(count)
집중을 못한건지 계속 틀렸다ㅜㅜ
a, b, c = 300, 60, 10
result = [0] * 3
T = int(input())
while True:
if T >= a:
result[0] += (T // a)
T %= a
if T >= b:
result[1] += (T // b)
T %= b
if T >= c:
result[2] += (T // c)
T %= c
if T < c:
break
if T == 0:
print(str(result[0]) + " " + str(result[1]) + " " + str(result[2]))
# print(result[0], result[1], result[2])
# print("{} {} {}".format(result[0], result[1], result[2]))
else:
print(-1)
많이 풀어봐서 익숙해진 유형