Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A,B = map(int.input(),split())
print(A * B)

Fixed submission:
A,B = map(int,input().split())
print(A * B)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if N[-1] == 2 :
    print("hon")
elif N[-1] == 4 :
    print("hon")
elif N[-1] == 5 :
    print("hon")
elif N[-1] == 7 :
    print("hon")
elif N[-1] == 9 :
    print("hon")
elif N[-1] == 1 :
    print("pon")
elif N[-1] == 6 :
    print("pon")
elif N[-1] == 8 :
    print("pon")
else :
    print("bon")

Fixed submission:
N=input()
if N[-1] == '2' :
    print("hon")
elif N[-1] == '4' :
    print("hon")
elif N[-1] == '5' :
    print("hon")
elif N[-1] == '7' :
    print("hon")
elif N[-1] == '9' :
    print("hon")
elif N[-1] == '0' :
    print("pon")
elif N[-1] == '1' :
    print("pon")
elif N[-1] == '6' :
    print("pon")
elif N[-1] == '8' :
    print("pon")
else :
    print("bon")

Buggy python submission (verdict: Runtime Error):
N=int(input())
if N[-1] == 2 :
    print("hon")
elif N[-1] == 4 :
    print("hon")
elif N[-1] == 5 :
    print("hon")
elif N[-1] == 7 :
    print("hon")
elif N[-1] == 9 :
    print("hon")
elif N[-1] == 1 :
    print("pon")
elif N[-1] == 6 :
    print("pon")
elif N[-1] == 8 :
    print("pon")
else :
    print("bon")

Fixed submission:
N=input()
if N[-1] == '2' :
    print("hon")
elif N[-1] == '4' :
    print("hon")
elif N[-1] == '5' :
    print("hon")
elif N[-1] == '7' :
    print("hon")
elif N[-1] == '9' :
    print("hon")
elif N[-1] == '0' :
    print("pon")
elif N[-1] == '1' :
    print("pon")
elif N[-1] == '6' :
    print("pon")
elif N[-1] == '8' :
    print("pon")
else :
    print("bon")

Buggy python submission (verdict: Runtime Error):
N=input()
if N[-1] = 2 :
    print("hon")
elif N[-1] = 4 :
    print("hon")
elif N[-1] = 5 :
    print("hon")
elif N[-1] = 7 :
    print("hon")
elif N[-1] = 9 :
    print("hon")
elif N[-1] = 1 :
    print("pon")
elif N[-1] = 6 :
    print("pon")
elif N[-1] = 8 :
    print("pon")
else :
    print("bon")

Fixed submission:
N=input()
if N[-1] == '2' :
    print("hon")
elif N[-1] == '4' :
    print("hon")
elif N[-1] == '5' :
    print("hon")
elif N[-1] == '7' :
    print("hon")
elif N[-1] == '9' :
    print("hon")
elif N[-1] == '0' :
    print("pon")
elif N[-1] == '1' :
    print("pon")
elif N[-1] == '6' :
    print("pon")
elif N[-1] == '8' :
    print("pon")
else :
    print("bon")

Buggy python submission (verdict: Runtime Error):
N=int(input())
if N[-1] = 2 :
    print("hon")
elif N[-1] = 4 :
    print("hon")
elif N[-1] = 5 :
    print("hon")
elif N[-1] = 7 :
    print("hon")
elif N[-1] = 9 :
    print("hon")
elif N[-1] = 1 :
    print("pon")
elif N[-1] = 6 :
    print("pon")
elif N[-1] = 8 :
    print("pon")
else :
    print("bon")

Fixed submission:
N=input()
if N[-1] == '2' :
    print("hon")
elif N[-1] == '4' :
    print("hon")
elif N[-1] == '5' :
    print("hon")
elif N[-1] == '7' :
    print("hon")
elif N[-1] == '9' :
    print("hon")
elif N[-1] == '0' :
    print("pon")
elif N[-1] == '1' :
    print("pon")
elif N[-1] == '6' :
    print("pon")
elif N[-1] == '8' :
    print("pon")
else :
    print("bon")
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(s)>K:
    s = s[:k] + "..."

print(s)

Fixed submission:
K = int(input())
S = input()
if len(S)>K:
   print( S[:K] + "...")
else:
    print(S)
Buggy python submission (verdict: Runtime Error):
N=input()
if N[-1] == '7':
     print("Yes")
elif N[-2] == '7':
    prnt("Yes")
elif N[-3] == '7':
    print("Yes")
else :
    print("No")

Fixed submission:
N=input()
if N[-1] == '7':
     print("Yes")
elif N[-2] == '7':
    print("Yes")
elif N[-3] == '7':
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
N=int(input())
if N[-1] == '7':
     print("Yes")
elif N[-2] == '7':
    prnt("Yes")
elif N[-3] == '7':
    print("Yes")
else :
    print("No")

Fixed submission:
N=input()
if N[-1] == '7':
     print("Yes")
elif N[-2] == '7':
    print("Yes")
elif N[-3] == '7':
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
N=int(input())
if N[-1] == 7:
     print("Yes")
elif N[-2] == 7:
    prnt("Yes")
elif N[-3] == 7:
    print("Yes")
else :
    print("No")

Fixed submission:
N=input()
if N[-1] == '7':
     print("Yes")
elif N[-2] == '7':
    print("Yes")
elif N[-3] == '7':
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Runtime Error):
s=input()
if s == ABB :
    print("Yes")
elif s == AAB :
    print("Yes")
elif s == ABA :
    print("Yes")
elif s == BAA :
    print("Yes")
elif s == BBA :
    print("Yes")
elif s == BAB :
    print("Yes")
else :
    print("No")


Fixed submission:
s=input()
if s == "ABB" :
    print("Yes")
elif s == "AAB" :
    print("Yes")
elif s == "ABA" :
    print("Yes")
elif s == "BAA" :
    print("Yes")
elif s == "BBA" :
    print("Yes")
elif s == "BAB" :
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
s=input()
if s == AAA :
    print("Yes")
elif s == ABB :
    print("Yes")
elif s == AAB :
    print("Yes")
elif s == ABA :
    print("Yes")
elif s == BAA :
    print("Yes")
elif s == BBA :
    print("Yes")
elif s == BAB :
    print("Yes")
else :
    print("No")


Fixed submission:
s=input()
if s == "ABB" :
    print("Yes")
elif s == "AAB" :
    print("Yes")
elif s == "ABA" :
    print("Yes")
elif s == "BAA" :
    print("Yes")
elif s == "BBA" :
    print("Yes")
elif s == "BAB" :
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
if s == AAA :
    print("Yes")
elif s == ABB :
    print("Yes")
elif s == AAB :
    print("Yes")
elif s == ABA :
    print("Yes")
elif s == BAA :
    print("Yes")
elif s == BBA :
    print("Yes")
elif s == BAB :
    print("Yes")
else :
    print("No")

Fixed submission:
s=input()
if s == "ABB" :
    print("Yes")
elif s == "AAB" :
    print("Yes")
elif s == "ABA" :
    print("Yes")
elif s == "BAA" :
    print("Yes")
elif s == "BBA" :
    print("Yes")
elif s == "BAB" :
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c = int(input().split())
if a == b != c :
    print("Yes")
elif b == c != a :
    print("Yes")
elif a == c != b :
    print("Yes")
else :
    print("No")


Fixed submission:
a,b,c = map(int,input().split())
if a == b != c :
    print("Yes")
elif b == c != a :
    print("Yes")
elif a == c != b :
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = int(input().split())
if a == b != c :
    print("Yes")
elif b == c != a :
    print("Yes")
elif a == c != b :
    print("Yes")
else :
    print("No")


Fixed submission:
a,b,c = map(int,input().split())
if a == b != c :
    print("Yes")
elif b == c != a :
    print("Yes")
elif a == c != b :
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = int(input().split())
if a = b != c :
    print("Yes")
elif b = c != a :
    print("Yes")
elif a = c != b :
    print("Yes")
else :
    print("No")

Fixed submission:
a,b,c = map(int,input().split())
if a == b != c :
    print("Yes")
elif b == c != a :
    print("Yes")
elif a == c != b :
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Runtime Error):
n,m=map(int.input(),split())
if n == m :
    print("Yes")
else :
    print("No")

Fixed submission:
n,m=map(int,input().split())
if n == m :
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a < b :
    print(aをb桁)
elif b < a :
    print(bをa桁)
else :
    print(aをb桁)

Fixed submission:
a,b = input().split()
atxt = ''.join([a for _ in range(int(b))])
btxt = ''.join([b for _ in range(int(a))])
if atxt <= btxt :
    print(atxt)
else :
    print(btxt)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a < b :
    print(aをb桁)
elif b < a :
    print(bをa桁)
else :
    print(aをb桁)

Fixed submission:
a,b = input().split()
atxt = ''.join([a for _ in range(int(b))])
btxt = ''.join([b for _ in range(int(a))])
if atxt <= btxt :
    print(atxt)
else :
    print(btxt)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a == 

Fixed submission:
a,b = input().split()
atxt = ''.join([a for _ in range(int(b))])
btxt = ''.join([b for _ in range(int(a))])
if atxt <= btxt :
    print(atxt)
else :
    print(btxt)
Buggy python submission (verdict: Runtime Error):
k,x = map(int.input(),split())
if x <= k :
    print('Yes')
else :
    print('No')

Fixed submission:
k,x = map(int,input().split())
if x <= 500*k :
    print('Yes')
else :
    print('No')

Buggy python submission (verdict: Runtime Error):
k,x=map(int.input(),split())
if x <= k :
    print("Yes")
else :
    print("No")


Fixed submission:
k,x = map(int,input().split())
if x <= 500*k :
    print('Yes')
else :
    print('No')

Buggy python submission (verdict: Runtime Error):
k,x=map(int.input(),split())
if x <= k :
  print('Yes')
else :
  print('No')

Fixed submission:
k,x = map(int,input().split())
if x <= 500*k :
    print('Yes')
else :
    print('No')

Buggy python submission (verdict: Runtime Error):
k=intinput()
x=intinput()
if x <= k :
  print("Yes")
else :
  print("No")


Fixed submission:
k,x = map(int,input().split())
if x <= 500*k :
    print('Yes')
else :
    print('No')

Buggy python submission (verdict: Runtime Error):
k=int(input())
x=int(input())
if x <= k :
  print("Yes")
else :
  print("No")

Fixed submission:
k,x = map(int,input().split())
if x <= 500*k :
    print('Yes')
else :
    print('No')
Buggy python submission (verdict: Runtime Error):
s,t=int(input().split())
print(t+s)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy python submission (verdict: Runtime Error):
S,T=map(int,input().split())
	print(T+S)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy python submission (verdict: Runtime Error):
S,T=map(int,input().split())
	print(S+T)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy python submission (verdict: Runtime Error):
S,T=map(int,input().split())
print(T+S)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy python submission (verdict: Runtime Error):
S=input().split("区切り文字")
T=input().split("区切り文字")
print(S+T)

Fixed submission:
s,t=input().split()
print(t+s)
Buggy python submission (verdict: Runtime Error):
a1,a2,a3=int(input(),split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<=21 :
    print('win')


Fixed submission:
a1,a2,a3=map(int,input().split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')

Buggy python submission (verdict: Runtime Error):
a1=int(input())
a2=int(input())
a3=int(input())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<=21 :
    print('win')


Fixed submission:
a1,a2,a3=map(int,input().split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')

Buggy python submission (verdict: Runtime Error):
a1=int(input())
a2=int(input())
a3=int(input())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')

Fixed submission:
a1,a2,a3=map(int,input().split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')

Buggy python submission (verdict: Runtime Error):
a1,a2,a3=int(input(),split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')

Fixed submission:
a1,a2,a3=map(int,input().split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')
Buggy python submission (verdict: Runtime Error):
a,b = map(int.input(),split())
if a <= 9 and b <= 9 :
    print(a*b)
else :
    print(-1)

Fixed submission:
a,b = map(int,input().split())
if a <= 9 and b <= 9 :
    print(a*b)
else :
    print(-1)
Buggy python submission (verdict: Runtime Error):
n - int(input())
if n == 1 :
    print(1/1)
elif n % 2 == 0 :
    print(1/2)
else :
    print(((n+1)/2)/n)

Fixed submission:
N=int(input())
if N%2==0:
    print(0.5)
if N%2==1:
    print((N+1)/(2*N))
Buggy python submission (verdict: Runtime Error):
x,n = list(map(int,input().split()))
if n == 0:
  print(x)
  exit()

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

import bisect
p.sort()
i = bisect.bisect_left(p,x)

for h in range(1, p[-1]-p[0]+2):
  if p[i-h] != x-h:
    print(x-h)
    exit()
  elif p[i+h] != x+h:
    print(x+h)
    exit()    


Fixed submission:
x,n = list(map(int,input().split()))
if n == 0:
  print(x)
  exit()

p = list(map(int,input().split()))
p = [-1] + p + [102]
import bisect
p.sort()
i = bisect.bisect_left(p,x)
if p[i] != x:
    print(x)
    exit()

for h in range(102):
  if p[i-h] != x-h:
    print(x-h)
    exit()
  elif p[i+h] != x+h:
    print(x+h)
    exit()

Buggy python submission (verdict: Runtime Error):
x,n = list(map(int,input().split()))
if n == 0:
  print(x)
  exit()

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

import bisect
p.sort()
i = bisect.bisect_left(p,x)
print(p)
for h in range(1, p[-1]-p[0]+2):
  if p[i-h] != x-h:
    print(x-h)
    exit()
  elif p[i+h] != x+h:
    print(x+h)
    exit()    


Fixed submission:
x,n = list(map(int,input().split()))
if n == 0:
  print(x)
  exit()

p = list(map(int,input().split()))
p = [-1] + p + [102]
import bisect
p.sort()
i = bisect.bisect_left(p,x)
if p[i] != x:
    print(x)
    exit()

for h in range(102):
  if p[i-h] != x-h:
    print(x-h)
    exit()
  elif p[i+h] != x+h:
    print(x+h)
    exit()
Buggy python submission (verdict: Time Limit Exceeded):
n = list(map(int,input().split()))
A = list(map(int,input().split()))
ans = 1
for a in A:
  ans  = ans * a

if ans > 10**18:
  print(-1)
else:
  print(ans)


Fixed submission:
n = list(map(int,input().split()))
A = list(map(int,input().split()))
A.sort()
ans = 1
for a in A:
  ans  = ans * a
  if ans > 10**18:exit(print(-1))

print(ans)
Buggy python submission (verdict: Runtime Error):
from itertools import groupby
n =int(input())

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n%i == 0:
      n //= i
      table.append(i)
      i += 1
  if n > 1:
    table.append(n)
  return table

from itertools import groupby
ans = 0
p = prime_decomposition(n)
for k,g in p:
  gn = len(list(g))
  for i in range(1,1000000000000):
    gn -= i
    if gn >= 0:
      ans += 1
    else:
      break
print(ans)

Fixed submission:
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

from itertools import groupby
N = int(input())
P = prime_decomposition(N)
ans = 0
for v, g in groupby(P):
    n = len(list(g))
    for i in range(1, 100000):
        n -= i
        if n >= 0:
            ans += 1
        else:
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
A = list(map(int,input().split()))

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:break
  dp[t] = i
if k == 2:
  exit(print(t+1))
l = i - dp[t]
K = (k-dp[t])%l + dp[t]

for i in range(n):
  if dp[i] == K:exit(print(i+1))



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

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
flg = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:
    flg = 1
    break
  dp[t] = i
if flg == 0:
  exit(print(t+1))
elif k == 2:
  exit(print(t+1))

l = i - dp[t]
K = (k-dp[t])%l + dp[t]

for i in range(n):
  if dp[i] == K:exit(print(i+1))

Buggy python submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
A = list(map(int,input().split()))

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:break
  dp[t] = i
if k == 2:
  exit(print(t+1))
l = i - dp[t]
K = (k-dp[t])%l + dp[t]
print(dp)
for i in range(n):
  if dp[i] == K:exit(print(i+1))



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

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
flg = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:
    flg = 1
    break
  dp[t] = i
if flg == 0:
  exit(print(t+1))
elif k == 2:
  exit(print(t+1))

l = i - dp[t]
K = (k-dp[t])%l + dp[t]

for i in range(n):
  if dp[i] == K:exit(print(i+1))

Buggy python submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
A = list(map(int,input().split()))

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:break
  dp[t] = i
  
l = i - dp[t]
K = (k-dp[t])%l + dp[t]
print(dp)
for i in range(n):
  if dp[i] == K:exit(print(i+1))

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

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
flg = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:
    flg = 1
    break
  dp[t] = i
if flg == 0:
  exit(print(t+1))
elif k == 2:
  exit(print(t+1))

l = i - dp[t]
K = (k-dp[t])%l + dp[t]

for i in range(n):
  if dp[i] == K:exit(print(i+1))

Buggy python submission (verdict: Runtime Error):

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

t = 0
dp = [-1] * n
dp[0] = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:break
  dp[t] = i
  
l = i - dp[t]
K = (k-dp[t])%l + dp[t]

for i in range(n):
  if dp[i] == K:exit(print(i+1))




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

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
flg = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:
    flg = 1
    break
  dp[t] = i
if flg == 0:
  exit(print(t+1))
elif k == 2:
  exit(print(t+1))

l = i - dp[t]
K = (k-dp[t])%l + dp[t]

for i in range(n):
  if dp[i] == K:exit(print(i+1))
Buggy python submission (verdict: Runtime Error):
x = int(input())

b = int(pow(x, 1/5))

for i in range(100000):
  A =  x + (b-i)**5
  a = pow(A, 1/5)
  if float(a).is_integer():
    exit(print(int(a), int(b+i)))
  

Fixed submission:

x = int(input())
y = int(pow(x, 1/5))*2
A = [i**5 for i in range(y+1)]
B = [i**5 for i in range(y+1)]

for i in range(len(A)):
  for j in range(len(B)):
    if ( A[i] + B[j] ) == x:
      if A[i] > B[j]:
        exit(print(i, -j))
      else:
        exit(print(j, -i))
    elif ( A[i] - B[j] ) == x:
      exit(print(i, j))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))

ni = np.array([i for i in range(n)])

ap = a + ni
an = (a - ni) * -1
an.sort()
ans = 0
for j in an[::-1]:
  if j <= 0:break
  for i in ap:
    if j == i:
      ans += 1

print(ans)

Fixed submission:
import numpy as np
from collections import Counter
n = int(input())
a = np.array(list(map(int, input().split())))
ni = np.array([i for i in range(n)])

ap = a + ni
an = (a - ni) * -1

cp = Counter(ap)
cn = Counter(an)

ans = 0
for i in cp.keys():
  ans += cp[i] * cn[i] 

print(ans)

Buggy python submission (verdict: Runtime Error):

ni = np.array([i for i in range(n)])

ap = a + ni
an = (a - ni) * -1
an.sort()
ans = 0
for j in an[::-1]:
  if j <= 0:break
  for i in ap:
    if j == i:
      ans += 1

print(ans)

Fixed submission:
import numpy as np
from collections import Counter
n = int(input())
a = np.array(list(map(int, input().split())))
ni = np.array([i for i in range(n)])

ap = a + ni
an = (a - ni) * -1

cp = Counter(ap)
cn = Counter(an)

ans = 0
for i in cp.keys():
  ans += cp[i] * cn[i] 

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(n):
  x = i+a[i]
  for j in range(x+1, n):
      if j - x == a[j]:
        ans += 1

print(ans)

Fixed submission:
import numpy as np
from collections import Counter
n = int(input())
a = np.array(list(map(int, input().split())))
ni = np.array([i for i in range(n)])

ap = a + ni
an = (a - ni) * -1

cp = Counter(ap)
cn = Counter(an)

ans = 0
for i in cp.keys():
  ans += cp[i] * cn[i] 

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(n):
    for j in range(i+a[i]-1, n):
        if a[i] + a[j] == abs(i-j):
          ans += 1

print(ans)

Fixed submission:
import numpy as np
from collections import Counter
n = int(input())
a = np.array(list(map(int, input().split())))
ni = np.array([i for i in range(n)])

ap = a + ni
an = (a - ni) * -1

cp = Counter(ap)
cn = Counter(an)

ans = 0
for i in cp.keys():
  ans += cp[i] * cn[i] 

print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n,a,b,c = list(map(int, input().split()))
s = [[0]*2 for _ in range(n)]
S = []
for i in range(n):
  X = input()
  S += X
  cnt = 0
  for x in X:
    if x == 'A':
      s[i][cnt] = 0
    elif x == 'B':
      s[i][cnt] = 1
    else:
      s[i][cnt] = 2
    cnt += 1

if (a + b + c) == 0:exit(print('No'))
abc = [a,b,c]
x = s[0][0]
y = s[0][1]
if abc[x] == 0 and abc[y] == 0:
  exit(print('No'))


def con(x):
  if x == 0:
    return 'A'
  elif x == 1:
    return 'B'
  else:
    return 'C'

def sel(i):
  x = s[i][0]
  y = s[i][1]
  if abc[x] == 0:
    print(con(x))
    abc[x] += 1
    abc[y] -= 1
  elif abc[y] == 0:
    print(con(y))
    abc[y] += 1
    abc[x] -= 1
  else:
    nx = s[i+1][0]
    ny = s[i+1][1]
    if abc[nx] == 0:
      if nx == x:
        print(con(x))
        abc[x] += 1
        abc[y] -= 1
      elif nx == y:
        print(con(y))
        abc[y] += 1
        abc[x] -= 1 
    elif abc[ny] == 0:
      if ny == x:
        print(con(x))
        abc[x] += 1
        abc[y] -= 1
      elif ny == y:
        print(con(y))
        abc[y] += 1
        abc[x] -= 1              
      else:
        print(con(x))
        abc[x] += 1
        abc[y] -= 1          

print('Yes')
for i in range(n):
  sel(i)

Fixed submission:

n,a,b,c = list(map(int, input().split()))
s = [[0]*2 for _ in range(n)]
S = []
for i in range(n):
  X = input()
  S += X
  cnt = 0
  for x in X:
    if x == 'A':
      s[i][cnt] = 0
    elif x == 'B':
      s[i][cnt] = 1
    else:
      s[i][cnt] = 2
    cnt += 1

if (a + b + c) == 0:exit(print('No'))
abc = [a,b,c]
ABC = ['A','B','C']


ans = [0] * n

def zero(xy):
  x = xy[0]
  y = xy[1]
  if abc[x] == 0 and abc[y] == 0:
    return -1,-1
  elif abc[x] == 0:
    return x,y
  elif abc[y] == 0:
    return y,x
  else:
    return 3,3

def main():
  global ans
  global abc
  
  for i in range(n):
    x,y = zero(s[i])
    if x == -1:exit(print('No'))
    if x == 3:
      if i < n-1:
        if s[i][1] in s[i+1]:
          x = s[i][1]
          y = s[i][0]
        else:
          x = s[i][0]
          y = s[i][1]
      else:
        x = s[i][0]
        y = s[i][1]
    ans[i] = x
    abc[x] += 1
    abc[y] -= 1

main()
print('Yes')
for i in range(n):
  print(ABC[ans[i]])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a,b,n = list(map(int, input().split()))

x = np.array([x for x in range(1,n+1)])
A = (a*x)//b
B = a * (x//b)
ANS = A-B
print(max(ANS))

Fixed submission:
a,b,n = list(map(int, input().split()))
t = 0
n = min(b-1,n)

print((a*n)//b - a*(n//b))

Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = list(map(int, input().split()))

T = 0
for i in range(1,n+1)[::-1]:
  t = (a*i)//b - a*(i//b)
  if T < t:
    T = t

print(T)

Fixed submission:
a,b,n = list(map(int, input().split()))
t = 0
n = min(b-1,n)

print((a*n)//b - a*(n//b))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n,K = list(map(int,input().split()))

mod = 10**9 + 7
M = 10**100%mod 

ans = set()
for k in range(K,n+2):
  for i in itertools.combinations(range(n+1),k):
    ans.add(sum([M+a%mod for a in i]))

print(len(ans))

Fixed submission:
n,K = list(map(int,input().split()))
mod = 10**9+7
ans = 0
for k in range(K,n+2):
  #ans += (n+1)*n//2 -(n+1-k)*(n-k)//2-k*(k-1)//2 + 1
  #ans += (n**2+n)//2 - (n**2-n*k+n-k-n*k+k**2)//2 - (k**2-k)//2 + 1
  #ans += (n**2+n - (n**2-n*k+n-k-n*k+k**2) -k**2 + k)//2 + 1
  #ans += (n**2 + n - n**2 + n*k - n + k + n*k - k**2 - k**2 + k)//2 + 1
  #ans += (2*n*k + 2*k - 2*k**2)//2 + 1
  ans += n*k - k**2 + k  + 1
print(ans%mod)