#!/usr/bin/env python3
n, *d = map(int, open(0).read().split())
s = sum(d)
print(sum((s - i) * i for i in d)//2) n, *d = map(int, open(0).read().split()) n map(int, open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *d d s = sum(d) s sum(d) sum d print(sum((s - i) * i for i in d)//2) print sum((s - i) * i for i in d)//2 sum((s - i) * i for i in d) sum (s - i) * i s - i s i i 2 n, *d = map(int, open(0).read().split()) map(int, open(0).read().split()) n s = sum(d) sum(d) s
#!/usr/bin/env python3
n, *d = map(int, open(0).read().split())
s = sum(d)
print(sum((s - i) * i for i in d)//2)
