from itertools import *
N = int(input())
D = list(map(int,input().split()))
print(sum(x*y for x,y in combinations(D,2))) from itertools import * N = int(input()) N int(input()) int input() input D = list(map(int,input().split())) D list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split print(sum(x*y for x,y in combinations(D,2))) print sum(x*y for x,y in combinations(D,2)) sum x*y x y D = list(map(int,input().split())) list(map(int,input().split())) D N = int(input()) int(input()) N
from itertools import *
N = int(input())
D = list(map(int,input().split()))
print(sum(x*y for x,y in combinations(D,2)))