问题2486--Nice Trick

2486: Nice Trick

时间限制: 10 Sec  内存限制: 128 MB
提交: 4  解决: 2
[提交] [状态] [讨论版] [命题人:]

题目描述


输入

The input contains zero or more test cases and is terminated by end-of-file. For each test case,
The first line contains an integer n.
The second line contains n integers a1, a2, . . . , an.
• 1≤n≤105
• 0 ≤ ai ≤109
• The number of tests cases does not exceed 10.

输出

For each case, output an integer which denotes the result.

样例输入

3
1 2 3
4
1 2 3 4
5
1 2 3 4 5

样例输出

0
24
274

来源/分类


[提交] [状态]