Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()
init_count = len(S)

tmp_i = 0
while len(S) > 1:
    no_01 = True
    before_s = None
    for i, s in enumerate(S[tmp_i:]):
        if i == 0:
            before_s = s
            continue
        if before_s != s:
            no_01 = False
            print(S[:tmp_i + i-1], '(', S[tmp_i + i - 1], ' | ', S[tmp_i + i],  ')', S[tmp_i + i+1:])
            newS = S[:tmp_i + i-1] + S[tmp_i + i+1:]
            S = newS
            print('newS: ', newS)
            tmp_i = tmp_i + i - 2
            if tmp_i < 0:
                tmp_i = 0
            print(tmp_i)
            break
    if no_01:
        break
print(init_count - len(S))

Fixed submission:
S = input()
init_count = len(S)

tmp_i = 0
while len(S) > 1:
    no_01 = True
    before_s = None
    for i, s in enumerate(S[tmp_i:]):
        if i == 0:
            before_s = s
            continue
        if before_s != s:
            no_01 = False
            # print(S[:tmp_i + i-1], '(', S[tmp_i + i - 1], ' | ', S[tmp_i + i],  ')', S[tmp_i + i+1:])
            newS = S[:tmp_i + i-1] + S[tmp_i + i+1:]
            S = newS
            # print('newS: ', newS)
            tmp_i = tmp_i + i - 2
            if tmp_i < 0:
                tmp_i = 0
            # print(tmp_i)
            break
    if no_01:
        break
print(init_count - len(S))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
init_count = len(S)

while len(S) > 1:
    no_01 = True
    before_s = S[0]
    for i, s in enumerate(S):
        if before_s != s:
            no_01 = False
            newS = S[:i-1] + S[i+1:]
            S = newS
            break
    if no_01:
        break
print(init_count - len(S))

Fixed submission:
S = input()
init_count = len(S)

tmp_i = 0
while len(S) > 1:
    no_01 = True
    before_s = None
    for i, s in enumerate(S[tmp_i:]):
        if i == 0:
            before_s = s
            continue
        if before_s != s:
            no_01 = False
            # print(S[:tmp_i + i-1], '(', S[tmp_i + i - 1], ' | ', S[tmp_i + i],  ')', S[tmp_i + i+1:])
            newS = S[:tmp_i + i-1] + S[tmp_i + i+1:]
            S = newS
            # print('newS: ', newS)
            tmp_i = tmp_i + i - 2
            if tmp_i < 0:
                tmp_i = 0
            # print(tmp_i)
            break
    if no_01:
        break
print(init_count - len(S))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

X = list(map(int, input().split()))
X.sort()

if N >= M:
    print(0)
    exit()
diffs = [X[i+1] - X[i] for i in range(M-1)]
diffs.sort()
print(sum[diffs[:N-M]])

Fixed submission:
N, M = map(int, input().split())

X = list(map(int, input().split()))
X.sort()

if N >= M:
    print(0)
    exit()
diffs = [X[i+1] - X[i] for i in range(M-1)]
diffs.sort()
print(sum(diffs[:M-N]))
Buggy python submission (verdict: Runtime Error):
N, T = map(int, input.split())
c = [None] * N
t = [None] * N

for i in range(N):
  c[i], t[i] = map(int, input.split())

a = [x for x, y in zip(c, t) if y <= T]
if len(a) > 0:
  print(min(a))
else:
  print('TLE')

Fixed submission:
N, T = map(int, input().split())
c = [None] * N
t = [None] * N

for i in range(N):
  c[i], t[i] = map(int, input().split())

a = [x for x, y in zip(c, t) if y <= T]
if len(a) > 0:
  print(min(a))
else:
  print('TLE')
Buggy python submission (verdict: Runtime Error):
N, M, X, Y = map(int, input().split())

xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

if (max(xs) < min(ys)) ans (X < Y):
    print("No War")
else:
    print("War")

Fixed submission:
N, M, X, Y = map(int, input().split())

xs = list(map(int, input().split()))
xs.append(X)
ys = list(map(int, input().split()))
ys.append(Y)

if max(xs) < min(ys):
    print("No War")
else:
    print("War")
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(A: "List[int]"):
    print(abs(A[0] - A[1] + abs(A[1] - A[2]))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = [ int(next(tokens)) for _ in range(3) ]  # type: "List[int]"
    solve(A)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(A: "List[int]"):
    print(max(A) - min(A))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = [ int(next(tokens)) for _ in range(3) ]  # type: "List[int]"
    solve(A)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

A = [A[i] - i - 1 for i in range(N)]
A = sorted(A)
indx = int(len(A) / 2)

b = sum([abs(a - A[indx]) for a in A])
b1 = sum([abs(a - A[indx-1]) for a in A])
b2 = sum([abs(a - A[indx+1]) for a in A])

print(min([b, b1, b2]))

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

A = [A[i] - i - 1 for i in range(N)]
A = sorted(A)
indx = int(len(A) / 2)

b = sum([abs(a - A[indx]) for a in A])

ans = [b]

if N > 1:
    b1 = sum([abs(a - A[indx-1]) for a in A])
    ans.append(b1)

if N > 2:
    b2 = sum([abs(a - A[indx+1]) for a in A])
    ans.append(b2)

print(min(ans))
Buggy python submission (verdict: Time Limit Exceeded):
D, N = map(int, input().split())
cnt = 0
n = 1
a = 10**D
while True:
  if n % a == 0 and n % (a * 100) == 0:
    cnt += 1
    if cnt == N:
      print(n)
      exit()

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(D: int, N: int):
    if N == 100:
        print((100**D)*101)
    else:
        print((100**D)*N)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    D = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(D, N)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
D, N = map(int, input().split())
cnt = 0
n = 1
a = 10**D
while True:
  if n % a == 0 and n % (a * 100) == 0:
    cnt += 1
    if cnt == N:
      print(n)
      exit()

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(D: int, N: int):
    if N == 100:
        print((100**D)*101)
    else:
        print((100**D)*N)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    D = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(D, N)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import numpy as np

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

while(1):
  count = len(np.where(a % 2 == 1)[0])
  if count > 0:
    break
  a = a / 2
  ans_count += 1
print(ans_count)

Fixed submission:
num_str = input()

print(sum([1 for a in num_str if a == '1']))

Buggy python submission (verdict: Runtime Error):
import numpy as np

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

while:
  count = len(np.where(a % 2 == 1)[0])
  if count > 0:
    break
  a = a / 2
  ans_count += 1
print(ans_count)

Fixed submission:
num_str = input()

print(sum([1 for a in num_str if a == '1']))

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = np.array(map(int, input().split()))
ans_count = 0
print(ans_count)

Fixed submission:
num_str = input()

print(sum([1 for a in num_str if a == '1']))
Buggy python submission (verdict: Runtime Error):
import numpy as np

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

while:
  count = len(np.where(a % 2 == 1)[0])
  if count > 0:
    break
  a = a / 2
  ans_count += 1
print(ans_count)

Fixed submission:
import numpy as np
 
n = int(input())
a = np.array(list(map(int, input().split())))
ans_count = 0
 
while(1):
  count = len(np.where(a % 2 == 1)[0])
  if count > 0:
    break
  a = a / 2
  ans_count += 1
print(ans_count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

B = list()
for a in A:
  B.append(a)
  B = B[::-1]
print(" ".join(B))

Fixed submission:
from collections import deque

N = int(input())

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

for i, a in enumerate(A):
    if i % 2 == 0:
        B.appendleft(a)
    else:
        B.append(a)

if N % 2 == 0:
    B.reverse()

B = list(map(str, list(B)))

print(" ".join(B))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
ans=0
n=int(input())
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i+1==1 or j+1==1 or k+1==1:
        ans += 1
      else:
        ans+=gcd(i+1, j+1, k+1)
print(ans)


Fixed submission:
from math import gcd
n=int(input())
l=[gcd(i+1, gcd(j+1, k+1)) for i in range(n) for j in range(n) for k in range(n)]
print(sum(l))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
ans=0
n=int(input())
for i in range(n):
  for j in range(n):
    for k in range(n):
      ans+=gcd(i+1, j+1, k+1)
print(ans)

Fixed submission:
from math import gcd
n=int(input())
l=[gcd(i+1, gcd(j+1, k+1)) for i in range(n) for j in range(n) for k in range(n)]
print(sum(l))
Buggy python submission (verdict: Runtime Error):
a = '1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51'
k = int(input())
b = a.split(", ")
print(b[k])

Fixed submission:
a = '1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51'
k = int(input())
b = a.split(", ")
print(b[k-1])
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a, b, num = [0]*n, [0]*n, [0]*n
num[0]=1
for i in range(m):
  a[i], b[i] = map(int, input().split())
  num[a[i]-1]=b[i]
for i in range(m):
  if num[a[i]-1]!=b[i]:
    print(-1)
    exit()

ans=''
for i in num:
  ans+=str(i)
ans = int(ans)
ans = str(ans)
if len(ans)==n:
  print(ans)
else:
  print(-1)

Fixed submission:
n, m = map(int, input().split())
a, b, num = [0]*m, [0]*m, [0]*n
if n!=1:
  num[0]=1
for i in range(m):
  a[i], b[i] = map(int, input().split())
  num[a[i]-1]=b[i]
for i in range(m):
  if num[a[i]-1]!=b[i]:
    print(-1)
    exit()

ans=''
for i in num:
  ans+=str(i)
ans = int(ans)
ans = str(ans)
if len(ans)==n:
  print(ans)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a, b ,cnt, num= [0]*n, [0]*n, [0]*n, [0]*n
for i in range(m):
  a[i], b[i] = map(int, input().split())
  cnt[a[i]-1]+=1
  if cnt[a[i]-1]==2:
    if num[a[i]-1]!=b[i]:
      print(-1)
      exit()
  num[a[i]-1]=b[i]

ans=''
for i in num:
  ans+=str(i)
  ANS=int(ans)
if ans==str(ANS):
  print(int(ans))
else:
  print(-1)

Fixed submission:
n, m = map(int, input().split())
a, b, num = [0]*m, [0]*m, [0]*n
if n!=1:
  num[0]=1
for i in range(m):
  a[i], b[i] = map(int, input().split())
  num[a[i]-1]=b[i]
for i in range(m):
  if num[a[i]-1]!=b[i]:
    print(-1)
    exit()

ans=''
for i in num:
  ans+=str(i)
ans = int(ans)
ans = str(ans)
if len(ans)==n:
  print(ans)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      ans = 'APPROVED'
    else:
      print('DENIED')
      exit()
print(ans)
    

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 'APPROVED'
for i in range(n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      ans = 'APPROVED'
    else:
      print('DENIED')
      exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp = [sum(p[i:i+k]) for i in range(n-k+1)]
A = (max(exp)+k)/2
print(A)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp = sum(p[0:k])
ans = exp
for i in range(n-k):
  exp = exp-p[i]+p[i+k]
  #print(ans, exp)
  if ans<exp:
    ans = exp
    #print("ans", exp, ans)
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
A = 0
for i in range(n-k+1):
    exp = sum(p[i:i+k])
    if ans < exp:
        ans = exp 
        A = (exp+k)/2
print(A)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp = sum(p[0:k])
ans = exp
for i in range(n-k):
  exp = exp-p[i]+p[i+k]
  #print(ans, exp)
  if ans<exp:
    ans = exp
    #print("ans", exp, ans)
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
A = 0
for i in range(n-k+1):
    exp = sum(p[i:i+k])
    if ans < exp:
        ans = exp 
        A = (exp+k)/2
print(A)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp = sum(p[0:k])
ans = exp
for i in range(n-k):
  exp = exp-p[i]+p[i+k]
  #print(ans, exp)
  if ans<exp:
    ans = exp
    #print("ans", exp, ans)
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
A = 0
for i in range(n-k+1):
    exp = sum(p[i:i+k])
    if ans < exp:
        ans = exp 
        A = (exp+k)/2
print(A)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp = sum(p[0:k])
ans = exp
for i in range(n-k):
  exp = exp-p[i]+p[i+k]
  #print(ans, exp)
  if ans<exp:
    ans = exp
    #print("ans", exp, ans)
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
Ans = 0
for i in range(n-k+1):
    exp = sum(p[i:i+k])
    if ans < exp:
        ans = exp
        s = p[i:i+k]
        Ans = 0
        for j in range(k):
            Ans += (sum(list(range(s[j]+1)))/s[j])
print(Ans)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp = sum(p[0:k])
ans = exp
for i in range(n-k):
  exp = exp-p[i]+p[i+k]
  #print(ans, exp)
  if ans<exp:
    ans = exp
    #print("ans", exp, ans)
print((ans+k)/2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
  if i==0:
    cnt+=1
  else:
    if p[i]<=min(p[0:i]):
      cnt+=1
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
  if i==0:
    cnt+=1
    f = p[i]
  else:
    if p[i]<=f:
      cnt+=1
      f = min(p[i], f)
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
  
k = lcm_list(a)
cnt=0
for i in range(n):
  cnt+=k//a[i]
print(cnt)

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
p = 10**9+7
for i in range(1, n):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
cnt=0
for i in range(n):
  cnt+=ans//a[i]
print(cnt%p)
Buggy python submission (verdict: Runtime Error):
n, a_, b_ = map(int, input().split())
a = a_-1
b = b_-1
A = [0]*n
B = [0]*n
for i in range(n):
  A[i] = abs(i-a)
  B[i] = abs(i-b)
for i in range(n):
  if A[i]==B[i]:
    print(A[i])
    exit()
m = [A[0], B[0], A[n-1], B[n-1]]
M = m.index(min(m))
if M == 0:
  print(m[1])
elif M == 1:
  print(m[0])
elif M == 2:
  print(m[3])
elif M == 3:
  print(m[2])

Fixed submission:
n, a, b = map(int, input().split())
if abs(a-b)%2==0:
       print(abs(a-b)//2)
else:
  x = min(n-a, n-b, a-1, b-1)
  print(x+(abs(a-b)+1)//2)
Buggy python submission (verdict: Runtime Error):
m1, d1 = int(input())
m2, d2 = int(input())
if m1==m2:
  print("0")
else:
  print("1")

Fixed submission:
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1==m2:
  print("0")
else:
  print("1")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(n):
  s.replace(s[i], k[k.index(s[i])+2])
print(s)

Fixed submission:
n = int(input())
s = list(input())
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  s[i] = k[(k.index(s[i])+n)%len(k)]
s_change = "".join(s)
print(s_change)
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
t = [k]*n
s = [1]*n
for i in range(q):
  point = int(input())
  t = [t - s for (t, s) in zip(t, s)]
  t[point-1] = t[point-1]+1
for i in range(n):
  if t[i]<=0:
    print("No")
  else:
    print("Yes")


Fixed submission:
n,k,q= map(int, input().split())#人数，初期ポイント，問題数
a = [0]*n
for i in range(q):
  a[int(input())-1]+=1
for i in range(n):
  if a[i]-q+k > 0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = sum(list(map(int, input().split())))
c = list(map(int, input().split()))
for i in range(n-1):
  if a[i+1]-a[i]==1:
    b+=c[a[i]-1]
print(total)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = sum(list(map(int, input().split())))
c = list(map(int, input().split()))
for i in range(n-1):
  if a[i+1]-a[i]==1:
    b+=c[a[i]-1]
print(b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
total = sum(b)
for i in range(n):
  if a[i+1]-a[i]==1:
    total+=c[i]
print(total)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = sum(list(map(int, input().split())))
c = list(map(int, input().split()))
for i in range(n-1):
  if a[i+1]-a[i]==1:
    b+=c[a[i]-1]
print(b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().split())
s = 0
for i in range(n-2):
  s+=min(a[n-2-i],a[n-i-3])
print(s+a[n-2])


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = 0
for i in range(n-2):
  s+=min(a[n-2-i],a[n-i-3])
print(s+a[n-2]+a[0])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().split())
s = 0
for i in range(n-2):
  s+=min(a[n-i],a[n-i-1])
print(s+a[n-2])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = 0
for i in range(n-2):
  s+=min(a[n-2-i],a[n-i-3])
print(s+a[n-2]+a[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(x) for x in input().split()]
cnt = []
cur_cnt = 0
for x in range(n-1):
    if h[x] >= h[x + 1]:
        cur_cnt += 1
    else:
        cnt.append(cur_cnt)
        cur_cnt = 0
cnt.append(cur_cnt)

print(max(count))


Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
        ans = max(ans,cnt)
    else:
        cnt = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
cnt = []
cur_cnt = 0
for x in range(n-1):
    if h[x] >= h[x + 1]:
        cur_cnt += 1
    else:
        cnt.append(cur_cnt)
        cur_cnt = 0
cnt.append(cur_cnt)

print(max(count))


Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
        ans = max(ans,cnt)
    else:
        cnt = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = map(int, input().split())
cnt = []
cur_cnt = 0
for x in range(n-1):
    if h[x] >= h[x + 1]:
        cur_cnt += 1
    else:
        cnt.append(cur_cnt)
        cur_cnt = 0
cnt.append(cur_cnt)

print(max(count))


Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
        ans = max(ans,cnt)
    else:
        cnt = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = map(int, input().split())
judge = 0
for i in range(n):
  flag=0
  count=0
  I=i
  while flag==0 and (I+count+1)<n:
    if h[I+count]>=h[I+count+1]:
      count+=1
    else:
      flag=1
    judge = max(judge, count)
print(judge)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
        ans = max(ans,cnt)
    else:
        cnt = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(sum(list(range(n))))

Fixed submission:
n = int(input())
print(n*(n-1)//2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(range(n))
ans = sum(a)+1
print(ans)

Fixed submission:
n = int(input())
print(n*(n-1)//2)
Buggy python submission (verdict: Runtime Error):
c_box = [] 
for i in range(3):
  c = list(map(int, input().split()))
  c_box.append(c)
  
for i in range(101):
  a1 = i
  b1 = c[0][0]-a1
  b2 = c[0][1]-a1
  b3 = c[0][2]-a1
  if c[1][0]-b1 == c[1][1]-b2 == c[1][2]-b3:
    if c[2][0]-b1 == c[2][1]-b2 == c[2][2]-b3:
      print('Yes')
      exit()
print('No')

Fixed submission:
c = [] 
for i in range(3):
  box = list(map(int, input().split()))
  c.append(box)

  
for i in range(101):
  a1 = i
  b1 = c[0][0]-a1
  b2 = c[0][1]-a1
  b3 = c[0][2]-a1
  if c[1][0]-b1 == c[1][1]-b2 == c[1][2]-b3:
    if c[2][0]-b1 == c[2][1]-b2 == c[2][2]-b3:
      print('Yes')
      exit()
print('No')
Buggy python submission (verdict: Runtime Error):
n = input()
ans = ""
for i in range(n):
  if i%2==0:
    ans += n[i]
print(ans)


Fixed submission:
n = input()
ans = ""
for i in range(len(n)):
  if i%2 == 0:
    ans += n[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
ans = ""
for i in range(n):
  if i%2==0:
    ans += n[i]
print(ans)


Fixed submission:
n = input()
ans = ""
for i in range(len(n)):
  if i%2 == 0:
    ans += n[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
ans = ""
for i in range(n):
  if i%2==1:
    ans += n[i]
print(ans)

Fixed submission:
n = input()
ans = ""
for i in range(len(n)):
  if i%2 == 0:
    ans += n[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = 1
wihle(1):
  if a<=n:
    a*=2
  else:
    print(a//2)
    exit()

Fixed submission:
n = int(input())
a = 1
while(1):
  if a<=n:
    a*=2
  else:
    print(a//2)
    exit()
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
print([x+y+z for x in range(k+1) for y in range(k+1) for z in range(k+1)].count(s))


Fixed submission:
k,s = map(int, input().split())
cnt=0
for x in range(k+1):
  for y in range(k+1):
    z = s-x-y
    if 0<=z and z<=k:
      cnt+=1
print(cnt)