N = int(input())
D = list(map(int, input().split()))
S_1 = sum(D)
S_2 = sum([d**2 for d in D])
print((sum(D)**2-S_2)//2) N = int(input()) N int(input()) int input() input D = list(map(int, input().split())) D list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split S_1 = sum(D) S_1 sum(D) sum D d**2 for d in D for d in D d D for d in D d**2 d 2 S_2 = sum([d**2 for d in D]) S_2 sum([d**2 for d in D]) sum [d**2 for d in D] print((sum(D)**2-S_2)//2) print (sum(D)**2-S_2)//2 sum(D)**2-S_2 sum(D)**2 sum(D) sum D 2 S_2 2 N = int(input()) int(input()) N D = list(map(int, input().split())) list(map(int, input().split())) D S_1 = sum(D) sum(D) S_1 S_2 = sum([d**2 for d in D]) sum([d**2 for d in D]) S_2
N = int(input())
D = list(map(int, input().split()))
S_1 = sum(D)
S_2 = sum([d**2 for d in D])
print((sum(D)**2-S_2)//2)