import itertools
n = int(input())
a = list(map(int, input().split()))
pattern = itertools.combinations(a, 2)
total = 0
for i, j in pattern:
    total += i * j
print(total)

dc80d82b7b52ed28a14ad186a550b194e94c0484
<mask token>

<mask token>
for i, j in pattern:
    total += i * j
print(total)

<mask token>
n = int(input())
a = list(map(int, input().split()))
pattern = itertools.combinations(a, 2)
total = 0
for i, j in pattern:
    total += i * j
print(total)

import itertools
n = int(input())
a = list(map(int, input().split()))
pattern = itertools.combinations(a, 2)
total = 0
for i, j in pattern:
    total += i * j
print(total)
