Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N, K = map(int,input().split())
lists = combinations(range(N),K)
s = list(map(int,input().split()))
min_result = 1000000000000
for li in lists:
    total = 0
    for l in li:
        total += s[l]
    min_result = min(min_result,total)

print(min_result)

Fixed submission:
N, K = map(int,input().split())
s = list(map(int,input().split()))
s.sort()
print(sum(s[:K]))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N, K = map(int,input().split())
lists = combinations(range(N),K)
s = list(map(int,input().split()))
min_result = 10 ** 9
for li in lists:
    total = 0
    for l in li:
        total += s[l]
    min_result = min(min_result,total)

print(min_result)

Fixed submission:
N, K = map(int,input().split())
s = list(map(int,input().split()))
s.sort()
print(sum(s[:K]))
Buggy python submission (verdict: Runtime Error):
import math
X , Y = map(input().split())
X = int(X)
Y = float(Y)
print(math.floor(X * Y))


Fixed submission:
X , Y = input().split()
X = int(X)
Y = round(float(Y) * 100)
print((X * Y) // 100 )
Buggy python submission (verdict: Runtime Error):
N, M, X = map(int,input().split())
skill_book = []
for i in range(N):
    skill_book.append(list(map(int, input().split())))
box = []
flag = 1
for i in range(1 << M):
    total = [0] * (M + 1)
    for j in range(M):
        if (i >> j) & 1:
            total = [x + y for (x, y) in zip(total, skill_book[j])]
    over = 1
    for j in range(1, len(total)):
        if not (total[j] >= X):
            over = 0
    if over == 1 and len(total) > 0:
        box.append(total[0])

print(min(box))

Fixed submission:
N, M, X = map(int,input().split())
skill_book = []
for i in range(N):
    skill_book.append(list(map(int, input().split())))
box = []
flag = 1
for i in range(1 << N):
    total = [0] * (M + 1)
    for j in range(N):
        if (i >> j) & 1:
            total = [x + y for (x, y) in zip(total, skill_book[j])]
    over = 1
    for j in range(1, len(total)):
        if not (total[j] >= X):
            over = 0
    if over == 1 and len(total) > 0:
        box.append(total[0])
if len(box) > 0:
    print(min(box))
else:
    print('-1')
Buggy python submission (verdict: Runtime Error):
k = int(input())
k_under, k_over = map(int,input(),split())
result　= 1
cnt = 0
while k * cnt > k_over:
	if k * cnt > k_under:
      print('OK')
      result = 0
    cnt += 1

if result == 1:
	print('NG')
    

Fixed submission:
k = int(input())
k_under, k_over = map(int,input().split())

if (k_under // k + ((k_under % k != 0) * 1)) * k > k_over:
    print('NG')
else:
    print('OK')
Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
P  = list(map(int,input().split()))
Q  = list(map(int,input().split()))
per_list = [list(i) for i in itertools.permutations(range(1,N + 1))]

print(abs(per_list.index(P) - per_list(Q)))

Fixed submission:
import itertools
N = int(input())
P  = list(map(int,input().split()))
Q  = list(map(int,input().split()))
per_list = [list(i) for i in itertools.permutations(range(1,N + 1))]

print(abs(per_list.index(P) - per_list.index(Q)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = 0
for i in range(10):
    a = s.find(i)
    if a == -1:
        continue
    for j in range(10):
        b = s.find(j,a+1)
        if b == -1:
            continue        
        for k in range(10):
            if str(k) in s[b+1::]:
                cnt += 1
print(cnt

Fixed submission:
n = int(input())
S = input()
count = 0
for i in range(10):
    a = S.find(str(i))
    if a == -1:
        continue
    for j in range(10):
        b = S.find(str(j),a + 1)
        if b == -1:
            continue
        for k in range(10):
            if str(k) in S[b+1::]:
                count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
box = []
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if not str(s[i])+str(s[j])+str(s[k]) in box:
                box.append(str(s[i])+str(s[j])+str(s[k]))
print(len(box))

Fixed submission:
n = int(input())
S = input()
count = 0
for i in range(10):
    a = S.find(str(i))
    if a == -1:
        continue
    for j in range(10):
        b = S.find(str(j),a + 1)
        if b == -1:
            continue
        for k in range(10):
            if str(k) in S[b+1::]:
                count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
key = {}
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            key[S[i] + S[j] + S[k]] = 1
print(len(key))

Fixed submission:
n = int(input())
S = input()
count = 0
for i in range(10):
    a = S.find(str(i))
    if a == -1:
        continue
    for j in range(10):
        b = S.find(str(j),a + 1)
        if b == -1:
            continue
        for k in range(10):
            if str(k) in S[b+1::]:
                count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
A, B, AB, X, Y = map(int,input().split())
min_sheet = min(X,Y)

if A + B >= AB * 2:
    min_price = min(AB * 2 * min_sheet + A(X - min_sheet) + B(Y - min_sheet), AB * 2 * max(X,Y))
else:
    min_price = A * X + B * Y
    
print(min_price)

Fixed submission:
A, B, AB, X, Y = map(int,input().split())
min_sheet = min(X,Y)

if A + B >= AB * 2:
    min_price = min(AB * 2 * min_sheet + A * (X - min_sheet) + B * (Y - min_sheet), AB * 2 * max(X,Y))
else:
    min_price = A * X + B * Y
    
print(min_price)

Buggy python submission (verdict: Runtime Error):
A, B, AB, X, Y = map(int, input().split())
max_price = A * X + B * Y
flag = 1
mid_price = min((A + B) // 2, AB)
if A > mid_price and B > mid_price:
    min_sheet = max(X, Y)
elif A > mid_price:
    min_sheet = X
elif B > mid_price:
    min_sheet = Y

price = max_price + 1

while flag:
    flag = 0
    if A >= mid_price and B >= mid_price:
        price = min_sheet * AB * 2
        X -= min_sheet
        Y -= min_sheet
    if X < 1 and Y < 1:
        break
    elif X > 0:
        price += X * A
        if Y > 0:
            price += Y * B
    elif Y > 0:
        price += Y * B
        if X > 0:
            price += X * A

print(min(max_price, price))


Fixed submission:
A, B, AB, X, Y = map(int,input().split())
min_sheet = min(X,Y)

if A + B >= AB * 2:
    min_price = min(AB * 2 * min_sheet + A * (X - min_sheet) + B * (Y - min_sheet), AB * 2 * max(X,Y))
else:
    min_price = A * X + B * Y
    
print(min_price)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
divisor = (1 + n) // 2
min_value = 10 ** 10 + 1
while i <= divisor:
    if n % i == 0:
        divisor = min(n // i, divisor)
        if max(len(str(i)),len(str(n // i))) > min_value:
            break
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)


Fixed submission:
n = int(input())
i = 1
divisor = n ** 0.5
min_value = 10 ** 10 + 1
while i < divisor + 1:
    if n % i == 0:
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
divisor = (1 + n) // 2
min_value = 10 ** 10 + 1
while i <= divisor:
    if n % i == 0:
        divisor = n // i
        if max(len(str(i)),len(str(n // i))) > min_value:
            break
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)


Fixed submission:
n = int(input())
i = 1
divisor = n ** 0.5
min_value = 10 ** 10 + 1
while i < divisor + 1:
    if n % i == 0:
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
divisor = n
min_value = 10 ** 10 + 1
while i <= divisor:
    if n % i == 0:
        divisor = n // i
        if max(len(str(i)),len(str(n // i))) > min_value:
            break
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)


Fixed submission:
n = int(input())
i = 1
divisor = n ** 0.5
min_value = 10 ** 10 + 1
while i < divisor + 1:
    if n % i == 0:
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
min_value = 10 ** 9 + 1
while i <= n:
    if n % i == 0:
        if max(len(str(i)),len(str(n // i))) > min_value:
            break
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)

Fixed submission:
n = int(input())
i = 1
divisor = n ** 0.5
min_value = 10 ** 10 + 1
while i < divisor + 1:
    if n % i == 0:
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
price = int(input())
d_price = int(input())
if K >= N:
    total = N * prive
    print(total)
else:
    total = K * price
    N -= K
    total += N * d_price
    print(total)


Fixed submission:
N = int(input())
K = int(input())
price = int(input())
d_price = int(input())
if K >= N:
    total = N * price
    print(total)
else:
    total = K * price
    N -= K
    total += N * d_price
    print(total)
Buggy python submission (verdict: Runtime Error):
S = input()
search_dic = {i:0 for i in range(ord('a'),ord('z'))}
for ss in S:
    search_dic[ord(ss)] += 1
    
max_v = max([(y,x) for x,y in search_dic.items()])
max_v = [chr(max_v[1]),max_v[0]]
major = round(len(S) / 2)

if max_v[1] >= major:
    r = S[::-1]
    print(S.index(max_v[0]) + 1,len(r) - r.index(max_v[0]) + 1)
else:
    print(-1,-1)

Fixed submission:
S = input()
N = len(S)
for i in range(N-1):
    if S[i] == S[i + 1]:
        print(i+1,i+2)
        exit()
for i in range(N-2):
    if S[i] == S[i + 2]:
        print(i + 1 ,i + 3)
        exit()
        
print(-1,-1)
Buggy python submission (verdict: Runtime Error):
##### 解けた #####

n=list(map(int,list(input())))
no=[] # 出力

for ni in n:
    no.append(10-ni)

print("".join(no))

Fixed submission:
##### 解けた #####

n=list(map(int,list(input())))
no=[] # 出力

for ni in n:
    no.append(str(10-ni))

print("".join(no))
Buggy python submission (verdict: Runtime Error):
##### 解けた #####

import numpy as np

S=np.asarray(list(input()))
T=np.asarray(list(input()))
OKflag=False # 一致するかどうかを示すフラグ

for i in range(len(S)):
    Sr=np.roll(S,i) # ロールさせる
    
    if Sr==T: # 一致する場合、フラグを立てて終了
        OKflag=True
        break

if OKflag==True: # 回転させて一致するなら
    print("Yes")
else: # 一致しないなら
    print("No")

Fixed submission:
##### 解けた #####

import numpy as np

S=np.asarray(list(input()))
T=np.asarray(list(input()))
OKflag=False # 一致するかどうかを示すフラグ

for i in range(len(S)):
    Sr=np.roll(S,i) # ロールさせる
    
    if (Sr==T).all(): # 一致する場合、フラグを立てて終了
        OKflag=True
        break

if OKflag==True: # 回転させて一致するなら
    print("Yes")
else: # 一致しないなら
    print("No")
Buggy python submission (verdict: Runtime Error):
##### 解けた #####

N=input()
sn=sum(map(int,list(N))))

if int(N)%sn==0: # 割り切れる場合
    print("Yes")
else: # 割り切れない場合
    print("No")

Fixed submission:
##### 解けた #####

N=input()
sn=sum(map(int,list(N)))

if int(N)%sn==0: # 割り切れる場合
    print("Yes")
else: # 割り切れない場合
    print("No")
Buggy python submission (verdict: Runtime Error):
##### 解けた #####

from math import sqrt

ab=int("".join(input().split(" "))))

if sqrt(ab).is_integer(): # 平方数なら
    print("Yes")
else: # 平方数ではないなら
    print("No")

Fixed submission:
##### 解けた #####

from math import sqrt

ab=int("".join(input().split(" ")))

if sqrt(ab).is_integer(): # 平方数なら
    print("Yes")
else: # 平方数ではないなら
    print("No")
Buggy python submission (verdict: Runtime Error):
##### 解けた #####

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

print((a+b)//2)

Fixed submission:
##### 解けた #####
from math import ceil

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

print(ceil((a+b)/2))
Buggy python submission (verdict: Runtime Error):
##### 解けた #####

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

if sum(a,b)==c or sum(a,c)==b or sum(b,c)==a:
    print("Yes")
else:
    print("No")

Fixed submission:
##### 解けた #####

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

if (a+b)==c or (a+c)==b or (b+c)==a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
##### 解けた #####

S=input()
A=[""]

for s in S: # 入力の文字列1文字ずつ見てゆく
    if s in ["0","1"]: # もし0か1の場合、それを追加
        A.append(s)
    elif s=="B": # もしバックスペースの場合、1文字削除
        A.pop(-1)

print("".join(A))

Fixed submission:
##### 解けた #####

S=input()
A=[""]

for s in S: # 入力の文字列1文字ずつ見てゆく
    if s in ["0","1"]: # もし0か1の場合、それを追加
        A.append(s)
    elif s=="B": # もしバックスペースの場合、1文字削除
        if len(A)>=1: # 長さが1以上の場合のみ削除
            A.pop(-1)

print("".join(A))
Buggy python submission (verdict: Runtime Error):
##### 解けた #####

A,B,C=list(map(int,input().split(" ")))

if (len(A)==5 and len(B)==7 and len(C)==5) or (len(A)==7 and len(B)==5 and len(C)==5) or (len(A)==5 and len(B)==5 and len(C)==7):
    print("YES")
else:
    print("NO")

Fixed submission:
##### 解けた #####

A,B,C=list(map(int,input().split(" ")))

if (A==5 and B==7 and C==5) or (A==7 and B==5 and C==5) or (A==5 and B==5 and C==7):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s = str(input())
if (s[3]==s[4]) and (s[5]==s[6]):
  print("Yes")
else:
  print("No")

Fixed submission:
s = str(input())
if (s[2]==s[3]) and (s[4]==s[5]):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = str(input())
if s[3]==s[4] and s[5]==s[6]:
  print("Yes")
else:
  print("No")

Fixed submission:
s = str(input())
if (s[2]==s[3]) and (s[4]==s[5]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
def ex_value(dice):
  return (1+dice)/2
def main():
  n,k = map(int, input().split())
  list_p = list(map(int, input().split()))
  list_ex_val = list(map(ex_value, list_p))
  print(max([sum(list_ex_val[i:i+k]) for i in range(n-k+1)]))
     
if __name__ == '__main__':
  main()

Fixed submission:
s,t = map(str, input().split())
a,b = map(int, input().split())
u = str(input())

if s == u:
    print(a-1, b)
else:
    print(a, b-1)

Buggy python submission (verdict: Runtime Error):
def main():
    def ex_value(dice):
      n = 0
      for i in range(1,dice+1):
        n += i*1/dice
      return(n)
    n,k = map(int, input().split())
    list_p = list(map(int, input().split()))
    list_ex_val = list(map(ex_value, list_p))
    sum_k=[]
    for i in range(n-k+1):
        sum_k.append(sum(list_ex_val[i:i+k]))
    print(max(sum_k))

if __name__ == '__main__':
    main()

Fixed submission:
s,t = map(str, input().split())
a,b = map(int, input().split())
u = str(input())

if s == u:
    print(a-1, b)
else:
    print(a, b-1)
Buggy python submission (verdict: Time Limit Exceeded):
h,m = map(int, input().split())
atack = list(map(int, input().split()))

atack_select=[] #候補を保存しておくリスト

for i in range(m):
    atack_select.append(max(atack))
    atack.remove(max(atack)) #最大値を消していく

if h - sum(atack_select) <= 0:
    print("Yes")
else:
    print("No")

Fixed submission:
h,m = map(int, input().split())
atack = list(map(int, input().split()))

atack.sort(reverse=True) #降順に並び替え
atack_select = atack[:m]

if h - sum(atack_select) <= 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
h,m = map(int, input().split())
atack = list(map(int, input().split()))

atack_select=[] #候補を保存しておくリスト

for i in range(m):
    atack_select.append(max(atack))
    atack = list(set(atack) - set(atack_select)) #最大値を除いたリスト

if h - sum(atack_select) <= 0:
    print("Yes")
else:
    print("No")

Fixed submission:
h,m = map(int, input().split())
atack = list(map(int, input().split()))

atack.sort(reverse=True) #降順に並び替え
atack_select = atack[:m]

if h - sum(atack_select) <= 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
k, x = map(int, input().split())
if 500*k >= x:
  print("Yes")
  else:
    print("No")

Fixed submission:
k, x = map(int, input().split())
if 500*k >= x:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
import numpy as np

N, D = map(int, input().split())
X = [[int(i) for i in input().split()] for i in range(N)]

is_int = 0
for i in range(N-1):
  for j in range(i+1, N-i):
    l1 = np.array(X[i])
    l2 = np.array(X[j])
    d = math.sqrt(sum((l1-l2)**2))
    if isinstance(d, int):
      is_int += 1
      print(is_int)

Fixed submission:
A = list(map(int, input().split())) 

def func(n, a, b):
  if (n*a > b):
    print(b)
  else:
    print(n*a)
    
func(A[0], A[1], A[2])
Buggy python submission (verdict: Runtime Error):
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
if not len(r):
  print(c)
else:
  print(max(c))

Fixed submission:
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
r.append(c)
if not len(r):
  print(c)
else:
  print(max(r))

Buggy python submission (verdict: Runtime Error):
r = []
c = 0
for i in input():
  if i == 'R':
    c+=1
  elif i=='S':
    r.append(c)
    c = 0
r.sort()
print(r[-1])
 

Fixed submission:
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
r.append(c)
if not len(r):
  print(c)
else:
  print(max(r))

Buggy python submission (verdict: Runtime Error):
c = 0
r = []
s = input()
s.upper()
for i in s:
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
print(max(r))

Fixed submission:
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
r.append(c)
if not len(r):
  print(c)
else:
  print(max(r))

Buggy python submission (verdict: Runtime Error):
r = []
c = 0
s = input()
s.upper()
for i in s:
  if i =='R':
    c+=1
  else:
    r.append(c)
r = list(set(r))
print(max(r))

Fixed submission:
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
r.append(c)
if not len(r):
  print(c)
else:
  print(max(r))

Buggy python submission (verdict: Runtime Error):
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
print(max(r))

Fixed submission:
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
r.append(c)
if not len(r):
  print(c)
else:
  print(max(r))

Buggy python submission (verdict: Runtime Error):
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
print(max(r))

Fixed submission:
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
r.append(c)
if not len(r):
  print(c)
else:
  print(max(r))
Buggy python submission (verdict: Runtime Error):
l,r,d=map(int,input().split())
aa=//d
bb=(l-1)//d
print(aa-bb)


Fixed submission:
l,r,d=map(int,input().split())
aa=r//d
bb=(l-1)//d
print(aa-bb)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b>=a:
  print("unsafe")
 else:
  print("safe")

Fixed submission:
a,b=map(int,input().split())
if b>=a:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
s=input()
if len(s)<6:
  print("No")
else:
  if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
    else:
      print("No")

Fixed submission:
s=input()
if len(s)<6:
    print("No")
else:
    if s[2]==s[3] and s[4]==s[5]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
l=list(map(int,input().split()))
d={}
for i in l:
    if i in d:
        d[i]+=1 
    else:
        d[i]=1 
count=0
for k in d.keys():
        x=d[k]
        if x<2:
            count+=0
        else:
            count+=math.factorial(x)/(math.factorial(x-2)*2)

for i in l:
    x=d[i]
    #print(i, x)
    if x>=2:
        val=math.factorial(x)/(math.factorial(x-2)*2)
        ans=count-val
        if x>=3:
            val1=math.factorial(x-1)/(math.factorial(x-3)*2)
        else:
            val1=0
        ans+=val1
    else:
        if x==2:
            ans=count-1 
        else:
            ans=count 
    print(int(ans))
            


Fixed submission:
import math
n=int(input())
l=list(map(int,input().split()))
d={}
for i in l:
    if i in d:
        d[i]+=1 
    else:
        d[i]=1 
count=0
for k in d.keys():
        x=d[k]
        if x<2:
            count+=0
        else:
            count+=x*(x-1)//2

for i in l:
    x=d[i]
    #print(i, x)
    if x>=2:
        val=x*(x-1)//2
        ans=count-val
        if x>=3:
            x-=1
            val1=x*(x-1)//2
        else:
            val1=0
        ans+=val1
    else:
        if x==2:
            ans=count-1 
        else:
            ans=count 
    print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
l=list(map(int,input().split()))
d={}
for i in l:
    if i in d:
        d[i]+=1 
    else:
        d[i]=1 
#print(d)
for i in l:
    count=0
    for k in d.keys():
        if k==i :
            x=d[k]
            if x<3:
                continue
            x-=1
            count+=math.factorial(x)/(math.factorial(x-2)*2)
        else:
            x=d[k]
            if x<2:
                continue
            count+=math.factorial(x)/(math.factorial(x-2)*2)
    print(int(count))        

Fixed submission:
import math
n=int(input())
l=list(map(int,input().split()))
d={}
for i in l:
    if i in d:
        d[i]+=1 
    else:
        d[i]=1 
count=0
for k in d.keys():
        x=d[k]
        if x<2:
            count+=0
        else:
            count+=x*(x-1)//2

for i in l:
    x=d[i]
    #print(i, x)
    if x>=2:
        val=x*(x-1)//2
        ans=count-val
        if x>=3:
            x-=1
            val1=x*(x-1)//2
        else:
            val1=0
        ans+=val1
    else:
        if x==2:
            ans=count-1 
        else:
            ans=count 
    print(int(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = list(map(int,input().split()))
val = 0
for i in range(len(lst)-1):
  for j in range(i+1,len(lst)):
    val += (lst[i]*lst[j])
print(val%((10**9)+7))

Fixed submission:
d,t,s = map(int,input().split())
if(d <= t*s):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
a1 = a//c if a%c else a//c-1
a2 = b//c
print(a2-a1)

Fixed submission:
l = list(map(str,input().split()))
v = ''
for i in range(len(l)):
    v = v + l[i][0]
print(v)

Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
a1 = a//c if a%x else a//c-1
a2 = b//c
print(a2-a1)

Fixed submission:
l = list(map(str,input().split()))
v = ''
for i in range(len(l)):
    v = v + l[i][0]
print(v)

Buggy python submission (verdict: Runtime Error):
a,b,x = list(map(int,input().split()))
a1 = a//x if a%x else a//x-1
a2 = b//x
print(a2-a1)

Fixed submission:
l = list(map(str,input().split()))
v = ''
for i in range(len(l)):
    v = v + l[i][0]
print(v)

Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
a = a//c
b = b//c if b%x else b//c-1
print(a-b)

Fixed submission:
l = list(map(str,input().split()))
v = ''
for i in range(len(l)):
    v = v + l[i][0]
print(v)

Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
b = a//c
b = b//c if b%c else b//c-1
print(a1-a2)

Fixed submission:
l = list(map(str,input().split()))
v = ''
for i in range(len(l)):
    v = v + l[i][0]
print(v)

Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(str,input().split()))
a = a//c
b = b//c
print(b-a)

Fixed submission:
l = list(map(str,input().split()))
v = ''
for i in range(len(l)):
    v = v + l[i][0]
print(v)
Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
a1 = a//c
a2 = b//c if b%x else b//c-1
print(a1-a2)

Fixed submission:
a,b,c = list(map(int,input().split()))
x = a//c 
y = b//c
if a%c:
    print(y-x)
else:
    print((y-x)+1)

Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(str,input().split()))
a = a/c
b = b/c
print(b-a)

Fixed submission:
a,b,c = list(map(int,input().split()))
x = a//c 
y = b//c
if a%c:
    print(y-x)
else:
    print((y-x)+1)