Problem:
 Score : 200 points    Problem Statement It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i -th takoyaki is d_i .  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.      Constraints  All values in input are integers.  2 \leq N \leq 50  0 \leq d_i \leq 100         Input Input is given from Standard Input in the following format:  N  d_1  d_2  ...  d_N       Output Print the sum of the health points restored from eating two takoyaki over all possible choices of two takoyaki from the N takoyaki served.        Sample Input 1 3
3 1 2      Sample Output 1 11  There are three possible choices:   Eat the first and second takoyaki. You will restore 3 health points.  Eat the second and third takoyaki. You will restore 2 health points.  Eat the first and third takoyaki. You will restore 6 health points.   The sum of these values is 11 .       Sample Input 2 7
5 0 7 8 3 3 2      Sample Output 2 312

Solution (Python):
N=int(input())
d= list(map(int,input().split()))
ans = 0
for i in range(N):
    for ii in range(i+1, N):
        ans += d[i]*d[ii]
print(ans)

Solution (Python):
N=int(input())
d= list(map(int,input().split()))
ans = 0
for i in range(N):
    for ii in range(i+1, N):
        ans += d[i]*d[ii]
print(ans)

Solution (Python):
N = int(input())
D = list(map(int, input().split()))
s = 0

for i in range(N):
    for j in range(i+1, N):
        s += D[i] * D[j]

print(s)

Solution (Python):
N=int(input())
x=list(map(int,input().split()))

HP=0
for i in range(N):
  for j in range(N):
    if i!=j:
      HP1=x[i]*x[j]
      HP=HP+HP1

print(int(HP/2))

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
  for j in range(N):
    if i > j:
      sum+= d[i]*d[j]
    else:
      continue
print(sum)

Solution (Python):
N = int(input())

d = list(map(int, input().split()))
e = []
for i in range(len(d) - 1):
    e.append(d[i] * sum(d[(i + 1):]))

print(sum(e))

Solution (Python):
N =int(input())
h = list(map(int, input().split()))

result=0
for i in range(N):
   for j in range(i+1,N):
       result += h[i]*h[j]

print(result)

Solution (Python):
N = int(input())
list_d = list(map(int,input().split()))

count = 0

for i in range(N):
    for j in range(i+1,N):
        count += list_d[i]*list_d[j]

print(count)

Solution (Python):
from itertools import combinations

N = int(input())
d = list(map(int, input().split(" ")))

def HP(tako1, tako2):
    return tako1*tako2

total_HP = 0
tako_combos = combinations(d, 2)
for takos in tako_combos:
    tako1 = takos[0]
    tako2 = takos[1]

    total_HP += HP(tako1, tako2)

print(total_HP)

Solution (Python):


import math
import itertools

t = input()
l = input().split()
total = 0


for i in itertools.combinations(l, 2):
    total += int(i[0]) * int(i[1])

print(total)

Solution (Python):
n = int(input())
a = input().split()
l = len(a)

sum = 0

for j in range(0, n):
    for i in range(1, l):
        m = int(a[0]) * int(a[i])
        sum += m
    del a[0]
    l = len(a)

print (sum)

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
ans = int(0)
for i in range(N):
    for j in range(i+1,N):
        ans += d[i]*d[j]
print(ans)

Solution (Python):
import itertools

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

total = 0
for d in itertools.combinations(D, 2):
  total += d[0] * d[1]

print(total)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
total = 0
for i in range(N):
    for j in range(i+1,N):
        total += d[i] * d[j]
print(total)

Solution (Python):
n = int(input())
list =   [int(x) for x in input().split()]
sum = 0
for i in range(n):
    for j in range(n-1):
        if i + j + 1 >= n:
            continue
        sum += list[i] * list[i+j+1]
print(sum)

Solution (Python):
n=int(input())
d=list(map(int,input().split(' ')))

ans=0

for i in range(n):
    for j in range(i,n):
        if i!=j:
            ans += d[i]*d[j]

print(ans)

Solution (Python):
n = int(input())
d = list(map(int, input().split(' ')))
s=0
s2=0
for x in d:
	s+=x
	s2+=x*x
print((s*s-s2)//2)

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
ans = 0

for i in range(n-1):
    for j in range(i+1, n):
        ans += d[i] * d[j]

print(ans)

Solution (Python):
import itertools

n = int(input())
d_list = input().split()

r = 2
ncr_list = list(itertools.combinations(d_list, r))

hp = 0
for ncr in ncr_list:
	hp += int(ncr[0]) * int(ncr[1])
	
print(hp)

Solution (Python):
n=int(input())
L=list(map(int,input().split()))
s=0
for i in range(n-1):
    for j in range(i+1,n):
        s += L[i] * L[j]
print(s)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=0
for i in range(n):
    for j in range(n):
        b+=a[i]*a[j]
    b-=a[i]**2
print(b//2)

Solution (Python):
N = input()
D = list(map(int,input().split()))
K = 0
for i in range(0,len(D)):
  for j in range(i+1,len(D)):
    a = int(D[i])
    b = int(D[j])
    K = K + a*b
print(K)

Solution (Python):
N = int(input())

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

total = 0
for i in range(N):
    for j in range(i+1, N):
        total += d[i] * d[j]

print(total)

Solution (Python):
N=int(input())
d=input().split()

S_=0
for i in range(N-1):
    for j in range(i+1,N):
            S=int(d[i])*int(d[j])
            S_+=S
print(S_)

Solution (Python):
n = int(input())
d = [int(x) for x in input().split()]
sum = 0
for i in range(n):
    for j in range(i+1,n):
        sum += d[i]*d[j]
print(sum)

Solution (Python):
import numpy as np
N = int(input())
d = np.array(input().split()).astype(int)
a = np.outer(d,d)
np.fill_diagonal(a, 0)
a = np.triu(a)
print(a.sum())

Solution (Python):

import itertools


N = int(input())
TAKOYAKIS = [int(i) for i in input().split()]

combinations = list(itertools.combinations(TAKOYAKIS, 2))

healing_value = []
for c in combinations:
    healing_value.append(c[0] * c[1])
    

print(sum(healing_value))

Solution (Python):
n=int(input())
d=list(map(int,input().split()))
result=0
for i in range(n-1):
  for j in range(i+1,n):
    result+=d[i]*d[j]
print(result)

Solution (Python):
import itertools

class TakoyakiFestival:
    def __init__(self):
        self.N = int(input())
        self.T = list(map(int,input().split(' ')))
  
        self.souwa = 0

    def solve(self):
        takokumi = list(itertools.combinations(self.T, 2))
        for i1, i2 in takokumi:
            self.souwa += (i1 * i2)
        return self.souwa

tako = TakoyakiFestival()
ans = tako.solve()

print(ans)

Solution (Python):
n = int(input())

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

tmp = 0

for i in range(n-1):
	for j in range(i+1,n):
		tmp += darr[i] * darr[j]
		
print(tmp)

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

Solution (Python):
N=int(input())
takoyaki=list(map(int,input().split()))
count=0
for i in range(0,N-1):
  for j in range(i+1,N):
    count+=takoyaki[i]*takoyaki[j]
print(count)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))

sum = 0
for i in range(N):
  for j in range(i+1, N):
    sum += d[i]*d[j]
    
print(sum)

Solution (Python):
N = int(input())
d = input().split()

sum = 0
for i in range(len(d)):
  for j in range(i+1, len(d)):
    sum = sum + int(d[i])*int(d[j])
    
print(sum)

Solution (Python):
n=int(input())
D=list(map(int,input().split()))
r=0
for i in range(n):
    for j in range(i+1,n):
        r+=D[i]*D[j]
print(r)

Solution (Python):
import itertools as it

n = int(input())
d = map(int, input().split())

l = it.permutations(d, 2)

temp = 0

for i in l:
    temp += i[0] * i[1]

print(temp // 2)

Solution (Python):
N = int(input())
tako = list(map(int, input().split()))
a=0
for i in range(N):
  for j in range(i,N):
    if i !=j: a+=tako[i]*tako[j]  
print(a)

Solution (Python):
from itertools import*;input();print(sum([n*m for n,m in combinations(map(int,input().split()),2)]))

Solution (Python):
import itertools

N = int(input())
takoyakis = map(int, input().split())
s = 0

for n1,n2 in itertools.combinations(takoyakis, 2):
  s += n1*n2
  
print(s)

Solution (Python):



in_N = [int(i) for i in input().split()];
in_d = [int(i) for i in input().split()];





total = 0;
for i in range(in_N[0]):
    for j in range(len(in_d)-1):
        
        
        if(i+j+1 == len(in_d)):break;
        total += in_d[i]*in_d[i+j+1];

print(total);

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
sum = 0

for i in range(N):
    for j in range(i+1, N):
        sum += d[i] * d[j]
print(sum)

Solution (Python):
N=int(input())
val=list(map(int, input().split()))
s=0
for i in range(N):
  for k in range(N-1-i):
    j=i+1+k
    s=s+val[i]*val[j]
print(s)

Solution (Python):
import numpy as np 

N = int(input())
d = np.array(list(map(int, input().split())))

print((d.sum()**2 - (d**2).sum()) // 2)

Solution (Python):
n = int(input())
d = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    x = list(map(lambda a : a * d[i],d))
    ans += sum(x) - x[i]
print(int(ans / 2))

Solution (Python):
N = int(input())

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

ans = 0
for i in range(N-1):
  for j in range(i+1,N):
    ans += D[i] * D[j]
    
print(ans)

Solution (Python):
N = int(input())
d = list(int(i) for i in  input().split())
ans = 0
sumd = sum(d)
for i in range(N):
	ans += d[i] * (sumd - d[i])
print(int(ans/2))

Solution (Python):
r = lambda : map(int, input().split(' '))

n = int(input())
a = list(r())
ans = 0
for i in range(n):
  for j in range(i+1,n):
    ans += a[i]*a[j]
print(ans)

Solution (Python):
n=int(input())
d=list(map(int,input().split()))
sums=0
for i in range(n):
  for j in range(i,n):
    if i!=j:sums+=d[i]*d[j]
print(sums)

Solution (Python):
import itertools
n = int(input())
input_list = list(map(int, input().split()))
comb_list = list(itertools.combinations(input_list, 2))
sum = 0
for i in range(len(comb_list)):
    sum += comb_list[i][0]*comb_list[i][1]
print(sum)

Solution (Python):
'''n,k = input().split()
n = int(n)
k = int(k)
'''

n = int(input())
m = list(map(int,input().split()))
out = 0
for i in range(n):
    for j in range(i):
       out += m[i]*m[j]

print(out)

Solution (Python):
n=int(input())
d=list(map(int,input().split()))


ans=0
for i in range(0,n):
    for j in range(i+1,n):
        ans+=d[i]*d[j]
        
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
n = int(input())
d = [int(i) for i in input().split()]
sum = 0
for i in range(1,n):
    for j in range(i+1,n+1):
        add = d[i-1] * d[j-1]
        sum += add
print(sum)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))


import itertools
ans = 0
for a,b in list(itertools.combinations(d,2)):
    ans += a * b
print(ans)

Solution (Python):
N = int(input())
d = [int(x) for x in input().split()]

score = 0
for i in range(N):
  for j in range(i):
    score += d[i] * d[j]
    
print(score)

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
out=0
for i in range(a):
  for j in range(i,a):
    if i==j:
      continue
    else:
      out=out+b[i]*b[j]

print(out)

Solution (Python):
n=int(input())
d=[int(i) for i in input().split()]
dsum=0
for i in range(n):
  for j in range(n):
    dsum+=d[i]*d[j]
  dsum-=d[i]*d[i]
print(dsum//2)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(n):
  for j in range(i):
    ans+=A[i]*A[j]
print(ans)

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
x = 0
for i in range(N):
  for j in range(N):
    x += d[i]*d[j]
  x -= d[i]**2
print(int(x/2))

Solution (Python):
n = int(input())
d = [int(i) for i in input().split()]
d1 = [i**2 for i in d]
s = sum(d)
ans = (s**2 - sum(d1))//2
print(ans)

Solution (Python):
n=int(input())
l=tuple(map(int,input().split()))
sum=0
for i in range(n-1):
  for j in range(i+1,n):
    sum+=l[i]*l[j]
print(sum)

Solution (Python):
import itertools
n = int(input())
li = list(map(int, input().split()))
com_li = list(itertools.combinations(li, 2))
result_li= []

for i in com_li:
  count = i[0] * i[1]
  result_li.append(count)

result = sum(result_li)
print(result)

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
 
result = 0
 
for i in range(len(d)):
    for j in range(i+1,len(d)):
        result += d[i] * d[j]
 
print(result)

Solution (Python):
n = int(input())
d = list(map(int,input().split()))

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

Solution (Python):
n = int(input())
t = [int(x) for x in input().split()]
t2 = [x * x for x in t]
print((sum(t) ** 2 - sum(t2))//2)

Solution (Python):
import itertools

N = int(input())
D = list(map(int, input().split()))
Sum = 0
for p in itertools.combinations(D, 2):
    Sum += p[0]*p[1]
print(Sum)

Solution (Python):

import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

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

Solution (Python):
import sys
if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

N = int(input())
d = list(map(int, input().split()))

ans = 0
for i in range(N):
	for j in range(i+1, N):
		ans += d[i] * d[j]

print(ans)

Solution (Python):
n = int(input())
d = list(map(int, input().split()))

ans = 0

for i in range(n):
    for j in range(i+1, n):
        ans += d[i] * d[j]

print(ans)

Solution (Python):
n = int(input())
list = list(map(int,input().split()))
sum = 0
for i in range(len(list)):
	for j in range(i+1,len(list)):
		sum +=list[i]*list[j]
print(sum)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
energy = 0
for x in range(N):
    for y in range(x + 1, N):
        energy = energy + d[x] * d[y]
print(energy)

Solution (Python):

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    return


def main():
    N = int(input())
    D = list(map(int, input().split()))

    ans = 0
    for i in range(N):
        for j in range(i + 1, N):
            ans += D[i] * D[j]
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
i = 0
sum = 0
while(i < n):
    j = i+1
    while(j < n):
        sum += d[i]*d[j]
        j += 1
    i += 1
print(sum)

Solution (Python):
n = int(input())
li = list(map(int,input().split()))
count = 0

for i in range(n-1):
    for j in range(n-i-1):
        count += li[i]*li[i+j+1]

print(count)

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
s = 0
for x in range(n):
    for y in range(x + 1, n):
        s = s + a[x] * a[y]
print(s)

Solution (Python):
N = int(input())

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

total = sum([A[i] * A[j] for i in range(0, N) for j in range(i + 1, N)])

print(total)

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
d2 = list(map(lambda x: x * x, d))
print((sum(d) ** 2 - sum(d2)) // 2)

Solution (Python):
N = int(input())

A = list(map(int,input().split()))
c = 0

for j in range(0,N):
  for i in range(j,N-1):
    c += A[j]*A[i+1]
  

print(c)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
sum = 0
for i in range(N):
    for j in range(N-i-1):
        
        sum += d[i]*(d[j+i+1])

print(sum)

Solution (Python):
import itertools
n = int(input())
d = list(map(int,input().split()))
print(sum([x*y for x,y in itertools.combinations(d,2)]))

Solution (Python):
n=int(input())
d=list(map(int,input().split()))

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

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

print(ans)

Solution (Python):
N = int(input())
S = input()
li = S.split(" ")
sum = 0
for i in range(N-1):
  for j in range(1+i,N):
    sum += int(li[i])*int(li[j])
print(sum)

Solution (Python):
N = int(input())
d = [int(x) for x in input().split()]
buf = 0

for i in range(N) :
    for j in range(i+1,N) :
        buf += d[i] * d[j]

print(buf)

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

Solution (Python):
N = int(input())
p = []
q = 0
p = list(map(int, input().strip().split()))
for i in range(N):
    for j in range(N):
        q += (p[i] * p[j])
    q -= p[i] * p[i]
q = q / 2
print(int(q))

Solution (Python):
n = int(input())
l=list(map(int,input().split()))
sum = 0
for i in range(len(l)):
	for j in range(i+1,len(l)):
		sum += l[i]*l[j]
print(sum)

Solution (Python):
n = int(input())
d = list(int(i) for i in input().split())
ans = 0
for i in range(n):
    for j in range(i+1,n):
        ans += d[i]*d[j]

print(ans)

Solution (Python):

import sys




import itertools









def main():
    n, *d = map(int, sys.stdin.read().split())

    total = 0
    for i, j in itertools.combinations(d, 2):
        total += i * j
    print(total)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(N-1):
    for j in range(i+1,N):
        ans += d[i] * d[j]
print(ans)

Solution (Python):
import  itertools
N = int(input())
D = list(map(int,input().split(' ')))
ans = 0
for i in range(len(D)):
    for i1 in range(i,len(D)):
        if i== i1:
            continue
        ans = ans + (D[i] * D[i1])
print(ans)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
s=[]
for i in range(n):
  for i2 in range(n):
    if i!=i2:
      s.append(a[i]*a[i2])
print(sum(s)//2)

Solution (Python):
N = input()
oishisa_list = input().split(" ")

N = int(N)

goukei = 0

for i in oishisa_list:
  for j in oishisa_list:
    goukei += int(i) * int(j)

issyo = 0
for i in oishisa_list:
  issyo += int(i) ** 2

print((goukei - issyo) // 2)

Solution (Python):
n = int(input())
d = list(map(int, input().split()))

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

Solution (Python):
N = int(input())
D = list(map(int, input().split(' ')))

health = 0
for i in range(N):
    for j in range(N)[i+1::]:
        health += D[i] * D[j]

print(health)

Solution (Python):
A = int(input())
d = list(map(int, input().split()))
Y = 1
sum = 0

for x in range(A):
    for y in range(Y, A):
        sum += d[x]*d[y]
    Y += 1

print(sum)

Solution (Python):
import itertools
N = int(input())
d = list(map(int, input().split()))
S = 0

for i in itertools.permutations(d, 2):
    S += i[0] * i[1]
print(int(S / 2))

Solution (Python):
N=int(input())
d=map(int, input().split())
l_d=list(d)
k=0
for i in range(0,N):
  for j in range(i+1,N):
    k=k+l_d[i]*l_d[j]

print(k)

Solution (Python):
from itertools import combinations

N = int(input())
D = [int(x) for x in input().split()]

s = 0
for x, y in combinations(D, 2):
    s += x * y
print(s)

Solution (Python):
N = int(input())
D = [int(_) for _ in input().split()]

S = sum(D)
W = [(S-d) * d for d in D]
print(sum(W) // 2)

Solution (Python):
n = int(input())
lis = [int(i) for i in input().split()]

way = 0

for i in range(n):
    for j in range(n):
        if i<j:
            way += lis[i]*lis[j]
print(way)

Solution (Python):
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(i,n):
        if i != j:
            ans = ans + d[i]*d[j]
print(ans)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
sum = 0

for i in range(len(d)):
  for j in range(i+1,len(d)):
    sum += d[i]*d[j]

print(sum)

Solution (Python):
import itertools

N = int(input())
D = list(map(int,input().split()))
ans = 0

for x,y in itertools.combinations(D,2):
    ans += (x*y)
print(ans)

Solution (Python):
n = int(raw_input())
a = map(int, raw_input().split())
ans = 0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        ans += a[i] * a[j]
print ans

Solution (Python):
n = int(input())
d = list(map(int,input().split()))

ans = 0

for i in range(n-1):
    for j in range(i+1,n):
       ans += d[i]*d[j]

print(ans)

Solution (Python):
n = int(input())
L = list(map(int, input().split()))
out = 0
for i in range(n):
  for j in range(i+1, n):
    out += L[i] * L[j]

print(out)

Solution (Python):
x = input()
T = map(int, raw_input().split())

ans = 0
for i in range(len(T)):
    for j in range(i+1, len(T)):
        ans += T[i]*T[j]

print ans

Solution (Python):
n = int(input())
takoyaki = list(map(int, input().split()))

ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        a = takoyaki[i] * takoyaki[j]
        ans += a
print(ans)

Solution (Python):
n = int(input())
d = list(map(int, input().split()))

ans = 0
for x in range(n):
    for y in range(x+1, n):
        ans = ans + d[x] * d[y]

print(ans)

Solution (Python):
import numpy as np

N = int(input())
d = list(map(int, input().split()))
d = np.array(d).reshape((1,-1))
M = (np.ones((N,N))-np.eye(N))/2
print(np.dot(np.dot(d,M), d.T)[0,0].astype(np.int))

Solution (Python):
inputbox1 = input()
inputbox2= input()
N = int(inputbox1)
box = inputbox2.split()

d = [int(s) for s in box]

s=0
ans=0
for i in range(N):
    s = s + 1
    for j in range(s,N):
        ans = ans + d[i]*d[j]
print (ans)

Solution (Python):
n=int(input())
d_list=list(map(int,input().split()))
count=0
for i in range(n):
  for j in range(n):
    if i<j:
        count+=d_list[i]*d_list[j]
print(count)

Solution (Python):
n = int(input())

d = list(map(int,input().split()))
sum = 0

for i in range(len(d)):
    d1 = d[i]
    for j in range(i+1,len(d)):
        sum+=d1*d[j]

print(sum)

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N-1):
    for j in range(i+1,N):
        sum += d[i]*d[j]
print(sum)

Solution (Python):
import itertools
import numpy as np

N = int(input())
lst = np.array(list(map(int,input().split())))
lst2 = np.array(list(itertools.combinations(lst,2)))
lst3 =[]

for i in range(len(lst2)):
               dot = np.dot(lst2[i][0],lst2[i][1])
               lst3.append(dot)

print(sum(lst3))

Solution (Python):
n=int(input())
d = list(map(int, input().split()))
a=0
for i in range(0,n,1):
  if i==n:
     break
  for j in d[i+1:]:
    a+=d[i]*j
print(a)

Solution (Python):
def main():
    N = int(input())
    d = list(map(int, input().split()))
    ans = 0

    for xi in range(len(d)):
        for yi in range(xi+1, len(d)):
            if xi != yi:
                ans += d[xi] * d[yi]

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N = int(input())
    d = list(map(int, input().split()))
    ans = 0

    for xi in range(len(d)):
        for yi in range(len(d)):
            if xi != yi:
                ans += d[xi] * d[yi]

    print(ans // 2)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

d = list(map(int,input().split()))
ans = 0

for i in range(N):
    for j in range(i+1,N):
        ans += d[i] * d[j]

print(ans)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))

print(sum(l[i]*sum(l[i+1:]) for i in range(len(l)-1)))

Solution (Python):
n = int(input())
l = list(map(int, input().split()))

print(sum(l[i]*x for i in range(len(l)-1) for x in l[i+1:]))

Solution (Python):
n = int(input())
ar = [int(x) for x in input().split()]

sm = 0
for i in range(0, n):
  for j in range(i+1, n):
    sm = sm + ar[i]*ar[j]
print(str(sm))

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
s = 0
for i in range(n):
  j = i + 1
  while j <= n - 1:
    s += l[i] * l[j]
    j += 1
print(s)

Solution (Python):
n=int(input())
d=[int(x) for x in input().split()]

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

Solution (Python):
N = int(input())
d = [int(a) for a in input().split()]
sum = 0
for i in range(N-1):
  for j in range(i+1, N):
    sum = sum + d[i] * d[j]
print(sum)

Solution (Python):
import itertools
N = int(input())
li = list(map(int, input().split()))
a = 0
for i in range(N):
  for j in range(N):
    if i > j:
      a += li[i]*li[j]
print(a)

Solution (Python):
N=int(input())
d=list(map(int,input().split()))
ans=0
for i in range(N-1):
    for j in range(i+1,N):
        ans+=d[i]*d[j]
print(ans)

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
sum = 0
for i in range(n):
  for j in range(i+1,n):
    sum += d[i] * d[j]


print(sum)

Solution (Python):
n = int(input())
c = list(map(int, input().split())) 
sum = 0
for i in range(n):
    for j in range(i+1,n):
        sum += c[i] * c[j]
print(sum)

Solution (Python):
import itertools
n = int(input())
d_list = list(map(int,input().split()))
d_com = list(itertools.combinations(d_list,2))
res = 0
for a,b in d_com:
    res += a*b
print(res)

Solution (Python):

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

from itertools import combinations

cb = list(combinations(D, 2))
my_lambda = lambda x: x[0] * x[1]
rslt = sum(list(map(my_lambda, cb)))

print(rslt)

Solution (Python):
N = int(input())
D = list(map(int,input().split()))
TotalList = 0

for A in range(N-1):
  for B in range(A+1,N):
    TotalList += D[A]*D[B]
    

print(TotalList)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
cnt = 0
 
for i in range(N-1):
	for j in range(i+1, N):
  		cnt += d[i] * d[j]
 
print(cnt)

Solution (Python):
N=int(input())
d = list(map(int, input().split()))
total=0
for n in range(N-1):
    for j in range(n+1,N):
        total+=d[n]*d[j]
print(total)

Solution (Python):
import math
import sys
input = sys.stdin.readline


def main():
    sc = Scan()
    a = sc.intarr()[0]
    d = sc.intarr()

    sum = 0
    for i in range(a):
        for j in range(i+1, a):
            sum += d[i]*d[j]

    print(sum)


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()

Solution (Python):
N = int(input())
D = list(map(int, input().split()))
cnt = 0

for i in range(N-1):
  for j in range(i+1,N):
    cnt += D[i]*D[j]

print(cnt)

Solution (Python):
n = int(input())
d = list(map(int, input().split()))

ans = 0

for i in range(n):
    for j in range(i, n):
        if i != j:
            ans += d[i] * d[j]

print(ans)

Solution (Python):
n = int(input())
ds = map(int, input().split())
ds = list(ds)

acc = 0
for i in range(0, len(ds)):
    for j in range(i+1, len(ds)):
        acc += ds[i]*ds[j]

print(acc)

Solution (Python):
tako=int(input())
takolist=list(map(int, input().split()))

hp=0
for i in range(tako-1):
  for j in range(i+1,tako):
    hp=takolist[i]*takolist[j]+hp

print(hp)

Solution (Python):
N = int(input())
D = list(map(int, input().split()))

ans = 0

for i in range(N-1):
    for j in range(i+1,N,1):
        ans += D[i] * D[j]

print(ans)

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

Solution (Python):
import itertools

N = int(input())
deliciouses = [int(i) for i in input().split()]
recovery_amounts = []
for i in itertools.combinations(deliciouses, 2):
    recovery_amounts.append(i[0] * i[1])
print(sum(recovery_amounts))

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

Solution (Python):
N=int(input())
D=list(map(int,input().split()))
result=[]
for i in range(N):
  for j in range(i+1,N):
    result.append(D[i]*D[j])
print(sum(result))

Solution (Python):
n = int(input())
d = [int(e) for e in input().split()]
sum = 0
for i in range(0,n):
    for j in range(0,n):
        if i != j:
            sum += d[i] * d[j]
print(sum // 2)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))

total = sum(d)
print(sum([(total-i) * i for i in d]) // 2)

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(0,N-1):
    for j in range(i+1,N):
        sum = sum + d[i]*d[j]
print(sum)

Solution (Python):
N = int(input())
deliciaus = list(map(int , input().split()))

heal = 0

for i in range(N):
    for j in range(i+1 , N):
        heal += deliciaus[i] * deliciaus[j]
    
print(heal)

Solution (Python):
import itertools

n = input()
li = map(int, input().split())
lii = itertools.combinations(li,2)
sum = 0
for _ in lii:
    sum += _[0]*_[1]


print(sum)

Solution (Python):


n = int(input())
d = input().split()

sum = 0

for i in range(n-1):
    for j in range(i+1,n):
        sum += int(d[i])*int(d[j])

print(sum)

Solution (Python):
n =int(input())
nl = list(map(int,input().split()))
kaihuku=0
for i in range(n):
    for j in range(i+1,n):
        kaihuku = kaihuku + nl[i] * nl[j]
print(kaihuku)

Solution (Python):
n =int(input())
nl = list(map(int,input().split()))
result = 0
for i in range(n):
    for k in range(i+1,n):
        result += nl[i] * nl[k]
print(result)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
cmb = int(N * (N - 1) / 2)
cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        cnt = cnt + d[i] * d[j]
print(cnt)

Solution (Python):
N = int(input())
nums = list(map(int, input().split()))
ans = 0
for i in range(N):
  for j in range(i+1, N):
    ans += nums[i] * nums[j]
print(ans)

Solution (Python):
import numpy as np

n = int(input())
d = [int(d_) for d_ in input().split()]

s = 0
for i in range(n - 1):
    for j in range(n - i - 1):
        s += d[i] * d[i + 1 + j]
      
print(s)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
hp = 0
for i in range(len(d)):
	d2 = d[i + 1:]
	for j in d2:
		hp += d[i] * j
print(hp)

Solution (Python):
n = int(input())

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

sum = 0
res = []
for idx, t in enumerate(takoyaki):
  for i in range(idx + 1, n):
    sum += t * takoyaki[i]

print(sum)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans += d[i] * d[j]
print(ans)

Solution (Python):
n=int(input())
s=list(map(int,input().split()))
sum=0
for i in range(n):
  for j in range(i+1,n):
    sum+=s[i]*s[j]
    
print(sum)

Solution (Python):

N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
    for j in range(i+1,N):
        sum+=d[i]*d[j]
print(sum)