n=int(input())
L=[int(input()) for i in range (n)]
L.sort()
L.reverse()
z=0
for i in range (n):
if i%3==2:
continue
else:
z+=L[i]
print(z)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
3300 KB |
Output is correct |
2 |
Correct |
26 ms |
3300 KB |
Output is correct |
3 |
Correct |
27 ms |
3300 KB |
Output is correct |
4 |
Correct |
26 ms |
3300 KB |
Output is correct |
5 |
Correct |
28 ms |
3300 KB |
Output is correct |
6 |
Correct |
315 ms |
7088 KB |
Output is correct |
7 |
Correct |
278 ms |
7416 KB |
Output is correct |
8 |
Correct |
305 ms |
7296 KB |
Output is correct |
9 |
Correct |
346 ms |
7836 KB |
Output is correct |
10 |
Correct |
334 ms |
7856 KB |
Output is correct |