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())
li = list(map(int, input().split()))
s = 0
for i in range(len(li)):
  for j in range(len(li)):
    if i > j:
      s += li[i]*li[j]
print(s)

Solution (Python):
N = int(input())
T = list(map(int,input().split()))
TS = []
cnt = 0

for i in range(N):
    for j in range(i+1,N):
        cnt = T[i] * T[j]
        TS.append(cnt)

print(sum(TS))

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())
d=[int(x) for x in input().rstrip().split()]
ans=0
for i in range(N):
  for j in range(N):
    if i<j:
      ans+=(d[i]*d[j])
print(ans)

Solution (Python):
import math
import fractions
import sys
import itertools
import numpy as np
from collections import Counter
import datetime

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

n=input1()
d=input_array()
result=0
for i in range(n):
	tako=d[i]
	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()))

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 = [int(x) for x in input().split()]

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

print(heal)

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

cnt =0
sum =0

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

Solution (Python):
n=int(input())
d=list(map(int,input().split()))
tot=sum(d)**2
for i in range(n):
  tot-=d[i]**2
print(tot//2)

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

Solution (Python):
icase=0
if icase==0:
    from itertools import permutations, combinations,combinations_with_replacement,product
    n=int(input())
    d=list(map(int,input().split()))
    dd=list(combinations(d,2))
    dsum=0
    for ddd in dd:
        dsum=dsum+ddd[0]*ddd[1]
    print(dsum)

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

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(n):
        if i != j:
            ans += d[i] * d[j]
print(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):
import itertools

N = int(input())
*D, = map(int, input().split())
combination = itertools.combinations(D, 2)

sum = 0
for x, y in combination:
    sum = sum + x*y
print(sum)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
d = LIST()
sum = 0

for i in range(N-1):
  for j in range(i+1, N):
    sum += d[i]*d[j]
    
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:
            continue
        ans += d[i]*d[j]

print(ans)

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

import itertools
import numpy

a = []
for pair in itertools.combinations(d, 2):
    a.append(numpy.prod(pair))

print(sum(a))

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

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(readline())
  D = list(map(int, readline().split()))
  ans = 0
  for i in range(N-1):
    for j in range(i+1,N):
      ans += D[i]*D[j]
  print(ans)
  
  
if __name__ == '__main__':
  main()

Solution (Python):
N=int(input())
K=input().split()
list=[]
for i in range(0,N):
  list.append(int(K[i]))
ans=0
for i in range(0,N-1):
  for j in range(i+1,N):
    ans=ans+list[i]*list[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(n):
    if i!=j:
      sum+=d[i]*d[j]
      
print(str(sum//2))

Solution (Python):



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

ans = 0
for i, di in enumerate(d):
    for j, dj in enumerate(d):
        if i == j:
            continue
        else:
            ans += di*dj
print(ans//2)

Solution (Python):

import sys
import numpy as np


def solve(N: int, d: "List[int]"):
    sum = 0
    for i in range(N-1):
        for j in range(i,N):
            if i!=j:
                sum+=d[i]*d[j]

    print(sum)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    d = [int(next(tokens)) for _ in range(N)]  
    solve(N, d)

if __name__ == '__main__':
    main()

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

print(count)

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

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

Solution (Python):
import itertools
import functools
import operator

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

sm = 0

for v in itertools.combinations(d,2):
    sm += functools.reduce(operator.mul, list(v))
print(sm)

Solution (Python):

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


from itertools import combinations

kaifukuryou =[]
for t in combinations(D, 2):
    kaifukuryou.append(t[0]*t[1])

print(sum(kaifukuryou))

Solution (Python):
n = int(input())
d = list(map(int,input().split()))
ans = 0
from itertools import combinations
for tako in list(combinations(range(n),2)):
  tako = list(tako)
  ans += d[tako[0]]*d[tako[1]]
print(ans)

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

Solution (Python):
N=int(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)

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

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=list(map(int,input().split()))
print((sum(D)**2-sum(d*d for d in D))//2)

Solution (Python):
n=int(input())
li=list(map(int,input().split()))
le=int(n*(n-1)/2)
a=0
b=[]
c=[]
def three(n):
  return n*li[i]
for i in range(le):
  a=li[i+1:]
  c=list(map(three,a))
  b.append(c)
    
print(sum(sum(b,[])))

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

print(Sum)

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

print(Sum)

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

Solution (Python):
n = int(input())
S = list(map(int, input().split()))
s=0
t=0
for i in range(n):
	s+=S[i]
	t+=S[i]**2

ans = (s**2-t)//2
print(ans)

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

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

l = list(itertools.combinations(d,2))
su = 0
for li in l:
  su+= li[0]*li[1]
print(su)

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


for i in range(n):
    
    for j in range(n):
        if i == j:
            count += 0
        else :
            count += d[i] * d[j]
print(math.floor(count/2))

Solution (Python):
def q2():
    from itertools import combinations
    N = int(input())
    D = [int(i) for i in input().split()]
    comb_d = combinations(D, 2)
    ans = 0
    for d in comb_d:
        ans += d[0] * d[1]
    print(ans)


if __name__ == '__main__':
    q2()

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())
l = list(map(int, input().split()))
a = 0
for k,v in itertools.combinations(l, 2):
  a += k*v
print(a)

Solution (Python):
import itertools

n = int(input())
box= list(map(int,input().split()))
ans = 0
for i in range(n):
    l = box.pop(i)
    
    for j in range(n-1):
        
        ans += l*box[j]
    box.insert(i,l)
print(ans//2)

Solution (Python):
n = int(input())
d = [int(i) for i in 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())
d = list(map(int, input().split()))

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

print(S)

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

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

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

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

N = i_i()
d = i_l()

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


def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

def LI(): return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))


n=int(input())
d=LI()

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-1):
    for j in range(i+1,n):
        ans+=d[i]*d[j]
print(ans)

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

from collections import deque
q = deque(A)

anc = []
for i in range(N-1):
    d = q.popleft()
    for p in q:
        anc.append(p*d)
    
print(sum(anc))

Solution (Python):
import itertools

n=int(input())
x=list(map(int,input().split()))

y=len(list(itertools.combinations(x,2)))
z=list(itertools.combinations(x,2))

s=0
for i in range(y):
  s+=z[i][0]*z[i][1]
  
print(s)

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

Solution (Python):
import itertools

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

cnt = 0

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

print(cnt)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    n = int(input())
    d = list(map(int, input().split()))
    res = 0
    for i in combinations(d, 2):
        i = list(i)
        res += i[0] * i[1]
    print(res)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
D=[int(_) for _ in 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):
N=int(input())
d=list(map(int, input().split()))
cnt=0
for i in range(N-1):
    start=d[i]
    for j in range(i+1, N):
        cnt+=start*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())
li = list(map(int,input().split()))
total = 0
for i in range(n):
    for j in range(n):
        if i != j:
            total += li[i]*li[j]
print(total//2)

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

for i in range(N):
  for j in range(N):
    if i != j:
      ans += d[i] * d[j]
  
print(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):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *D = map(int, read().split())

sum = 0

for i in range(N):
    for j in range(N):
        if i == j : continue
        else:
            sum += D[i]*D[j]

print(int(sum/2))

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
d_sum = sum(d)
d_dim = 0
ans = 0
for x in d:
    d_dim += x
    ans += x * (d_sum - d_dim)
print(ans)

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

from itertools import combinations

ans = 0
for _ in list(combinations(tako,2)):
  _ = list(_)
  ans = ans + _[0]*_[1]
  
print(ans)

Solution (Python):
n=int(input())
ans=0
d=[int(i) for i in 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())
c = list(map(int, input().split()))
point=0
for i in range(n):
  for j in range(i+1,n):
  	point += c[i] * c[j]

print(point)

Solution (Python):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
from itertools import accumulate as acc
import copy as cp
import operator as op


n=ri()
d=rli()
temp=0
df=cp.deepcopy(d)
s=list(acc(df))
for i in range(1,n):
  temp+=s[i-1]*d[i]


print(temp)

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

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

sum = 0
for i in range(n):
    for j in range(n):
        sum += D[i]*D[j]
for i in range(n):
    sum -= D[i]**2
    
sum = sum//2
print(sum)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
import itertools
L = list(itertools.combinations(d,2))
s = 0
for i in range(len(L)):
    s += L[i][0]*L[i][1]
print(s)

Solution (Python):
import itertools
N=int(input())
D=list(map(int,input().split()))
print(sum(d*cumulate for d,cumulate in zip(D[1:],itertools.accumulate(D))))

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

Solution (Python):
import math
import itertools
n = int(input())
a_ls = list(map(int, input().split()))

index_ls = list(range(n))
c = itertools.combinations(index_ls, 2)
c = list(c)

ans = 0
for i in range(len(c)):
    recover = a_ls[c[i][0]] * a_ls[c[i][1]]
    ans += recover
print(ans)

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]

sum = sum // 2

print(sum)

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

result = 0

for i in range(N):
    for j in range(N):
        if i != j:
            result += d[i] * d[j]

result = result // 2

print(result)

Solution (Python):
import math
import io

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):
n = int(input())
d = list(map(int,input().split()))
ans = 0
for x in range(n-1):
    
    for y in range(1,n - x):
        
        ans += d[x] * (d[y+x])
print(ans)

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

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

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):
N = int(input())
D = list(map(int, input().split()))
ans=[]
for i in range(N-1):
    for j in range(i+1, N):
        ans.append(D[i]*D[j])
print(sum(ans))

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

ans = 0

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

print(ans)

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

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

total = 0
for i in range(N):
  d = d_lst[:i] + d_lst[i+1:] 
  total += sum(d_lst[i] * d for d in d_lst[:i] + d_lst[i+1:])
print(total//2)

Solution (Python):
from itertools import *
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i,j in combinations(d,2):
  ans += i*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):
import itertools
N=int(input())
d=list(map(int,input().split()))

p=itertools.permutations(d,2)

total=0
for i in p:
    total+=i[0]*i[1]
print(total//2)

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

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

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

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

print(int(count/2))

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

Solution (Python):
import itertools
n = int(input())
d = list(map(int, input().split()))
combination_takoyaki = list(itertools.combinations(d, 2))
takoyaki = []
for i in combination_takoyaki:
    i_1 = i[0]
    i_2 = i[1]
    power = i_1 * i_2
    takoyaki.append(power)
takoyaki_power = sum(takoyaki)
print(takoyaki_power)

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n=I()
ds=LI()

D=sum(ds)
def sqr(x):
    return x*x
dds=list(map(sqr, ds))

sigma=sum(dds)
ans=(D*D-sigma)/2
print(int(ans))

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n=I()
ds=LI()

D=sum(ds)
def sqr(x):
    return x*x
dds=[]
for d in ds:
    dds.append(d*d)

sigma=sum(dds)
ans=(D*D-sigma)/2
print(int(ans))

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

def delicious(x: int, y: int) -> int:
    delicious = x * y
    return delicious

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

print(total)

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

Solution (Python):
a = int(input())
ans_list = []
result = 0
ans_list = input().split()
ans_list2 = ans_list.copy()
for i in range(a-2):
    ans_list2.pop(0)
    for p in range(a-1 -i):
        result += int(ans_list[i]) * int(ans_list2[p])
    
result += int(ans_list[a-1]) * int(ans_list[a-2])
print(result)

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

Solution (Python):
import sys
input = sys.stdin.readline
from itertools import *
from collections import *


INF = float('inf')


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

    pairs = list(permutations(D, 2))

    total = 0
    for pair in pairs:
        total += pair[0] * pair[1]

    total = total // 2
    print(total)


if __name__ == '__main__':
    main()

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

ans = 0

for v in itertools.combinations(d,2):
    ans = ans + (list(v)[0] * list(v)[1])

print(ans)

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

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

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

Solution (Python):
import itertools

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

out = 0
for i in list(itertools.combinations(d, 2)):
    out += i[0] * i[1]

print(out)

Solution (Python):
HP=0
r=0
n=int(input())
d=list(map(int,input().split()))
for x in range(n):
    for y in range(n):
        HP=HP+d[x]*d[y]

for z in range(n):
    r+=d[z]*d[z]
    
print((HP-r)//2)

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
  
def main():
  n = int(input())
  D = list(map(int,input().split()))
  ans = 0
  for i in range(n):
    for j in range(i,n):
      if not i == j:
        ans += D[i] * D[j]
  print(ans)
  
if __name__ == '__main__':
  main()

Solution (Python):
from itertools import combinations
n = int(input())
ns = list(map(int, input().split()))
result = 0
for i, j in combinations([k for k in range(n)], 2):
    result += ns[i] * ns[j]
print(result)

Solution (Python):
N,*D,=map(int,open(0).read().split());i=0;A=0
while i<N:
    j=i+1
    while j<N:A+=D[i]*D[j];j+=1
    i+=1
print(A)

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

kaihuku = 0

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

print(kaihuku)

Solution (Python):
n=int(input())
takoyaki=list(map(int,input().split()))
ans=0
while len(takoyaki)>1:
    s=takoyaki.pop()
    for x in takoyaki:
        ans+=s*x
        
print(ans)

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

Solution (Python):
from itertools import combinations

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

p = combinations(d, 2)

ans = 0
for v in p:
    ans += v[0]*v[1]

print(ans)

Solution (Python):
n, *d = map(int, open(0).read().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()))
s = 0
for i in range(n):
    for j in range(n):
        if i != j:
            s += d[i] * d[j]
print(int(s/2))

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

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

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

Solution (Python):
import itertools

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

aaa = list(itertools.combinations(d,2))

ans = 0

for a in aaa:
    a1 = a[0]
    a2 = a[1]
    seki = a1*a2

    ans += seki

print(ans)

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

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

Solution (Python):
N=int(input())
D=list(map(int,input().split()))
ans=(sum(D)**2-sum(d*d for d in D))//2
print(ans)

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

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

 
D=[]
 
D=list(map(int, input().split()))
sum=0

for i in range(N):
  for j in range(N):
    if i !=j:
      sum=sum+D[i]*D[j]
  
print (int(sum/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(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()))

ans = 0
cnt = 0
for i in l:
    cnt += 1
    ll = l[cnt:]
    for j in ll:
        ans += i * j

print(ans)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    l=LIST()
    ct=0
    for i in range(n-1):
        for k in range(i+1,n):
            ct+=l[i]*l[k]
    print(ct)
if __name__ == '__main__':
    do()

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

Solution (Python):
n = int(input())
d = [int(x) for x 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):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(1+i,n):
        ans += a[i]*a[j]

print(ans)

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

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

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

import itertools

kumiawaselist = list(range(0,n))
kumiawaselist = list(itertools.combinations(kumiawaselist,2))
ans = 0
for i in range(0,len(kumiawaselist)):
    ans += dlist[kumiawaselist[i][0]] * dlist[kumiawaselist[i][1]]

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,N):
        if i!=j:
            ans += D[i]*D[j]
print(ans)

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

Solution (Python):
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
D = np.array(lr())
recover = D[:, None] * D[None, :]
answer = recover.sum() - np.diag(recover).sum()
print(answer // 2)

Solution (Python):
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
D = np.array(lr())
recover = D[:, None] * D[None, :]
np.fill_diagonal(recover, 0)
answer = recover.sum() // 2
print(answer)

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):

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

from itertools import combinations
print(sum(list(map(lambda x:x[0]*x[1],list(combinations(b,2))))))