1912 - [蓝桥杯 2022 省 A] 求和
Description

给定 n 个整数 a_{1}, a_{2}, \cdots, a_{n}, 求它们两两相乘再相加的和,即

S=a_{1} \cdot a_{2}+a_{1} \cdot a_{3}+\cdots+a_{1} \cdot a_{n}+a_{2} \cdot a_{3}+\cdots+a_{n-2} \cdot a_{n-1}+a_{n-2} \cdot a_{n}+a_{n-1} \cdot a_{n}


Input

输入的第一行包含一个整数 n

第二行包含 n 个整数 a_{1}, a_{2}, \cdots a_{n}


Output

输出一个整数 S,表示所求的和。请使用合适的数据类型进行运算。

Examples

Input

4
1 3 6 9

Output

117
Hint

对于 30 \% 的数据, 1 \leq n \leq 1000,1 \leq a_{i} \leq 100

对于所有评测用例, 1 \leq n \leq 2\times10^5,1 \leq a_{i} \leq 1000 。 

蓝桥杯 2022 省赛 A 组 C 题。


题目参数
Time Limit 1 second
Memory Limit 128 MB
提交次数 27
通过次数 11