Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
ptint(input()[0]+input()[1]+input()[2])

Fixed submission:
print(input()[0]+input()[1]+input()[2])

Buggy python submission (verdict: Runtime Error):
c1,c2,c3=input().split()
c4,c5,c6=input().split()
c7,c8,c9=input().split()
ptint(c1+c5+c9)

Fixed submission:
print(input()[0]+input()[1]+input()[2])
Buggy python submission (verdict: Runtime Error):
N=int(input())
d=[int(input()) for _ in range(N)]
print(len(set(d))

Fixed submission:
N=int(input())
d=[int(input()) for _ in range(N)]
print(len(set(d)))
Buggy python submission (verdict: Runtime Error):
s=list(input(s))
print(s.count("1"))

Fixed submission:
s=list(input())
print(s.count("1"))
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
cnt=0
while all(l%2==0 l in L):
  L=[l/2 for l in L]
  cnt+=1
print(cnt)

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
cnt=0
while all(l%2==0 for l in L):
  L=[l/2 for l in L]
  cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
N,K,X,Y=[int(input()) i in range(4)]
print(N*X-(X-Y)*max(0,N-K))

Fixed submission:
N,K,X,Y=[int(input()) for i in range(4)]
print(N*X-(X-Y)*max(0,N-K))

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=[int(input()) i in range(4)]
print(X*N+Y*max(0,N-K))

Fixed submission:
N,K,X,Y=[int(input()) for i in range(4)]
print(N*X-(X-Y)*max(0,N-K))

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=[int(input()) i in range(4)]
print(X*K+Y*max(0,N-K))

Fixed submission:
N,K,X,Y=[int(input()) for i in range(4)]
print(N*X-(X-Y)*max(0,N-K))

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=[int(input()) i in range(4)]
print(X*K+Y*(N-K))

Fixed submission:
N,K,X,Y=[int(input()) for i in range(4)]
print(N*X-(X-Y)*max(0,N-K))
Buggy python submission (verdict: Runtime Error):
line = input().split(" ")

N, A, B = int(line[0]), int(line[1]), int(line[2])

buff = []
for i in range(int(N/(A+B))+1):
    buff.extend([1]*A)
    buff.extend([0]*B)

print(sum(buff[:N]))


Fixed submission:
line = input().split(" ")

N, A, B = int(line[0]), int(line[1]), int(line[2])

S = A + B
if S == 0:
    print(0)
    exit(0)
div, mod = divmod(N, S)

answer = div * A
answer += mod if mod < A else A
print(answer)
Buggy python submission (verdict: Runtime Error):
import math
temp=list(map(lambda x:int(x),input().split()))
A,B,C,D=temp[0],temp[1],temp[2],temp[3]
public_cd=math.gcd(C,D)

c_n_full=B//C
d_n_full=B//D
cd_n_full=B//((C*D)//public_cd)

c_n_par=(A-1)//C
d_n_par=(A-1)//D
cd_n_par=(A-1)//((C*D)//public_cd)

c_n=c_n_full-c_n_par
d_n=d_n_full-d_n_par
cd_n=cd_n_full-cd_n_par
counter=(B-A+1)-(c_n+d_n)+cd_n

print(counter)

Fixed submission:

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

temp=list(map(lambda x:int(x),input().split()))
A,B,C,D=temp[0],temp[1],temp[2],temp[3]
public_cd=gcd(C,D)

c_n_full=B//C
d_n_full=B//D
cd_n_full=B//((C*D)//public_cd)

c_n_par=(A-1)//C
d_n_par=(A-1)//D
cd_n_par=(A-1)//((C*D)//public_cd)

c_n=c_n_full-c_n_par
d_n=d_n_full-d_n_par
cd_n=cd_n_full-cd_n_par
counter=(B-A+1)-(c_n+d_n)+cd_n

print(counter)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())

y<math.log(1.01, N/100)
print(y)

Fixed submission:
N = int(input())
A=input().split()

s=int(A[0])//N
if int(A[0])%N==0:
    print('OK')
else:
    if (s+1)*N>int(A[1]):
        print('NG')
    else:
        print('OK')

Buggy python submission (verdict: Runtime Error):
N = int(input())
A=input().split()

s=int(A[0])//N
if int(A[0])%N==0:
    print('OK')
else:
    if (s+1)*N>=A[1]:
        print('NG')
    else:
        print('OK')


Fixed submission:
N = int(input())
A=input().split()

s=int(A[0])//N
if int(A[0])%N==0:
    print('OK')
else:
    if (s+1)*N>int(A[1]):
        print('NG')
    else:
        print('OK')

Buggy python submission (verdict: Runtime Error):
N = input()
A=input().split()

s=int(A[0])//int(N)
if int(A[0])%int(N)==0:
    print('OK')
else:
    if (s+1)*N=>A[1]:
        print('NG')
    else:
        print('OK')


Fixed submission:
N = int(input())
A=input().split()

s=int(A[0])//N
if int(A[0])%N==0:
    print('OK')
else:
    if (s+1)*N>int(A[1]):
        print('NG')
    else:
        print('OK')

Buggy python submission (verdict: Runtime Error):
N = input()
A=input().split()

s=int(A[0])/int(N)
if (s+1)*N>A[1]:
    print('NG')
else:
    print('OK')

Fixed submission:
N = int(input())
A=input().split()

s=int(A[0])//N
if int(A[0])%N==0:
    print('OK')
else:
    if (s+1)*N>int(A[1]):
        print('NG')
    else:
        print('OK')
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())

y>=math.log(1.01, N/100)
print(y)

Fixed submission:
import math
N = int(input())

s=100
count=0

while N > s:
    s*=1.01
    s=math.floor(s)
    count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())

y>=math.log(1.01, N/100)
print(y)

Fixed submission:
import math
N = int(input())

s=100
count=0

while N > s:
    s*=1.01
    s=math.floor(s)
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
points = [list(map(int, input().split(" "))) for _ in range(point_count)]
points.insert(0, [0, 0, 0])

can = True
for i in range(N):
    dt = points[i + 1][0] - points[i][0]
    dist = abs(x[i + 1][0] - x[i][0]) + abs(y[i + 1][0] - y[i][0])
    if dt < dist:
        can = False
    if dist % 2 != dt % 2:
        can =False
if can:
    print("YES")
else:
    print("NO")

Fixed submission:
N = int(input())
points = [list(map(int, input().split(" "))) for _ in range(N)]
points.insert(0, [0, 0, 0])

can = True
for i in range(N):
    dt, dist = 0, 0
    dt = points[i + 1][0] - points[i][0]
    dist = abs(points[i + 1][1] - points[i][1]) + abs(points[i + 1][2] - points[i][2])
    if dt < dist:
        can = False
    if dist % 2 != dt % 2:
        can = False

if can:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x = int(input())
const_a, count = 100, 0

while const_a < x:
  a += a//100
  count += 1
print(count)

Fixed submission:
x = int(input())
const_a, count = 100, 0

while const_a < x:
  const_a += const_a//100
  count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
import collections
c = collections.Counter(P)
t = 0
c1 =c
for i in range(N):
    c1[P[i]]= c1[P[i]]-1
    for j in c1.values():
        t = t+j*(j-1)/2
    print(int(t))
    t = 0
    c1[P[i]]= c1[P[i]]+1   

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
import collections
c = collections.Counter(P)
t = 0
for j in c.values():
    t = t+j*(j-1)/2
for i in range(N):
    t1 = t -(c[P[i]]-1)
    print(int(t1))
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split()) 
if H%2 ==0:
    print(H//2*W)
else:
    if W%2 == 0:
        print((H//2+(H+1)//2)*(W//2)
    else:
        print((H//2+(H+1)//2)*(W//2)+(H+1)//2)

Fixed submission:
H,W = map(int,input().split()) 
import math
if (H == 1) or (W == 1):
    print(1)
else:
    if H%2 ==0:
        print(H//2*W)
    else:
        if W%2 == 0:
            print(H*(W//2))
        else:
            print(H*((W-1)//2)+(H+1)//2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
N1 = N%100//5
N2 == 0
if N%100%5 == 0:
    N2 = 0
else:
    N2 = 1
S =N1+N2
if 100*S > N:
    print(0)
else:
    print(1)

Fixed submission:
N = int(input())
N1 = N%100//5
N2 = 0
if N%100%5 == 0:
    N2 = 0
else:
    N2 = 1
S =N1+N2
if 100*S > N:
    print("0")
else:
    print("1")
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split()) 
P = [list(map(int,input().split())) for i in range(N)]
P1 = P.sort()
a = 0
for i in range(N):
    if M < P[i][1]:
        break
    M = M-P[i][1]
    a += 1

print(P[a][0])

Fixed submission:
N, M = map(int,input().split()) 
P = [list(map(int,input().split())) for i in range(N)]
P.sort()
a = 0
for i in range(N):
    if M <= P[i][1]:
        break
    M = M-P[i][1]
    a += 1


print(P[a][0])
Buggy python submission (verdict: Runtime Error):
1
11 11

Fixed submission:
K = int(input())
A,B = map(int,input().split())
a = A// K
b = B // K
if a != b and a !=0 or A % K == 0 or B % K ==0:
    print('OK')
else:
    print('NG')
Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=list(map(int, input().split()))
A=np.array(A)
left=0 
right=N-1
while left<right:
  ans=0
  mid=(left+right)//2
  if A[:mid+1].sum()<A[mid+1:].sum():
    ans=min(ans,abs(A[:mid+1].sum()<A[mid+1:]))
    left=mid+1
  else:
    right=mid
print(abs(ans))

Fixed submission:
import numpy as np
N=int(input())
A=list(map(int, input().split()))
A=np.array(A)
left=0 
right=N-1
while left<right:
  mid=(left+right)//2
  if A[:mid+1].sum()<A[mid+1:].sum():
    left=mid+1
  else:
    right=mid
if (abs(A[:left+1].sum()-A[left+1:].sum()))>(abs(A[:left].sum()-A[left:].sum())):
  print((abs(A[:left].sum()-A[left:].sum())))
else:
  print((abs(A[:left+1].sum()-A[left+1:].sum())))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=list(map(int, input().split()))
A=np.array(A)
left=0 
right=N-1
while left<right:
  ans=0
  mid=(left+right)//2
  if A[:mid+1].sum()<A[mid+1:].sum():
    ans=min(ans,A[:mid+1].sum()<A[mid+1:])
    left=mid+1
  else:
    right=mid
print(ans)

Fixed submission:
import numpy as np
N=int(input())
A=list(map(int, input().split()))
A=np.array(A)
left=0 
right=N-1
while left<right:
  mid=(left+right)//2
  if A[:mid+1].sum()<A[mid+1:].sum():
    left=mid+1
  else:
    right=mid
if (abs(A[:left+1].sum()-A[left+1:].sum()))>(abs(A[:left].sum()-A[left:].sum())):
  print((abs(A[:left].sum()-A[left:].sum())))
else:
  print((abs(A[:left+1].sum()-A[left+1:].sum())))
Buggy python submission (verdict: Runtime Error):
r=int(input())
print(int(r**2)

Fixed submission:
r=int(input())
print(int(r**2))
Buggy python submission (verdict: Runtime Error):
N, S = map(int, input().split())
n = len(S)
if n % 2 == 0:
    if S[:n // 2] == S[n // 2:]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Fixed submission:
N = int(input())
S = input()
n = len(S)
if n % 2 == 0:
    if S[:n // 2] == S[n // 2:]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N, S = map(int, input().split())
n = len(S)
if n % 2 == 0:
    if S[:n // 2] == S[n // 2:]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Fixed submission:
N = int(input())
S = input()
n = len(S)
if n % 2 == 0:
    if S[:n // 2] == S[n // 2:]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial
X, Y = map(int,input().split())
if (X+Y)%3!=0:
    print(0)
else:
    itr=(X+Y)//3
    x_mx=itr*2
    if itr<=X and X<=x_mx and itr<=Y and Y<=x_mx and X+Y==itr+x_mx:
        c=X-itr
        n=factorial(itr)
        r=factorial(c)
        n_r=factorial(itr-c)
        f=(n//(r*n_r))%(10**9+7)
        print(f)
    else:
        print(0)

Fixed submission:
X, Y = map(int,input().split())
# https://qiita.com/derodero24/items/
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

if (X+Y)%3!=0:
    print(0)
else:
    itr=(X+Y)//3
    x_mx=itr*2
    if itr<=X and X<=x_mx and itr<=Y and Y<=x_mx and X+Y==itr+x_mx:
        c=X-itr
        f=cmb(itr, c)
        f=f%(10**9+7)
        print(f)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
from math import factorial
X, Y = map(int,input().split())
if (X+Y)%3!=0:
    print(0)
else:
    itr=(X+Y)//3
    x_mx=itr*2
    flag=0
    ir=-1
    for i in range(itr,x_mx+1,1):
        ir+=1
        if X==i and Y==x_mx-ir:
            flag=1
            break
    print(flag)
    if flag==1:
        g=factorial(itr)/factorial(ir) / factorial(itr-ir)
        print(int(g%(10**9+7)))
    elif flag==0:
        print(0)

Fixed submission:
X, Y = map(int,input().split())
# https://qiita.com/derodero24/items/
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

if (X+Y)%3!=0:
    print(0)
else:
    itr=(X+Y)//3
    x_mx=itr*2
    if itr<=X and X<=x_mx and itr<=Y and Y<=x_mx and X+Y==itr+x_mx:
        c=X-itr
        f=cmb(itr, c)
        f=f%(10**9+7)
        print(f)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M, 0, -1):
    if N % i == 0:
        A = N / i
        print(int(A + i - 2))
        break

Fixed submission:
A,B = map(int,input().split())
if A>=10 or B>=10:
   print(-1)
else:
   print(A*B)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M, 0, -1):
    if N % i == 0:
        A = N / i
    	print(A + i - 2)
    	break

Fixed submission:
A,B = map(int,input().split())
if A>=10 or B>=10:
   print(-1)
else:
   print(A*B)

Buggy python submission (verdict: Runtime Error):
N = int(input())

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            break
    if i * j == N:
        print("Yes")
        break
    elif i == 9 and i * j != N:
        print("No")

Fixed submission:
A,B = map(int,input().split())
if A>=10 or B>=10:
   print(-1)
else:
   print(A*B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
 
for i in range(1,10):
  for j in range(1,10):
    if i*j==N:
      break
  if i*j==N:
    print("Yes")
    break
  elif i==9 and i*j!=N:
    print("No")

Fixed submission:
A,B = map(int,input().split())
if A>=10 or B>=10:
   print(-1)
else:
   print(A*B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
 
for i in range(1,10):
  for j in range(1,10):
    if i*j=N:
      break
  if i*j=N:
    print("Yes")
    break
  elif i==9 and i*j!=N:
    print("No")

Fixed submission:
A,B = map(int,input().split())
if A>=10 or B>=10:
   print(-1)
else:
   print(A*B)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A>=10 or B>10:
  print(-1)
else:
  print(A*B)

Fixed submission:
A,B = map(int,input().split())
if A>=10 or B>=10:
   print(-1)
else:
   print(A*B)
Buggy python submission (verdict: Runtime Error):
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            break
    if i * j == N:
        print("Yes")
        break
    elif i == 9 and i * j != N:
        print("No")

Fixed submission:
N = int(input())

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            break
    if i * j == N:
        print("Yes")
        break
    elif i == 9 and i * j != N:
        print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
 
for i in range(1,10):
  for j in range(1,10):
    if i*j=N:
      break
  if i*j=N:
    print("Yes")
      break
  elif i==9 and i*j!=N:
    print("No")

Fixed submission:
N = int(input())

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            break
    if i * j == N:
        print("Yes")
        break
    elif i == 9 and i * j != N:
        print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
 
for i in range(9,1,-1):
	if N%i==0:
      if N//i==1:
        print("Yes")
        break
      for j in range(9,1,-1):
      	if N%(i*j)==0:
          print("Yes")
          break
      	print("No")
        break

Fixed submission:
N = int(input())

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            break
    if i * j == N:
        print("Yes")
        break
    elif i == 9 and i * j != N:
        print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
 
for i in range(9,1,-1):
	if N%i==0:
      if N//i==1:
        print("Yes")
      for j in range(9,1,-1):
      	if N%(i*j)==0:
          print("Yes")
          break
      	print("No")
        break

Fixed submission:
N = int(input())

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            break
    if i * j == N:
        print("Yes")
        break
    elif i == 9 and i * j != N:
        print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())

for i in range(9,0,-1):
	if N%i==0:
      for j in range(9,0,-1):
      	if N%(i*j)==0:
          print("Yes")
        else:
          print("No")
  

Fixed submission:
N = int(input())

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            break
    if i * j == N:
        print("Yes")
        break
    elif i == 9 and i * j != N:
        print("No")
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M, 0, -1):
    if N % M == 0:
        A = N / M
    	print(A + M - 2)
    	break

Fixed submission:
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M, 0, -1):
    if N % i == 0:
        A = N / i
        print(int(A + i - 2))
        break

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M, 0, -1):
    if N % M == 0:
        A = N // M
    	print(A + M - 2)
    	break

Fixed submission:
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M, 0, -1):
    if N % i == 0:
        A = N / i
        print(int(A + i - 2))
        break

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
M=int(math.sqrt(N))
for i in range(M,0,-1):
	if N%M==0:
    	A=N//M
      	print(A+M-2)
      	break

Fixed submission:
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M, 0, -1):
    if N % i == 0:
        A = N / i
        print(int(A + i - 2))
        break

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
M=int(math.sqrt(N))
for i in range(M,0,-1):
	if N%M==0:
      A=N//M
      print(A+M-2)
      break

Fixed submission:
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M, 0, -1):
    if N % i == 0:
        A = N / i
        print(int(A + i - 2))
        break
Buggy python submission (verdict: Runtime Error):
import math
a, b, c = map(int, input().split())
h=x/(a**2)
if h>b/2:
    y=2*a*h/b
    shita=math.degrees(math.atan2(y,b))
if h<=b/2:
    y=2*h-b
    y=b-y
    shita=math.degrees(math.atan2(b,y))
print(shita)

Fixed submission:
import math
a, b, x = map(int, input().split())
h=x/(a**2)
if h<b/2:
    y=2*a*h/b
    shita=math.degrees(math.atan2(b,y))
if h>=b/2:
    y=2*h-b
    t=b-y
    shita=math.degrees(math.atan2(t,a))
print(shita)

Buggy python submission (verdict: Runtime Error):
import math
h=x/(a**2)
if h>b/2:
    y=2*a*h/b
    shita=math.degrees(math.atan2(y,b))
if h<=b/2:
    y=2*h-b
    y=b-y
    shita=math.degrees(math.atan2(b,y))
print(shita)

Fixed submission:
import math
a, b, x = map(int, input().split())
h=x/(a**2)
if h<b/2:
    y=2*a*h/b
    shita=math.degrees(math.atan2(b,y))
if h>=b/2:
    y=2*h-b
    t=b-y
    shita=math.degrees(math.atan2(t,a))
print(shita)
Buggy python submission (verdict: Runtime Error):
n=int(input())
d = list(map(int, input().split()))
a=0
for i in range(0,n,1):
  if d[i]==d[-1]:
     break
  if n==i+1:
     a+=d[i]*d[i+1]
     break
  for j in d[i+1:]:
    a+=d[i]*j
print(a)

Fixed submission:
a, b=map(int, input().split())
if a-b*2<=0:
  print(0)
else: 
  print(a-b*2)

Buggy python submission (verdict: Runtime Error):
n=int(input())
d = list(map(int, input().split()))
a=0
for i in range(0,n,1):
  if d[i]==d[-1]:
    break
  if n==i+1:
    a+=d[i]*d[i+1]
    break
  for j in d[i+1:]:
    a+=d[i]*j
print(a)

Fixed submission:
a, b=map(int, input().split())
if a-b*2<=0:
  print(0)
else: 
  print(a-b*2)
Buggy python submission (verdict: Runtime Error):
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)

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

Buggy python submission (verdict: Runtime Error):
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)

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

Buggy python submission (verdict: Runtime Error):
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)

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