from itertools import combinations

import numpy as np

N = int(eval(input()))

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

List = np.array(list(combinations(D,2)))

print((sum(np.product(List, axis = 1))))





N = int(eval(input()))

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

from itertools import accumulate

print((sum(list(d*c for d, c in zip(D[1:], accumulate(D))))))

from itertools import combinations
import numpy as np

N = int(eval(input()))
D = list(map(int, input().split()))
List = np.array(list(combinations(D, 2)))
print((sum(np.product(List, axis=1))))

N = int(eval(input()))
D = list(map(int, input().split()))
from itertools import accumulate

print((sum(list(d * c for d, c in zip(D[1:], accumulate(D))))))

-from itertools import combinations -import numpy as np - -List = np.array(list(combinations(D, 2))) -print((sum(np.product(List, axis=1)))) +from itertools import accumulate + +print((sum(list(d * c for d, c in zip(D[1:], accumulate(D))))))