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



Sample input:
3
3 1 2


Sample output:
11

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

sum = 0

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

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
d = list(map(int,input().split()))
print(int((np.sum(np.array(d))**2 - np.sum(np.array(d)**2)) /

Submission status: Runtime Error

Solution code:
n=int(input())
List=[int(i) for i in input().split()]
print(Lint)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
d=[int(input()) for i in range(n)]

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

Submission status: Runtime Error

Solution code:
n=int(input())
d=[int(input()) for i in range(n)]

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

Submission status: Runtime Error

Solution code:
n=int(input())
d=[int(input()) for i in range(n)]

sum=0
for i in range(n):
    for l in range(1<=n):
        sum+=d[i]*d[l]
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
List = [int(j) for j in input().split(" ")]
Sum = 0
for n in range(0,N-1):
  for m in range(n+1,N):
    Sum += List[i]*List[j]
print(Sum)

Submission status: Runtime Error

Solution code:
from collections import deque

def input():
    return sys.stdin.readline().rstrip('\n')

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

D = deque(D)
sum0 = D.pop()
hp = 0

for _ in range(N-1):
    d = D.pop()
    hp += d * sum0
    sum0 += d

print(hp)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = 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)

Submission status: Runtime Error

Solution code:
n = input()
d = 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)

Submission status: Runtime Error

Solution code:
n = input()
d = map(int, input().split())
sum = 0
for i in range(n-1):
  for j in range(i+1, n):
    sum += ij
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
list = input().split(' ')
sq_list = []
for i in list:
  sq_list.append(i ** 2)
print((sum(list) ** 2 - sum(sq_list))//2)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int(input())))

ans=0
s=sum(l)

for i in range(n):

    ans+=l[i]*(s-l[i])

print(ans/2)

Submission status: Runtime Error

Solution code:
a=int(input())
import itertools
b=list(map(int,input().split()))
c=0
for d,e in combinations(b,2):
  c+=d*e
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
import itertools
b=list(map(int,input().split()))
c=0
for d,e in combinations(b,2):
  
    c+=d*e
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
import intertools
b=list(map(int,input().split()))
c=0
for d,e in combinations(b,2):
  c+=d*e
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=0
for d,e in combinations(b,2):
  c+=d*e
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=0
for d,e in combinations(b,2):
  c=d*e
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
c=0
b=list(map(int,input().split()))
for i in range(a-1):
  c+=(a[i]*a[i+1])
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
c=[]
b=list(map(int,input().split()))
c=b.sort()
print(c[-1]*c[-2])

Submission status: Runtime Error

Solution code:
n = int(input())
nums = map(int, input().split())

res = 0
for i in range(len(nums)):
  for j in range(i, len(nums)):
	res += (nums[i] * nums[j])
print(res)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
d = [int(x) for x in input().split()]
t = 0
for i in itertools.permutations(d, N):
    t += i[0]*i[1]
print(total)

Submission status: Runtime Error

Solution code:
N = int(input())
d = [int(x) for x in input().split()]
total = 0
for i in itertools.permutations(d, N):
    total = i[0]*i[1]
print(total)

Submission status: Runtime Error

Solution code:
n = int(input())
nums = list(map(int, input()))
ans = []
for i in range(n):
    for j in range(i+1,n):
        ans.append(nums[i] * nums[j])
print(sum(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
d=list(map(int,input().split() for i in range(N)))
a=[]
for i in range(d):
  for j in range(d):
  a.append(set(i*j))
print(sum(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int, input().split()))
sum = 0
for i in range((N*(N-1))//2):
    for j in range(i):
        a = l[i]*l[j]
        sum+=a
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = int(input())
d = list(map,input().split())
sum = 0

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

Submission status: Runtime Error

Solution code:
N = int(input())
d = list(map(int, input()))
S = d[0]
delic = 0
for i in range(N-1):
  P = d[i+1]
  delic += P * S
  S += P
print(delic)

Submission status: Runtime Error

Solution code:
7
5 0 7 8 3 3 2

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

d = 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)

Submission status: Runtime Error

Solution code:
N =int(input())
s = [int(x) for x in range(0,N)]
for i in range(0,N):
  for j in range(i+1,N):
    m = [int(s[i]*s[j])]
leng = len(m)
sum = 0
for k in range(0,leng):
  sum = sum + m[k]
 print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
d = map(int, input().split())
 
result = 0
 
for x in range(1, n + 1):
  for y in range(x + 1, n + 1):
    result += d[x-1] * d[y-1]
    
print(result)

Submission status: Runtime Error

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

result = 0

for x in range(1, n + 1):
  for y in range(x + 1, n + 1):
    result = d[x-1] * d[y-1]
    
print(result)

Submission status: Runtime Error

Solution code:
n=int(input())
d_list=map(int,inout().spllit())
count=0
for i in range(n):
  for j in range(n):
    count+=d_list[i]*d_list[j]
  count-=d_list[i]**2
if n=2:
  print(count)
else:
  print(count/2)

Submission status: Runtime Error

Solution code:
n=int(input())
d_list=map(int,inout().spllit())
count=0
for i in range(n):
  for j in range(n):
    count+=d_list[i]*d_list[j]
  count-=d_list[i]**2
print(count)

Submission status: Runtime Error

Solution code:
n=int(input())
d_list=map(int,inout().spllit())
count=0
for i in range(n):
  count-=d_list[i]**2
  for j in range(n):
    count+=d_list[i]*d_list[j]
print(count)

Submission status: Runtime Error

Solution code:
n=int(input())
d_list=map(int,inout().spllit())
count=0
for i in range(n):
  count-=d_list[i]
  for j in range(n):
    count+=d_list[i]*d_list[j]
print(count)

Submission status: Runtime Error

Solution code:
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(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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:]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split()))
import numpy as np
ll = np.empty(int(n * (n - 1) / 2))

for i in range(N):
  for j in range(i + 1, N):
    ll[k] = l[i] * l[j]
    k += 1
print(np.sum(ll))

Submission status: Runtime Error

Solution code:
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(result)

Submission status: Runtime Error

Solution code:
N = int(input())
D = list(map(int,input().split()))
TotalList = []

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

print(sum(TotalList))

Submission status: Runtime Error

Solution code:
N = int(input())
D = list(map(int,input().split()))
TotalList = []

for A in range(N-1):
  for B in range(A+1):
    D(A)*D(B) = K
    TotalList.append(K)

print(sum(TotalList))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
d=[]
total=0
for i in range(N):
    d.append(int(input()))
for n in range(N):
    for j in range(n+1,N):
        total+=d[n]*d[j]
total

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from itertools import combinations
 
N = int(input())
d = list(map(int(input().split())))
 
score = 0
for i,j in combinations(range(N), 2):
  score += d[i] * d[j]
print(score)

Submission status: Runtime Error

Solution code:
from itertools import combinations

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

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

print(score)

Submission status: Runtime Error

Solution code:
N=list(map(int,input().split()))
list_A=[]
list_B=[]
for num3 in d:
    list_B.append(int(num3*num3))
k=sum(list_B)
for num in d:
    for num2 in d:
        list_A.append(int(num*num2))
print((sum(list_A)-k)//2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>

using namespace std;
int main() {
	int N,sum;
	int d[50];
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> d[i];
	}
	sum = 0;
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			sum += d[i] * d[j];
		}
	}
	cout << sum;
	return 0;

}

Submission status: Runtime Error

Solution code:
input()
foods=list(map(int,input().split()))
ans = 0
sum = 0
for i in foods:
    for j in foods:
        i<j
        ans= foods[i]*foods[j]
        sum += ans
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = map(int,input().split())
res = 0
for i in range(n):
  if a[i] == 0:
    continue
  for j in range(i+1,n):
    res += a[i]*a[j]
print(res)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
d = list(map(int, input().split()))

d1 = np.array(d)
d2 = d1.reshape(-1, 1)

a = np.matmul(d2,[d1])
a = np.tril(a, k=-1)
print(np.sum(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
lis = [int(i) for i in input().split()]
sum = 0
for i in range(n-1):
  for j in range(i+1,n):
    sum += i*J
print(sum)

Submission status: Runtime Error

Solution code:
N = input()
D=[]*N
D=map(int,input().split(" "))
sum=0
for i,di in enumerate(D):
    for j,jd in enumerate(D):
        if i!=j:
            sum+=jd*id
print(sum)

Submission status: Runtime Error

Solution code:
a=int(inputu())
b=list(map(int,input().split()))
out=0
for i in range(a):
  for j in range(i-1):
    out=out+b[i]*b[j]
    
print(out)

Submission status: Runtime Error

Solution code:
n=input()
d=[int(i) for i in input().split()]
while True:
  a=d[0]
  del d[0]
  if d == []:
    break
  for i in d:
    sum += a*i
print(sum)

Submission status: Runtime Error

Solution code:
input()
d=[int(i) for i in input().split()]
i=0
while True:
  a=d[0]
  del d[0]
  if d == []:
    break
  for i in d:
    sum += a*i
print(sum)

Submission status: Runtime Error

Solution code:
a = int(input())
b = input.split()
b = [int(elem) for elem in b]
sumation = 0
for i, elem in enumerate(b):
	for j, elem2 in enumerate(b[i:]):
      sumation += elem * elem2
print('{}'.format(sumation)

Submission status: Runtime Error

Solution code:
N = int(input())
D = 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)

Submission status: Runtime Error

Solution code:
n=int(input())
d = list(map(int,input().split()))
li=[]
for i in n:
  for j in n:
    a=d[i]*d[j]
    li.append(a)
b=sum(li)
print(b/2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
3
3 1 2

Submission status: Runtime Error

Solution code:
for i in range(len(d1)):
    for j in range(len(d1)): 
        if(i != j and j > i):
            sum += int(d1[i])*int(d1[j])

print(sum)

Submission status: Runtime Error

Solution code:
N=int(input())
d=[0]*N
d=map(int,input().sort())
res=0

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

print(res)

Submission status: Runtime Error

Solution code:
N = int(input())
d = map(int,input().split())
recovery_amount = 0 
for i in range(N):
  for j in range(N):
    if i == j:
      continue
    recovery_amount += d[i]*d[j]
print(recovery_amount)

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
const long long mod = 1e9 + 7;

int main(){
     int n;
     cin >> n;
     int d[n];
     int sum = 0;
     int ans = 0;
     rep(i,n){
          cin >> d[i];
          sum += d[i];
     }
     sum -= d[0];
     for(int i = 0; i<n-1; i++){
          ans += d[i] * sum;
          sum -= d[i+1];
     }
     cout << ans << endl;
}

Submission status: Runtime Error

Solution code:
N = input().split()
ns = input().split()

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

Submission status: Runtime Error

Solution code:
# たこふぇす
n = int(input())
d = [int(i) for i in input().split()]

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=sum(b)
d=[(c-x)*x for x in b]
e=sum(d)
 print(e/2)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=sum(b)
d=[c*x for x in b]
 print(sum(d))

Submission status: Runtime Error

Solution code:
input()
d=[int(i) for i in input().split()]
i=0
while True:
  a=d[0]
  del d[0]
  for i in d:
    sum += a*i
print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
t_list = list(map(int, input().split()))

u = 0

for val in range(n):
	u += t_list[n]*(sum(t_list) - t_list[n])

u /= 2
m = int(u)
print(m)

Submission status: Runtime Error

Solution code:
n=int(input())
S=list(map(int,input().split()))
c=0

print(n,S)

for i in range(7):
    for j in range(7):
        if i!=j:
            c+=S[i]*S[j]


print(int(c/2))

Submission status: Runtime Error

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

from itertools import combinations
for i,j in combinations(d,2):
  ans += d[i-1]*d[j-1]
print(ans)

Submission status: Runtime Error

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

from itertools import combinations
for i,j in combinations(N,2):
  ans += d[i]*d[j]
print(ans)

Submission status: Runtime Error

Solution code:
N=input()
List=list(map(int,input().split()))
i =0 
j =0
for i in range(N):
    for j in range(N):
        t = List[i]*List[j]
print(t)

Submission status: Runtime Error

Solution code:
N = int(input())
d = map(int, input().split())
more = N - 1
total = 0
for i in range(N):
  for j in range(more):
    try:
      total +=  int(d[i]) * int(d[i + j + 1])
    except IndexError:
      break
  more -= 1
print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
d = list(map(int, input()))
s = sum(d)

print(sum(list(map(lambda x:(s-x)*x, d))))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
gomi=input()
tako= [i for i in input().split()]
print((sum(tako)**2-sum([i**2 for i in tako]))/2)

Submission status: Runtime Error

Solution code:
N = int(input())
d = [int(x) for x in input().split()]
f = sum(d)
s = 0

for i in f:
  s += i * (f-i)

print(s//2)

Submission status: Runtime Error

Solution code:
int N = input()
d[]= map(int, input().split())

answer = 0

for x in N:
  for y in N-1:
    w = d[x]*d[y]/2
    answer += w

print(answer)

Submission status: Runtime Error

Solution code:
n = int(input())
del = list(map(int, input().split()))
sum = 0
i = 0

while i < n - 1:
  k = i
  while k < n - 1:
    k += 1
    sum += del[i] * del[k]
  i += 1
  
print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
del = list(map(int, input().split()))
sum = 0
i = 0

while i < n - 1:
  k = i
  while k < n - 1:
    k += 1
    sum += del[i] * del[k]
  i += 1
  
print(str(sum))

Submission status: Runtime Error

Solution code:
del = list(map(int, input().split()))
n = len(del)
sum = 0
i = 0

while i < n - 1:
  k = i
  while k < n - 1:
    k += 1
    sum += del[i] * del[k]
  i += 1
  
print(str(sum))

Submission status: Runtime Error

Solution code:
del = list(map(int, input().split()))

sum = 0
i = 0


print(sum)

Submission status: Runtime Error

Solution code:
del = list(map(int, input().split()))
n = len(del)
sum = 0
i = 0


print(sum)

Submission status: Runtime Error

Solution code:
del = [int(d) for d in input().split()]
n = len(del)
sum = 0
i = 0

while i < n - 1:
  k = i
  while k < n - 1:
    k += 1
    sum += del[i] * del[k]
  i += 1
  
print(sum)

Submission status: Runtime Error

Solution code:
del = list(map(int, input().split()))
n = len(del)
sum = 0
i = 0

while i < n - 1:
  k = i
  while k < n - 1:
    k += 1
    sum += del[i] * del[k]
  i += 1
  
print(sum)

Submission status: Runtime Error

Solution code:
del = list(map(int, input().split()))
n = len(del)
sum = 0
i = 0

while i < n - 1:
 
  k = i
  while k < n - 1:
    k += 1
    sum += del[i] * del[k]
    
  i += 1
  
print(str(sum))

Submission status: Runtime Error

Solution code:
del = list(map(int, input(),split()))
n = len(del)
sum = 0
i = 0

while i < n - 1:
 
  k = i
  while k < n - 1:
    k += 1
    sum += del[i] * del[k]
    
  i += 1
  
print(str(sum))

Submission status: Runtime Error

Solution code:
n=int(input())
d=list(map(int,input().split()))
s=sum(d)
print(sum([x*(d-x) for x in d])//2)

Submission status: Runtime Error

Solution code:
N = int(input())
dlist = list(map(int, input().split()))

all = 0
for i1, d1 in enumrate(dlist):
  for i2, d2 in enumrate(dlist):
    if i1 != i2:
      all += d1*d2

print(all)

Submission status: Runtime Error

Solution code:
N = int(input())
d = [int(input()) for i in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range(i+1):
        sum = sum + d[i] * d[j]
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i):
        sum = sum + d[i+1] * d[j+1]
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
d_(i+1) = [ int(input()) for i in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d_i * d_j
print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
data = [int(i) for i input().split()]
ans = 0
for i in range(n):
  for j in range(i+1,n):
    ans += data[i]*data[j]
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    d = list(map(int, input().slit()))
    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()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(inout()) # the number of takoyaki
delicious = list(map(int,input().split()))
ans = 0
for i in range(0, n-1): 
  for j in range(i, n):
    ans += delicious[i] * delicious[j]
    
print(ans)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
    num = int(input())
    base_list=[]
    tmp_list=[]
    ans=0
    base_list = input().split()
    tmp_list = deepcopy(base_list)
    for i in base_list:
        print("i:"+i)
        tmp_list.remove(i)
        for j in tmp_list:
            ans+=int(i)*int(j)
    print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
ds = map(int, input.split())
ret = 0
for i in range(n):
  for j in range(n-1):
    ret += ds[i] * ds[j + 1]
print(ret)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
ds = map(int, input().split())
t = 0
for i in range(n):
  for j in range(i, n):
    t += d[i] * d[j]
print(t)

Submission status: Runtime Error

Solution code:
n=int(input())
d=[]
for i in range(n):
    d.append(int(input()))
ans=0
for l in range(n):
    for i in range(l+1,n):
        ans+=d[l]*d[i]
print(ans)