n=int(input())
l=sorted(list(map(int,input().split())))

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

cnt=0
for i in range(0,n-1):
    for j in range(i+1,n):
        cnt+=l[i]*l[j]
print(cnt)