Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02945 (python)

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

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b

list = [plus, minus, add]

flag = True
for l in list :
    if flag :
        box = l
        flag = False
    else :
        if l >= box :
            box = l
print(box)

Buggy submission (verdict: Runtime Error):
import sys
 
a = []
for l in sys.stdin:
    if l == '\n' or l == '\r' or l == '\r\n':
        break
    else :
        a.append(l)
 
target = a[int(a[0])]
num = 0

sortedA = []

for i in a:
    sortedA.append(''.join(sorted(a[i])))
sortedA.pop(0)

for i in range(1, len(a) - 1):
    for j in range(i + 1, len(a)):
        flag = False
        if sortedA[i]==sortedA[j]:
            flag = True
        else:
            flag = False
        if flag:
            num = num + 1
print(num)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b
if a == 0 & b == 0 :
    perse = 0
else :
    perse = a/b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
        flag = False
    else :
        if l >= box :
            box = l
print(box)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
        flag = False
    else :
        if l >= box :
            box = l
print(box)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
        flag = False
    else :
        if l >= box :
            box = l
print(box)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
    else :
        if l >= box :
            box = l
print(box)

Buggy submission (verdict: Runtime Error):
i = input().sprit

a = int(i[0])
b = int(i[1])

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
    else :
        if l >= box :
            box = l
print(box)

Buggy submission (verdict: Runtime Error):
i = input().sprit

a = int(i[0])
b = int(i[1])

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = true
for l in list
	if flag :
    	box = l
    else
    	if l >= box
      		box = l
print(box)
Problem p02946 (python)

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

k = il[0]
x = il[1]

minusLimit = x - k + 1
plusLimit = x + k - 1

i = minusLimit

s = ""

while minusLimit <= i <= plusLimit :
  s =  s + str(i) + " "
  i = i + 1
s[:-1]
print(s)

Buggy submission (verdict: Runtime Error):
il = list(map(int,input().split()))

k = il[0]
x = il[1]

minusLimit = x - k + 1
plusLimit = x + k - 1

i = minusLimit

while minusLimit <= i <= pulusLimit :
  str = i + " "
str[:-1]
print(str)
Problem p02947 (python)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
 
a = []
for l in sys.stdin:
    if l == '\n' or l == '\r' or l == '\r\n':
        break
    else :
        a.append(l)
 
target = a[int(a[0])]
num = 0

sortedA = []

for i in a:
    sortedA.append(''.join(sorted(a[i])))
sortedA.pop(0)

for i in range(1, len(a) - 1):
    for j in range(i + 1, len(a)):
        flag = False
        if sortedA[i]==sortedA[j]:
            flag = True
        else:
            flag = False
        if flag:
            num = num + 1
print(num)

Buggy submission (verdict: Runtime Error):
import sys

a = []
for l in sys.stdin:
    if l == '\n':
        break
    else :
        a.append(l)

target = a[int(a[0])]
num = 0
for i in range(1, len(a) - 1):
    for j in range(i + 1, len(a)):
        flag = False
        iStrSorted = ''.join(sorted(a[i]))
        jStrSorted = ''.join(sorted(a[j]))]
        if iStrSorted==jStrSorted:
            flag = True
        else:
            flag = False
        if flag:
            num = num + 1
print(num)

Buggy submission (verdict: Runtime Error):
import sys

a = []
for l in sys.stdin:
    if l == '\n':
        break
    else :
        a.append(l)

target = a[int(a[0])]
print(target)

outNum = []
i1 = 0
for item in range(0, int(a[0]) - 1):
    if i1 != 0:
        for i in range(0, len(target) - 1):
            flag = False
            if target.count(target[i]) == item.count(target[i]):
                print(item)
                flag = True
            else:
                break
        if flag:
            outNum.append(item)
    i1 = i1 + 1
    flag = False
print(len(outNum))
Problem p02921 (python)

Fixed submission:
s = list(input())
t = list(input())
count = 0

for i in range (0,3):
    if s[i] == t[i]:
        count = count + 1
print (count)

Buggy submission (verdict: Runtime Error):
s = input().split()
t = input().split()
count = 0

for i in range (0,3):
    if s[i] == t[i]:
        count = count + 1
print (count)
Problem p02947 (python)

Fixed submission:
import collections
from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N = int(input())
S = [input() for i in range(N)]
# print(S)
S_new = []
for s in S:
    S_new.append(''.join(sorted(s)))
# print(S_new)
c = collections.Counter(S_new)
# print(c)
cnt = 0
for num in c.values():
    if num > 1:
        if num == 2:
            cnt += 1
        else:
            cnt += comb(num, 2)# a = comb(n, r)
print(cnt)

Buggy submission (verdict: Runtime Error):
import collections
from scipy.special import comb
N = int(input())
S = [input() for i in range(N)]
# print(S)
S_new = []
for s in S:
    S_new.append(''.join(sorted(s)))
# print(S_new)
c = collections.Counter(S_new)
# print(c)
cnt = 0
for num in c.values():
    if num > 1:
        if num == 2:
            cnt += 1
        else:
            cnt += comb(num, 2, exact=True)# a = comb(n, r)
print(cnt)
Problem p02999 (python)

Fixed submission:
X, A = map(int, input().split())
if X < A:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
if (x == W and y == H) or (x == 0 and y == 0) or (x == W and y == 0) or (x == 0 and y == H):
    print(W*H, 0)
else:
    # 横分割の時の最小値を求める
    A = min((H-y)*W, y*W)
 
    # 縦分割の時の最小値を求める
    B = min((W-x)*H, x*H)
 
    # 最後に最大の方を選ぶ
    # このときA=Bなら複数あるということ
    if A == B:
        print(A, 1)
    else:
        print(max(A, B), 0)
Problem p03006 (python)

Fixed submission:
import collections
import numpy as np

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

xy = np.array(xy)

dic_xy = {}

for i in range(N):
    for j in range(N):
        if i != j:
            diff_xy = xy[i] - xy[j]
            diff_xy = tuple(diff_xy)
            
            if dic_xy.get(diff_xy) is None:
                dic_xy[diff_xy] = 1
            else:
                dic_xy[diff_xy] += 1

max_diff = 0
for x in dic_xy:
    max_diff = max(max_diff, dic_xy[x])
    
print(N - max_diff)

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

N = int(input())

xy = []
for _ in range(N):
    xy.append(list(map(int, input().split())))

xy = np.array(xy)

diff_xy = []

for i in range(N-1):
    for j in range(i+1, N):
        diff_xy.append(list(xy[j] - xy[i]))

cs = []
for c in diff_xy:
    cs.append(diff_xy.count(c))
    
print(1 + (N - (max(cs) + 1)))

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())

xy = []
for _ in range(N):
    xy.append(list(map(int, input().split())))

xy = np.array(xy)

diff_xy = []

for i in range(N-1):
    for j in range(i+1, N):
        diff_xy.append(list(xy[j] - xy[i]))

cs = []
for c in diff_xy:
    cs.append(diff_xy.count(c))
    
print(1 + (N - (max(cs) + 1)))
Problem p03037 (python)

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

Ls, Rs = [0 for _ in range(M)],  [0 for _ in range(M)]

for i in range(M):
    L, R = map(int,input().split())
    Ls[i] = L
    Rs[i] = R
    
L_prime = max(Ls)
R_peime = min(Rs)

if L_prime > R_peime:
    print(0)
else:
    print(R_peime - L_prime + 1)

Buggy submission (verdict: Runtime Error):
import sys
 
N, M = map(int,input().split())
 
ls = []
 
L, R = map(int,input().split())
l = [k+L for k in range(R-L+1)]
 
if M == 1:
    print(len(l))
else:
    cs = []
    for i in range(M-1):
        L, R = map(int,input().split())
        if L in l:
            c = l[-1] - L + 1
            if c <= 0:
                print(0)
                sys.exit()
            cs.append(c)
 
    print(min(cs))

Buggy submission (verdict: Runtime Error):
import sys

N, M = map(int,input().split())

ls = []

L, R = map(int,input().split())
l = [k+L for k in range(R-L+1)]

if M == 1:
    print(len(l))
else:
  	cs = []
    for i in range(M-1):
        L, R = map(int,input().split())
        if L in l:
            c = l[-1] - L + 1
            if c <= 0:
                print(0)
                sys.exit()
            cs.append(c)

    print(min(cs))

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())

ls = []

L, R = map(int,input().split())
l = [k+L for k in range(R-L+1)]

cs = []

if M == 1:
    print(len(l))
else:
    for i in range(M-1):
        L, R = map(int,input().split())
        if L in l:
            c = l[-1] - L + 1
            cs.append(c)

    print(min(cs))

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())

if M == 1:
    L, R = map(int,input().split())
    l = [k+L for k in range(R-L+1)]
    print(len(l))
else:
    L, R = map(int,input().split())
    l = [k+L for k in range(R-L+1)]
    l_tmp = copy.deepcopy(l)

    L, R = map(int,input().split())
    l = [k+L for k in range(R-L+1)]

    l_set = list(set(l) & set(l_tmp))
    l_tmp = copy.deepcopy(l)
    for i in range(M-2):
        L, R = map(int,input().split())
        l = [k+L for k in range(R-L+1)]

        l_set = list(set(l) & set(l_set))
        l_tmp = copy.deepcopy(l)

    print(len(l_set))
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
s1 = input()
t = [0 for _ in range(N+1)]
for i in range(N):
    t[i+1] = t[i] + (1 if s1[i:i+2] == 'AC' else 0)
for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
s1 = input()
ls = []
rs = []
for _ in range(Q):
    l, r = map(int, input().split())
    ls.append(l)
    rs.append(r)

lr = []
for i in range(Q):
    lr.append([ls[i], rs[i], i])
    
lr_sort = sorted(lr, key=lambda x: x[1]-x[0], reverse=True)
for i in range(len(lr_sort)):
    l, r = lr_sort[i][0], lr_sort[i][1]
    if i == 0:
        s2 = s1[l-1:r]
        flag = 0
        for j in range(len(s2)-1):
            if s2[j]=='A' and s2[j+1]=='C':
                flag += 1
        lr_sort[i].append(flag)
    else:
        l_p, r_p = lr_sort[i-1][0], lr_sort[i-1][1]
        
        for j in range(min(l,l_p), max(l,l_p)):
            if s2[j]=='A' and s2[j+1]=='C':
                flag -= 1
        for j in range(min(r,r_p), max(r,r_p)):
            if s2[j]=='A' and s2[j+1]=='C':
                flag -= 1
        lr_sort[i].append(flag)

lr_sort2 = sorted(lr_sort, key=lambda x: x[2])
for ans in lr_sort2:
    print(ans[3])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
s1 = input()
ls = []
rs = []
for _ in range(Q):
    l, r = map(int, input().split())
    ls.append(l)
    rs.append(r)

lr = []
for i in range(Q):
    lr.append([ls[i], rs[i], i])
    
lr_sort = sorted(lr, key=lambda x: x[1]-x[0], reverse=True)
for i in range(len(lr_sort)):
    l, r = lr_sort[i][0], lr_sort[i][1]
    #print(l, r)
    if i == 0:
        s2 = s1[l-1:r]
        flag = 0
        for j in range(len(s2)-1):
            if s2[j]=='A' and s2[j+1]=='C':
                flag += 1
        lr_sort[i].append(flag)
    else:
        l_p, r_p = lr_sort[i-1][0], lr_sort[i-1][1]
        #print(l_p, r_p)
        
        for j in range(min(l,l_p), max(l,l_p)):
            if s2[j]=='A' and s2[j+1]=='C':
                flag -= 1
        for j in range(min(r,r_p), max(r,r_p)):
            if s2[j]=='A' and s2[j+1]=='C':
                flag -= 1
        lr_sort[i].append(flag)
lr_sort2 = sorted(lr_sort, key=lambda x: x[2])
for ans in lr_sort2:
    print(ans[3])
Problem p03095 (python)

Fixed submission:
from sys import stdin
N=int(input())
S=list(input().strip())
ans=1
for i in set(S):
    ans=ans*(S.count(i)+1)
ans-=1
print(ans%(10**9+7))

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
l = list(input())
c = collections.Counter(l)
m = 1
for k, v in c.items():
    m *= (v + 1)
print(m - 1)
import collections
N = int(input())
l = list(input())
c = collections.Counter(l)
m = 1
for k, v in c.items():
    m *= (v + 1)
m = m - 1
m = m % (10^9 + 7)
import collections
N = int(input())
l = list(input())
c = collections.Counter(l)
m = 1
for k, v in c.items():
    m *= (v + 1)
print(m - 1)
import collections
N = int(input())
l = list(input())
c = collections.Counter(l)
m = 1
for k, v in c.items():
    m *= (v + 1)
m = m - 1
m = m % (10^9 + 7)
print(m)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
l = list(input())
c = collections.Counter(l)
m = 1
for k, v in c.items():
    m *= (v + 1)
print(m - 1)
import collections
N = int(input())
l = list(input())
c = collections.Counter(l)
m = 1
for k, v in c.items():
    m *= (v + 1)
m = m - 1
m = m % (10^9 + 7)
Problem p03101 (python)

Fixed submission:
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))
H = HW[0]
W = HW[1]
h = hw[0]
w = hw[1]
r = H * W - (W * h + (H - h) * w)
print(r)

Buggy submission (verdict: Runtime Error):
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))

H = HW[0]
W = HW[1]

h = hw[0]
w = hw[1]

return H * W - (H * h + (W - h) * w)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [input() for i in range(N)]
print(a)
Problem p03103 (python)

Fixed submission:
N, M = map(int, input().split())
a, b = [0 for _ in range(N)], [0 for _ in range(N)]
for i in range(N):
    a[i], b[i] = (list(map(int, input().split())))
c = []
for i in range(N):
    c.append([a[i],b[i],i])
c = sorted(c, key=lambda x: x[0])
m = 0
cnt = 0
for i in range(N):
    
    cnt += c[i][1]
    m += c[i][0] * c[i][1]
     
    if cnt == M:
        print(m)
        break
    elif cnt > M:
        print(m - c[i][0] * (cnt - M))
        break
    else:
        continue

Buggy submission (verdict: Runtime Error):
m = 0
cnt = 0
for i in range(N):
    
    cnt += c[i][1]
    m += c[i][0] * c[i][1]
     
    if cnt == M:
        print(m)
        break
    elif cnt > M:
        print(m - c[i][0] * (cnt - M))
        break
    else:
        continue
Problem p03219 (python)

Fixed submission:
x, y = map(int, input().split())
print(int(x + y/2))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
p = []
y = []
for i in range(M):
    p1,y1=[int(i) for i in input().split()]
    p.append(p1)
    y.append(y1)
ans = [0 for _ in range(M)]
for idx in range(M):
    ans[idx] = [idx, p[idx], y[idx]]
ans = sorted(ans, key=lambda x: x[1])
ans = sorted(ans, key=lambda x: x[2])
for idx in range(M):
    if idx == 0:
        ans[idx][2] = 1
    else:
        if ans[idx][1] == ans[idx-1][1]:
            ans[idx][2] = ans[idx-1][2] + 1
        else:
            ans[idx][2] = 1
ans = sorted(ans, key=lambda x: x[0])
for idx in range(M):
    print('{:0=6}{:0=6}'.format(ans[idx][1], ans[idx][2]))
Problem p02981 (python)

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

C=A*N
if C<=B:
  print(C)
elif C>B:
  print(B)

Buggy submission (verdict: Runtime Error):
N,A,B=mnap(int,input().split())

C=A*N
if C<B:
  print(B)
elif C>B:
  print(C)
Problem p02983 (python)

Fixed submission:
L,R = list(map(int, input().split()))
if R - L >= 2019:
  print(0)
else:
  M=2019
  for i in range(L,R):
    for j in range(i+1,R+1):
      K=i * j % 2019
      if K < M:
        M = K
  print(M)

Buggy submission (verdict: Runtime Error):
L,R = list(map(int, input().split()))
if R-L >= 2019:
  print(0)
elif:
  M=2019
  for i in range(L,R):
    for j in range(i+1,R+1):
      L=(i * j) % 2019
      if L<M:
        M=L
print(M)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
count = 0
counts = []

if N <= 1:
    counts.append(0)
else:
    for i in range(N-1):
        if H[i] >= H[i+1]:
            count += 1
        else:
            counts.append(count)
            count = 0
    else:
        counts.append(count)

print(max(counts))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
count = 0
counts = []

for i in range(N-1):
    if H[i] >= H[i+1]:
        count += 1
    else:
        counts.append(count)
        count = 0

print(max(counts))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
counts = []
i = 0

while True:
    count = 0
    if i == N-1:
        break
    for j in range(i+1, N):
        if H[j-1] < H[j]:
            i = j-1
            break
        count += 1
    counts.append(count)
    i += 1

print(max(counts))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
counts = []

for i in range(N):
    if i == N-1:
        break
    count = 0
    for j in range(i+1, N):
        if H[i] < H[j]:
            break
        count += 1
    counts.append(count)

print(max(counts))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
counts = []

for i in range(N):
    count = 0
    for j in range(i+1, N):
        if H[i] < H[j]:
            break
        count += 1
    counts.append(count)

print(max(count))
Problem p03471 (python)

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

z = Y//1000 - N
flag = False

for m in range(z//9 + 1):
    if (z - 9*m)%4 == 0:
        g = (z - 9*m)//4
        if m + g <= N:
            result = [m, g, N-m-g]
            flag = True
            break
    else:
        pass

if not flag:
    result = [-1, -1, -1]

print(' '.join(map(str, result)))

Buggy submission (verdict: Runtime Error):
import math

N, Y = list(map(int, input().split()))

z = Y//1000 - N

for m in range(z//9 + 1):
    if (z - 9*m)%4 == 0:
        g = (z - 9*m)//4
        result = [m, g, N-m-g]
    else:
        result = [-1, -1, -1]

print(' '.join(map(str, result)))
Problem p03110 (python)

Fixed submission:
def main():
    N = int(input())
    total = 0
    for i in range(N):
        money,currency = input().split()
        if currency == "JPY":
            total += float(money)
        else:
            total += float(money)*380000
    print(total)
main()

Buggy submission (verdict: Runtime Error):
n=int(input())
sum=0
for i in range(0,n):
        x=float(input())
        y=str(input())
        if(y=='JPY'):
                sum=sum+x
        else:
                z=x*380000.0
                sum=sum+z
print(sum)
Problem p02924 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(range(2, n+1))
p.append(1)
sum = 0
for i in range(n-1):
    sum += (i+1) % p[i]
print(sum)
Problem p04043 (python)

Fixed submission:
s = input().split()

a = int(s[0])
b = int(s[1])
c = int(s[2])

count_5 = 0
if a == 5:
  count_5 += 1
if b == 5:
  count_5 += 1
if c == 5:
  count_5 += 1
  
count_7 = 0
if a == 7:
  count_7 += 1
if b == 7:
  count_7 += 1
if c == 7:
  count_7 += 1
  
if count_5 == 2 and count_7 == 1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())

str = []
for i in range(n):
  str.append(input())

str.sort()

print(''.join(str))

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())

str = []
for i in range(n):
  str.append(input())

str.sort()

print("".join(str))
Problem p03288 (python)

Fixed submission:
a = int(input())

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
a = input()

if a < 1200:
    print("ABC")
elif(a < 2800):
    print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
a = input()

if a < 1200:
    print("ABC")
elif(a < 2800)
    print("ARC")
else
    print("AGC")
Problem p02922 (python)

Fixed submission:
# B - Power Socket

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

if tgt == 0:
    print(1)
else:
    div = tgt // (a - 1)
    mod = tgt % (a - 1)
    print(div + 2 if mod > 0 else div + 1)

Buggy submission (verdict: Runtime Error):
# B - Power Socket

a = int(input())
b = int(input())
div = b // (a - 1)
mod = b % (a - 1)

print(1 if a == b else (div + 1 if mod > 1 else div))
Problem p02922 (python)

Fixed submission:
a, b = map(int, input().split())
ans = 0
while True:
  if ans * (a - 1) + 1 >= b:
    break
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = 0
white True:
  if ans * (a - 1) + 1 >= b:
    break
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = 0
white True:
  if ans * (a - 1) + 1 >= b:
    break
print(ans)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
i = 0
count = 0
ans = []
while i < n - 1:
  if h[i] < h[i + 1]:
    ans.append(count)
    count = 0
  else:
    count += 1
  i += 1
ans.append(count)
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
i = 0
count = 0
ans = []
while i < n - 1:
  if h[i] < h[i + 1]:
    ans.append(count)
    count = 0
  else:
    count += 1
  i += 1
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
x = []
i = 0
ans = 0
while i != n - 1:
  while i != n - 1:
    if h[i] < h[i + 1]:
      break
    ans += 1
    i += 1
  x.append(ans)
print(max(x))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
h.append(1000000000)
ans = []
x = 0
for i in range(n):
  ans.append(0)
  while h[i] - h[i + 1] >= 0:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
h.append(1000000000)
ans = []
x = 0
for i in range(n):
  ans.append(0)
  while h[i] - h[i + 1] >= 0:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
h.append(inf)
ans = []
x = 0
for i in range(n):
  ans.append(0)
  while h[i] - h[i + 1] >= 0:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
h.append(inf)
ans = []
x = 0
for i in range(n - 1):
  ans.append(0)
  while h[i] - h[i + 1] >= 0:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
ans = []
x = 0
for i in range(n):
  ans.append(0)
  while h[i] >= h[i + 1]:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))

Buggy submission (verdict: Runtime Error):
h = [int(input()) for _ in range(int(input()))]
ans = []
x = 0
for i in range(len(h)):
  ans.append(0)
  while h[i] >= h[i + 1]:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))