n=int(eval(input()))

a=list(map(int,input().split()))

import itertools as it

import numpy as np

al=list(it.combinations(a,2))

total=0

for i in al:

    total+=np.prod(i)

print(total)
n=int(eval(input()))

a=list(map(int,input().split()))

ans=0

for i in range(n-1):

    for j in range(i+1,n):

        ans+=a[i]*a[j]

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
import itertools as it
import numpy as np

al = list(it.combinations(a, 2))
total = 0
for i in al:
    total += np.prod(i)
print(total)

n = int(eval(input()))
a = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        ans += a[i] * a[j]
print(ans)

-import itertools as it -import numpy as np - -al = list(it.combinations(a, 2)) -total = 0 -for i in al: -    total += np.prod(i) -print(total) +ans = 0 +for i in range(n - 1): +    for j in range(i + 1, n): +        ans += a[i] * a[j] +print(ans)