AT_abc405_c [ABC405C] Sum of Product
Description
長さ $ N $ の整数列 $ A=(A_1,A_2,\dots,A_N) $ が与えられます。
$ \displaystyle \sum_{1\leq i< j\leq N} A_iA_j $ の値を求めてください。
Input Format
入力は以下の形式で標準入力から与えられる。
> $ N $ $ A_1 $ $ A_2 $ $ \dots $ $ A_N $
Output Format
答えを出力せよ。
Explanation/Hint
### Sample Explanation 1
$ \displaystyle \sum_{1\leq i< j\leq N} A_iA_j=A_1A_2+A_1A_3+A_2A_3=4\cdot 2+4\cdot 3+2\cdot 3=26 $ です。
### Constraints
- $ 2\leq N \leq 3\times 10^5 $
- $ 1\leq A_i \leq 10^4 $
- 入力は全て整数