from itertools import combinations
n = int(input())
d = list(map(int, input().split()))
print(sum(d[i]*d[j] for i, j in combinations(range(n), 2))) from itertools import combinations 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(d[i]*d[j] for i, j in combinations(range(n), 2))) print sum(d[i]*d[j] for i, j in combinations(range(n), 2)) sum d[i]*d[j] d[i] d i d[j] d j n = int(input()) int(input()) n d = list(map(int, input().split())) list(map(int, input().split())) d
from itertools import combinations
n = int(input())
d = list(map(int, input().split()))
print(sum(d[i]*d[j] for i, j in combinations(range(n), 2)))