from itertools import combinations
N = int(input())
d = [int(x) for x in input().split()]

total = 0
for i in list(combinations(d, 2)):
    total += i[0] * i[1]
print(total) from itertools import combinations N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x d = [int(x) for x in input().split()] d [int(x) for x in input().split()] total = 0 total 0 for i in list(combinations(d, 2)):
    total += i[0] * i[1] i list(combinations(d, 2)) list combinations(d, 2) combinations d 2 total += i[0] * i[1] total i[0] * i[1] i[0] i 0 i[1] i 1 print(total) print total d = [int(x) for x in input().split()] [int(x) for x in input().split()] d N = int(input()) int(input()) N total = 0 0 total total += i[0] * i[1] i[0] * i[1] total
from itertools import combinations
N = int(input())
d = [int(x) for x in input().split()]

total = 0
for i in list(combinations(d, 2)):
    total += i[0] * i[1]
print(total)
