Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dic = {}

for a in A:
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1

li = [0] * N

for a in dic:
    li[dic[a]] += 1

ans = 0
k = len(dic)

for i in range(N):
    if li[i] > 0:
        if k - li[i] >= K:
            ans += i * li[i]
            k -= li[i]
        else:
            ans += i * (k - li[i])
            k -= li[i]

    if k <= K:
        break

print(ans)

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

dic = {}

for a in A:
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1

li = [0] * (N + 1)

#  li[i] = j  i:ボールの数 j:種類

for a in dic:
    li[dic[a]] += 1

ans = 0
k = len(dic)

for i in range(N):
    if li[i] > 0:
        if k - li[i] >= K:
            ans += i * li[i]
            k -= li[i]
        else:
            ans += i * (k - K)
            k -= li[i]

    if k <= K:
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

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

A.sort()

s1 = 0
s2 = 0

t = -1
for a in A:
    if a != t:
        ac = A.count(a)
        if ac >= 4:
            s1 = a
            s2 = a
        elif ac >= 2:
            s2 = s1
            s1 = a

    t = a

print(s1 * s2)


Fixed submission:
N = int(input())

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

A.sort()

s1 = 0
s2 = 0

at = -1
atc = 0

for a in A:
    if at == a:
        atc += 1

    else:
        if atc >= 4:
            s1 = at
            s2 = at
        elif atc >= 2:
            s2 = s1
            s1 = at
        
        at = a
        atc = 1

if atc >= 4:
    s1 = at
    s2 = at
elif atc >= 2:
    s2 = s1
    s1 = at

print(s1 * s2)
Buggy python submission (verdict: Runtime Error):
#import
#import math
#import numpy as np
N = int(input())
#= input()
#= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}
T = [int(input()) for _ in range(N)]


def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y)


if N == 1:
    print(T[0])

res = T[0] * T[1] // gcd(T[0], T[1])

if N > 2:
    for i in range(2, N):
        r = res * T[i] // gcd(res, T[i])
        res = max(r, res)

print(res)

Fixed submission:
N = int(input())
T = [int(input()) for _ in range(N)]


def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y)


if N == 1:
    print(T[0])
    exit()

res = T[0] * T[1] // gcd(T[0], T[1])

if N > 2:
    for i in range(2, N):
        r = res * T[i] // gcd(res, T[i])
        res = max(r, res)

print(res)

Buggy python submission (verdict: Runtime Error):
#import
#import math
#import numpy as np
N = int(input())
#= input()
#= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}
T = [int(input()) for _ in range(N)]


def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y)


res = T[0] * T[1] // gcd(T[0], T[1])

for i in range(2, N):
    r = res * T[i] // gcd(res, T[i])
    res = max(r, res)

print(res)

Fixed submission:
N = int(input())
T = [int(input()) for _ in range(N)]


def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y)


if N == 1:
    print(T[0])
    exit()

res = T[0] * T[1] // gcd(T[0], T[1])

if N > 2:
    for i in range(2, N):
        r = res * T[i] // gcd(res, T[i])
        res = max(r, res)

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

G1 = []
GN =[]

for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        G1.append(b)
    elif b == 1:
        G1.append(a)
    elif a == N:
        GN.append(b)
    elif b == N:
        GN.append(a)

res = False

for obj in G1:
    if obj in GN:
        res = True
        break


if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

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

G = {i: [] for i in range(1, N + 1)}

for i in range(M):
    a, b = map(int, input().split())
    if a == 1 or a == N or b == 1 or b == N:
        G[a].append(b)
        G[b].append(a)

res = False

for i in range(2, N):
    if 1 in G[i] and N in G[i]:
        res = True
        break


if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

G = {i:[] for i in range(1, N + 1)}

for i in range(M):
    a, b = map(int, input().split())
    G[a].append(b)
    G[b].append(a)

res = False

for obj in G[1]:
    if obj in G[N]:
        res = True
        break


if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

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

G = {i: [] for i in range(1, N + 1)}

for i in range(M):
    a, b = map(int, input().split())
    if a == 1 or a == N or b == 1 or b == N:
        G[a].append(b)
        G[b].append(a)

res = False

for i in range(2, N):
    if 1 in G[i] and N in G[i]:
        res = True
        break


if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

G = {i:[] for i in range(1, N + 1)}

for i in range(M):
    a, b = map(int, input().split())
    G[a].append(b)
    G[b].append(a)

res = False

for obj in G[1]:
    if obj in G[N]:
        res = True
        break


if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

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

G = {i: [] for i in range(1, N + 1)}

for i in range(M):
    a, b = map(int, input().split())
    if a == 1 or a == N or b == 1 or b == N:
        G[a].append(b)
        G[b].append(a)

res = False

for i in range(2, N):
    if 1 in G[i] and N in G[i]:
        res = True
        break


if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))

minint = 10**9

if N == 2:
    print(abs(a[0] - a[1]))

else:
    for i in range(1, N):
        s1 = sum(a[0:i])
        s2 = sum(a[i: N])
        minint = min(minint, abs(s1 - s2))

    print(minint)

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

minint = 10**9

if N == 2:
    print(abs(a[0] - a[1]))

else:
    s1 = s1 = sum(a[0:1])
    s2 = sum(a[1: N])
    for i in range(1, N - 1):
        s1 += a[i]
        s2 -= a[i]
        
        minint = min(minint, abs(s1 - s2))

    print(minint)
Buggy python submission (verdict: Runtime Error):
#import
#import math
#import numpy as np
#= int(input())
S = input()
#= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}

s = S[0]

r = 0

for i in range(1, len(S)):
    if s != S[i]:
        r += 1

    s = S[i]

print(res)

Fixed submission:
#import
#import math
#import numpy as np
#= int(input())
S = input()
#= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}

s = S[0]

r = 0

for i in range(1, len(S)):
    if s != S[i]:
        r += 1

    s = S[i]

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

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

maxint = 50 * max(x)

dp = [[[0] * (maxint + 1) for _ in range(N + 1)] for _ in range(N + 1)]

dp[0][0][0] = 1

for xi, xe in enumerate(x, 1):
    for j in range(xi+1):
        for k in range(maxint + 1):
            dp[xi][j][k] = dp[xi - 1][j][k]
            
            if j >= 0 and k >= xe:
                dp[xi][j][k] += dp[xi - 1][j - 1][k - xe]
                

res = 0

for i in range(1, N+1):
    res += dp[N][i][i * A]

print(res)

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

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

maxint = 50 * N

dp = [[[0] * (maxint + 1) for _ in range(N + 1)] for _ in range(N + 1)]

dp[0][0][0] = 1

for xi, xe in enumerate(x, 1):
    for j in range(xi+1):
        for k in range(maxint + 1):
            dp[xi][j][k] = dp[xi - 1][j][k]
            
            if j >= 0 and k >= xe:
                dp[xi][j][k] += dp[xi - 1][j - 1][k - xe]
                

res = 0

for i in range(1, N+1):
    res += dp[N][i][i * A]

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int ,input().split()))
ans = 1
for i in range(n):
  ans *= a[i]
if ans > 10**18:
  print(-1)
  exit()
print(ans)

Fixed submission:
n = int(input())
a = list(map(int ,input().split()))
ans = 1
if 0 in a:
  print(0)
  exit()
for i in range(n):
  ans *= a[i]
  if ans > 10**18:
    print(-1)
    exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int ,input().split()))
ans = 1
for i in a:
  ans *= i
if ans > 10**18:
  print(-1)
  exit()
  
print(ans)

Fixed submission:
n = int(input())
a = list(map(int ,input().split()))
ans = 1
if 0 in a:
  print(0)
  exit()
for i in range(n):
  ans *= a[i]
  if ans > 10**18:
    print(-1)
    exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
t = list(input())
n = len(t)
if n == 1:
  if t == '?':
    t = 'D'
elif n == 2:
  if t != 'PD' or t != 'DP':
    if t == '??':
      t = 'PD'
    else:
      for i in range(2):
        if t[i] == '?':
          t[i] = 'D'
  else:
    t = 'PD'
else:
  for i in range(n):
    if t[i] != '?':
      continue
    else:
      # if i == 0:
      #   if t[i+1] != 'P':
      #     t[i] = 'D'
      #     continue
      #   else:
      #     t[i] = 'P'
      #     continue
      # else:
      #   t[i] = 'D'
      t[i] = 'D'

if t = 'D'*n:
  t = 'P' + 'D'*n
print(''.join(t))


Fixed submission:
t = list(input())
n = len(t)
for i in range(n):
  if t[i] == '?':
    t[i] = 'D'
print(''.join(t))

Buggy python submission (verdict: Runtime Error):
t = list(input())
n = len(t)
if n == 1:
  if t == '?':
    t = 'D'
elif n == 2:
  if t == '??':
    t = 'PD'
  else:
    t.replace('?', 'D')
else:
  for i in range(n-1):
    if t[i] != '?':
      continue
    else:
      if i == 0:
        if t[i+1] != 'P':
          t[i] = 'D'
          continue
        else:
          t[i] = 'P'
          continue
      else:
        if t[i-1] == 'D' and t[i+1] != 'P':
          t[i] = 'P'
        else:
          t[i] = 'D'

if t[-1] =='?':
  t[-1] = 'D'

print(''.join(t))



Fixed submission:
t = list(input())
n = len(t)
for i in range(n):
  if t[i] == '?':
    t[i] = 'D'
print(''.join(t))
Buggy python submission (verdict: Runtime Error):
n, m, q = map(int, input().split())
cnt = 0
for _ in range(q):
    a, b, c, d = list(map(int, input().split()))
for i in range(m-n+1):
    if b[i] - a[i] + (m-n) == c[i]:
        cnt += d[i]
print(cnt)

Fixed submission:
n, m, q = map(int, input().split())
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
    a[i],b[i],c[i],d[i] = map(int,input().split())
    a[i] -= 1
    b[i] -= 1

def score(A):
    tmp = 0
    for ai, bi, ci, di in zip(a, b, c, d):   
        if A[bi] - A[ai] == ci:               
            tmp += di                        
    return tmp                               
    # for i in range(q):
    #     if A[b[i]]-A[a[i]] == c[i]:
    #         tmp += d[i]
    # return tmp

def dfs(A):
    if len(A) == n:
        return score(A)   
    res = 0
    if len(A) > 0:                # prev_last = A[-1] if len(A) > 0 else 0
        prev_last = A[-1] 
    else:
        prev_last = 0
    for i in range(prev_last, m):
        A.append(i)
        res = max(res, dfs(A))    # 再起を呼び出しながら、最大値の更新
        A.pop()
    return res

print(dfs([]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
sg = []
for _ in range(n):
    s = input()
    if sg.count(s) == 0:
        sg.append(s)
print(len(sg))

Fixed submission:
import collections
n = int(input())
sg = []
for _ in range(n):
    s = input()
    sg.append(s)
sgc = collections.Counter(sg)
print(len(sgc))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
ans = 10**18 + 1
if k == 1:
    print(0)
    exit()
while ans > k:
    ans = min(ans, n)
    n = abs(n-k)

print(min(ans, k-ans))

Fixed submission:
n, k = map(int, input().split())
z = n%k
if z == 0:
    print(0)
else:
    print(min(k-z, k-(k-z)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int, input().split()))
for p in range(1, n+1):
    cnt = 0
    for i in x:
        cnt += (i-p)**2
    ans = min(ans, cnt)
print(ans)

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
ans = 10 ** 9
for p in range(0, 101):
    cnt = 0
    for i in x:
        cnt += (i-p)**2
    ans = min(ans, cnt)
print(ans)
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:
            ans = 'DENIED'
            break
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
for i in a:
    if i%2 == 0:
        if i%3 == 0 or i%5 == 0:
            continue
        else:
            print('DENIED')
            exit()
print('APPROVED')

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
for i in a:
    if i%2 == 0:
        if i%3 == 0 or i%5 == 0:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'
            break
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
for i in a:
    if i%2 == 0:
        if i%3 == 0 or i%5 == 0:
            continue
        else:
            print('DENIED')
            exit()
print('APPROVED')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 'YES'
for i in range(n-1):
   for j in range(i+1, n):
      if a[i] == a[j]:
         ans = 'NO'
         break
print(ans)

Fixed submission:
n = int(input())
a_bef = list(map(int, input().split()))
ans = 'YES'
a_aft = sorted(a_bef)
for i in range(n-1):
   if a_aft[i] == a_aft[i+1]:
      ans = 'NO'
      break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p_bef = list(map(int, input().split()))
p_aft = []
a = 0
for i in range(n-k+1):
   for j in range(i, i+k):
      a += p_bef[j]
   p_aft.append(a)
   a = 0
p_aft2 = sorted(p_aft, reverse = True)
print((p_aft2[0]+k)/2)

Fixed submission:
n, k = list(map(int, input().split()))
P = list(map(int, input().split()))
Q = [(p+1)/2 for p in P]
c = [0]
for q in Q:
   c.append(c[-1]+q)
ans = 0
for i in range(k, n+1):
   ans = max(ans, c[i] - c[i-k])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = 1
for _ in range(1,n):
    for j in range(_):
        if p[_] <= p[j]:
            if _ == j+1:
                cnt += 1
        else:
            break
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for _ in p:  #p[i]よりも小さいものが出てきたらだめ
    if _ <= n:
        cnt += 1
        n = _
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for _ in range(n):
    for j in range(_+1):
        if p[_] <= p[j]:
            if _ == j:
                cnt += 1
        else:
            break
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for _ in p:  #p[i]よりも小さいものが出てきたらだめ
    if _ <= n:
        cnt += 1
        n = _
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i+1):
        if p[i] <= p[j]:
            if i == j:
                cnt += 1
        else:
            break
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for _ in p:  #p[i]よりも小さいものが出てきたらだめ
    if _ <= n:
        cnt += 1
        n = _
print(cnt)
Buggy python submission (verdict: Runtime Error):
# ABC 151C
n, m = map(int, input().split())
ps = list(input().split() for _ in range(m))
ac = 0
wa = 0
a = int(ps[0][0])
if m == 0:
    print(0, 0)
    exit()
for i in range(1, m):
    while int(ps[i][0]) <= int(ps[m-1][0]):
        if int(ps[i][0]) == a and ps[i][1] == 'WA':
            wa += 1
        elif int(ps[i][0]) == a and ps[i][1] == 'AC':
            ac += 1
            a += 1
        else:
            continue
print(ac, wa)


Fixed submission:
# ABC 151C
n, m = map(int, input().split())
ac = 0
wa = 0
cnt = [0]*n
for i in range(m):
    p, s = input().split()
    p = int(p)
    p -= 1
    if cnt[p] == -1:
        continue
    if s == 'AC':
        ac += 1
        wa += cnt[p]
        cnt[p] = -1
    else:
        cnt[p] += 1
print(ac, wa)
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
lcm = (a * b) // math.gcd(a, b)
print(lcm)

Fixed submission:
a, b = map(int, input().split())
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))

Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
def lcm(a, b):
    return (a * b) // math.gcd(a, b)
print(lcm(a, b))

Fixed submission:
a, b = map(int, input().split())
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split())) # 横入力

b = [0]
aaa = 0
for i in range(n):
    aaa += a[i]
    b.append(aaa)

ans = 202020202020
for i in range(n):
    ans = min(ans, abs(sum(a) - b[i]*2))
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split())) # 横入力

x = [0]
aaa = 0
for i in range(n):
    aaa += a[i]
    x.append(aaa)
aa = sum(a)
y = [aa]
for i in range(n):
    aa -= a[i]
    y.append(aa)

ans = 202020202020
for i in range(n+1):
    ans = min(ans, abs(x[i] - y[i]))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#ABC 142C
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(1, n+1):
   ans.append(a.index(i)+1)
print(*ans)

Fixed submission:
#ABC 142C
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for idx,i in enumerate(a, 1):
   ans[i-1] = idx
print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int,input().split())
b = list()
for i in range(q):
    a = int(input())
    b.append(a)
for j in range(1,n+1):
    c = b.count(j)
    if c < q-k+1:
        print('No')
    else:
        print('Yes')

Fixed submission:
n, k, q = map(int,input().split())
a = []
for i in range(q):
    b = int(input())
    a.append(b)
pnt = [0] * n
for x in a:
    pnt[x-1] += 1
for j in range(n):
    if pnt[j] > q-k:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int,input().split())
b = list()
for i in range(q):
    a = int(input())
    b.append(a)
if k > q:
    for i in range(n):
        print('Yes')
else:
    for j in range(1,n+1):
        c = b.count(j)
        if c < q-k+1:
            print('No')
        else:
            print('Yes')

Fixed submission:
n, k, q = map(int,input().split())
a = []
for i in range(q):
    b = int(input())
    a.append(b)
pnt = [0] * n
for x in a:
    pnt[x-1] += 1
for j in range(n):
    if pnt[j] > q-k:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import collections

n, k, q = map(int,input().split())
b = list()
for i in range(q):
    a = int(input())
    b.append(a)
if k > q:
    for i in range(n):
        print('Yes')
else:
    for j in range(1,n+1):
        c = b.count(j)
        if c < q-k+1:
            print('No')
        else:
            print('Yes')

Fixed submission:
n, k, q = map(int,input().split())
a = []
for i in range(q):
    b = int(input())
    a.append(b)
pnt = [0] * n
for x in a:
    pnt[x-1] += 1
for j in range(n):
    if pnt[j] > q-k:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
cnt = 0
soc = 1
while soc < b:
    soc += a - 1
    cnt += 1
print(cnt)


Fixed submission:
s = input()
t = input()
cnt = 0
for i in range(3):
    if s[i] == t[i]:
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
cnt = 0
soc = 1
while soc < b:
    soc += a - 1
    cnt += 1
print(cnt)

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

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 = 0
move_cnt = []
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
      move_cnt.append(cnt)
   else:
      move_cnt.append(cnt) 
      cnt = 0
      
print(max(move_cnt))

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 = 0
ans = 0
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
      move_cnt.append(cnt)
   else:
      move_cnt.append(cnt) 
      cnt = 0
      
print(max(move_cnt))

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 = 0
ans = 0
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
      move_cnt.append(cnt)
   else:
      cnt = 0
      move_cnt.append(cnt)
print(max(move_cnt))

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 = 0
move_cnt = []
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
      move_cnt.append(cnt)
   else:
      cnt = 0
print(max(move_cnt))

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 = 0
move_cnt = []
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
   else:
      move_cnt.append(cnt)
      cnt = 0
print(max(move_cnt))

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())
a = [int(input()) for i in range(n)]
cnt = 0
for k in range(n):
    cnt += 1/a[k]
print(1/cnt)

Fixed submission:
n = int(input())
a = map(int, input().split())
print(1/sum(1/i for i in a))