柳予欣的选择(二)

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

柳予欣饿了,想要吃东西。现在有n个食物,第i个食物的种类是ai(1<=ai<=1e9)。柳予欣吃东西喜欢同时吃两个不同种类的食物, 这样会增加她一点愉悦值,否则就不加。现在请问所有分配决策中能够获得的最大的愉悦值是多少?

Format

Input

一个数字n(1 <= n <= 4.5e6)代表有几个食物,接下来一行n个数字,第i个数字ai代表每个食物的种类。

Output

输出一个数字,代表最大愉悦值。

Samples

3
1 2 3
1

2025_SDNU_国庆纳新题单

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
20
Start at
2025-9-30 14:30
End at
2025-10-8 22:30
Duration
200 hour(s)
Host
Partic.
22