Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,t=map(int, input().split())
x=[]
y=[]
m=[]
for i in range(n):
    a,b=map(int, input().split())
    x.append(a)
    y.append(b)
    m.append([a,b])
x.sort()
y.sort()
ans=float('inf')
for i in range(n-1):
    for j in range(i,n):
        if i>=j:continue
        for k in range(n-1):
            for l in range(k,n):
                if k>=l:continue
                count=0
                for a,b in m:
                    if x[i]<=a<=x[j] and y[k]<=b<=y[l]:
                        count+=1
                if count>=t:
                    ans=min(ans,(x[j]-x[i])*(y[l]-y[k]))
print(ans)

Fixed submission:
n,t=map(int, input().split())
x=[]
y=[]
m=[]
for i in range(n):
    a,b=map(int, input().split())
    x.append(a)
    y.append(b)
    m.append([a,b])
x.sort()
y.sort()
ans=float('inf')
for i in range(n-1):
    for j in range(i,n):
        if i>=j:continue
        for k in range(n-1):
            for l in range(k,n):
                if k>=l:continue
                count=0
                for a,b in m:
                    if x[i]<=a<=x[j] and y[k]<=b<=y[l]:
                        count+=1
                if count>=t:
                    ans=min(ans,(x[j]-x[i])*(y[l]-y[k]))
print(ans)

Buggy python submission (verdict: Runtime Error):
n,t=map(int, input().split())
x=[]
y=[]
m=[]
for i in range(n):
    a,b=map(int, input().split())
    x.append(a)
    y.append(b)
    m.append([a,b])
x.sort()
y.sort()
for i in range(n-1):
    for j in range(i,n):
        if i>=j:continue
        for k in range(n-1):
            for l in range(k,n):
                if k>=l:continue
                count=0
                for a,b in m:
                    if x[i]<=a<=x[j] and y[k]<=b<=y[l]:
                        count+=1
                if count>=t:
                    ans=min(ans,(x[j]-x[i])*(y[l]-y[k]))
print(ans)

Fixed submission:
n,t=map(int, input().split())
x=[]
y=[]
m=[]
for i in range(n):
    a,b=map(int, input().split())
    x.append(a)
    y.append(b)
    m.append([a,b])
x.sort()
y.sort()
ans=float('inf')
for i in range(n-1):
    for j in range(i,n):
        if i>=j:continue
        for k in range(n-1):
            for l in range(k,n):
                if k>=l:continue
                count=0
                for a,b in m:
                    if x[i]<=a<=x[j] and y[k]<=b<=y[l]:
                        count+=1
                if count>=t:
                    ans=min(ans,(x[j]-x[i])*(y[l]-y[k]))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().split()))
m=int(input())
b=list(map(int, input().split()))
b2=set(b)
ans='YES'
for i in b:
    if a.count(i)<b.count(i):
        ans='NO'
        break
print(ans)

Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int, input().split()))
m=int(input())
b=list(map(int, input().split()))
ans='YES'
a1=Counter(a)
b1=Counter(b)
for i in b:
    if a1[i]<b1[i]:
        ans='NO'
        break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x=3500
a=1
for k in range(1,x):
    for j in range(1,x):
        a=(4*j*k - n*k - n*j)
        if a<=0: continue
        i = n*j*k / a
        if i==int(i) :
            print(int(i),j,k)
            break
    else:
        continue
    break

Fixed submission:
n=int(input())
for k in range(1,3501):
    for j in range(1,k+2):
        a=(4*j*k - n*k- n*j)
        if a<=0 : continue
        i = n*j*k / a
        i2= n*j*k // a
        if i==i2 :
            print(i2,j,k)
            break
    else:
        continue
    break

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x=3500
for k in range(1,x):
    for j in range(1,x):
        if (4*j*k - n*k - n*j)!=0:
            i = n*j*k / (4*j*k - n*k - n*j)
            if i==int(i) and i>0:
                print(int(i),j,k)
                break
    else:
        continue
    break

Fixed submission:
n=int(input())
for k in range(1,3501):
    for j in range(1,k+2):
        a=(4*j*k - n*k- n*j)
        if a<=0 : continue
        i = n*j*k / a
        i2= n*j*k // a
        if i==i2 :
            print(i2,j,k)
            break
    else:
        continue
    break
Buggy python submission (verdict: Runtime Error):
import  scipy as sp 
from itertools import permutations
n,m,r=map(int, input().split())
s=[[10**9]*n for i in range(n)]
t=list(map(int, input().split()))
for i in range(m):
    a,b,c=map(int, input().split())
    s[a-1][b-1]=c
    s[b-1][a-1]=c

s=sp.sparse.csgraph.floyd_warshall(s)   
ans=float('inf')
for i in permutations(t):
    an=0
    for j in range(r-1):
        an+=s[i[j]-1][i[j+1]-1]
    ans=min(ans,an)
print(ans)

Fixed submission:
n,m,r=map(int, input().split())
s=[[10**9]*n for i in range(n)]
t=list(map(int, input().split()))
for i in range(m):
    a,b,c=map(int, input().split())
    s[a-1][b-1]=c
    s[b-1][a-1]=c
 
for k in range(n):
    for i in range(n):
        for j in range(n):
            s[i][j]=min(s[i][j],s[i][k]+s[k][j])
ans=float('inf')
from itertools import permutations
for i in permutations(t):
    an=0
    for j in range(r-1):
        an+=s[i[j]-1][i[j+1]-1]
    ans=min(ans,an)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m,r=map(int, input().split())
s=[[100000]*n for i in range(n)]
t=list(map(int, input().split()))
for i in range(m):
    a,b,c=map(int, input().split())
    s[a-1][b-1]=c
    s[b-1][a-1]=c

for k in range(n):
    for i in range(n):
        for j in range(n):
            s[i][j]=min(s[i][j],s[i][k]+s[k][j])
ans=0
for i in range(r-1):
    for j in range(i+1,r):
        ans=max(s[t[i]-1][t[j]-1],ans)
print(ans)

Fixed submission:
n,m,r=map(int, input().split())
s=[[10**9]*n for i in range(n)]
t=list(map(int, input().split()))
for i in range(m):
    a,b,c=map(int, input().split())
    s[a-1][b-1]=c
    s[b-1][a-1]=c
 
for k in range(n):
    for i in range(n):
        for j in range(n):
            s[i][j]=min(s[i][j],s[i][k]+s[k][j])
ans=float('inf')
from itertools import permutations
for i in permutations(t):
    an=0
    for j in range(r-1):
        an+=s[i[j]-1][i[j+1]-1]
    ans=min(ans,an)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
count=0
for i in range(len(a)):
    if a[i]==i+1:
        a[i],a[i+1]=a[i+1],a[i]
        count+=1
print(count)

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
count=0
if a[-1]==len(a):
    a[-1],a[-2]=a[-2],a[-1]
    count+=1
    
for i in range(len(a)):
    if a[i]==i+1:
        a[i],a[i+1]=a[i+1],a[i]
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
import fractions
t=1
for i in range(int(input())):
    s=int(input())
    t=t*s//math.gcd(s,t)
print(t)

Fixed submission:
n=int(input())
t=1
for i in range(n):
    s=int(input())
    if t>s: a,b=t,s
    else: a,b=s,t
    
    while b!=0:
        a, b = b, a%b
    t=t*s//a
print(t)

Buggy python submission (verdict: Runtime Error):
import math
t=1
for i in range(int(input())):
    s=int(input())
    t=t*s//math.gcd(s,t)
print(t)

Fixed submission:
n=int(input())
t=1
for i in range(n):
    s=int(input())
    if t>s: a,b=t,s
    else: a,b=s,t
    
    while b!=0:
        a, b = b, a%b
    t=t*s//a
print(t)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(3000)

n=int(input())
m=[[] for i in range(n)]
for i in range(n-1):
    a,b,c=map(int, input().split())
    m[a-1].append([b-1,c])
    m[b-1].append([a-1,c])
q,k=map(int, input().split())
    
def reach(m,d,k):
    for i in m[k]:
        if d[i[0]]==-1:
            d[i[0]]=d[k]+i[1]
            reach(m,d,i[0])
d=[-1]*n
d[k-1]=0
reach(m,d,k-1)

for i in range(q):
    x,y=map(int, input().split())
    print(d[x-1]+d[y-1])

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

n=int(input())
m=[[] for i in range(n)]
for i in range(n-1):
    a,b,c=map(int, input().split())
    m[a-1].append([b-1,c])
    m[b-1].append([a-1,c])
q,k=map(int, input().split())
    
def reach(m,d,k):
    for i in m[k]:
        if d[i[0]]==-1:
            d[i[0]]=d[k]+i[1]
            reach(m,d,i[0])
d=[-1]*n
d[k-1]=0
reach(m,d,k-1)

for i in range(q):
    x,y=map(int, input().split())
    print(d[x-1]+d[y-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
m=[[] for i in range(n)]
for i in range(n-1):
    a,b,c=map(int, input().split())
    m[a-1].append([b-1,c])
    m[b-1].append([a-1,c])
q,k=map(int, input().split())
    
def reach(m,d,k):
    for i in m[k]:
        if d[i[0]]==-1:
            d[i[0]]=d[k]+i[1]
            reach(m,d,i[0])
d=[-1]*n
d[k-1]=0
reach(m,d,k-1)

for i in range(q):
    x,y=map(int, input().split())
    print(d[x-1]+d[y-1])

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

n=int(input())
m=[[] for i in range(n)]
for i in range(n-1):
    a,b,c=map(int, input().split())
    m[a-1].append([b-1,c])
    m[b-1].append([a-1,c])
q,k=map(int, input().split())
    
def reach(m,d,k):
    for i in m[k]:
        if d[i[0]]==-1:
            d[i[0]]=d[k]+i[1]
            reach(m,d,i[0])
d=[-1]*n
d[k-1]=0
reach(m,d,k-1)

for i in range(q):
    x,y=map(int, input().split())
    print(d[x-1]+d[y-1])
Buggy python submission (verdict: Runtime Error):
n,k=map(int, input().split())
a=[list(map(int, input().split())) for i in range(n)]
a.sort()
#print(a)
b=[]
for i,j in a:
    b=b+[i]*j
    if len(b)>k:break
print(b[k-1])

Fixed submission:
a,b,c=map(int, input().split())
if a<=c<=b:print('Yes')
else: print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int, input().split())
a=[list(map(int, input().split())) for i in range(n)]
a.sort()
#print(a)
b=[]
for i,j in a:
    b=b+[i]*j
    if len(b)>k:break
print(b[k-1])

Fixed submission:
n,k=map(int, input().split())
a=[list(map(int, input().split())) for i in range(n)]
a.sort()
#print(a)
b=[]
c=0
for i,j in a:
    k-=j
    c=i
    if k<=0: break
print(c)
Buggy python submission (verdict: Runtime Error):
def BF(p,n,s):
    inf=float("inf")
    d=[inf for i in range(n)]
    d[s-1]=0
    for i in range(n+1):
        for e in p:
            if e[0]!=inf and d[e[1]-1]>d[e[0]-1]+e[2]:
                d[e[1]-1] = d[e[0]-1] + e[2]
                if i==n: return [0,'inf']
    return list(map(lambda x:-x, d))
n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(m)]
a=[[x,y,-z] for x,y,z in a]
print(BellmanFord(a, n, 1)[-1])

Fixed submission:
def BF(p,n,s):
    inf=float("inf")
    d=[inf for i in range(n)]
    d[s-1]=0
    for i in range(n+1):
        for e in p:
            if e[0]!=inf and d[e[1]-1]>d[e[0]-1]+e[2]:
                d[e[1]-1] = d[e[0]-1] + e[2]
        if i==n-1:t=d[-1]
        if i==n and t!=d[-1]:
            return [0,'inf']
    return list(map(lambda x:-x, d))
n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(m)]
a=[[x,y,-z] for x,y,z in a]
print(BF(a, n, 1)[-1])
Buggy python submission (verdict: Runtime Error):
#h,w,k=map(int, input().split())
#s=[list(input()) for i in range(h)]
p=[[-1]*w for i in range(h)]
for i in range(h):
    for j in range(w):
        if s[i][j]=='S':
            sta=(i,j)
np=[(1,0),(-1,0),(0,1),(0,-1)]
q={sta}
p[sta[0]][sta[1]]=0
step=0
while step<k and q:
    step+=1
    now=q.pop()
    for i,j in np:
        nx,ny=now[0]+i,now[1]+j
        if nx<0 or nx==h or ny<0 or ny==w:continue
        if s[nx][ny]=='.' and p[nx][ny]==-1:
            p[nx][ny]=step
            q.add((nx,ny))
ans=10**9
for i in range(h):
    for j in range(w):
        if p[i][j]>=0:
            ans=min(ans,i,j,h-i,w-j)
print(-(-ans//k)+1)

Fixed submission:
h,w,k=map(int, input().split())
s=[list(input()) for i in range(h)]
p=[[-1]*w for i in range(h)]
for i in range(h):
    for j in range(w):
        if s[i][j]=='S':
            sta=(i,j)
np=[(1,0),(-1,0),(0,1),(0,-1)]
q={sta}
p[sta[0]][sta[1]]=0
step=0
while step<k and q:
    step+=1
    nq=set()
    while q:
        now=q.pop()
        for i,j in np:
            nx,ny=now[0]+i,now[1]+j
            if nx<0 or nx==h or ny<0 or ny==w:continue
            if s[nx][ny]=='.' and p[nx][ny]==-1:
                p[nx][ny]=step
                nq.add((nx,ny))
    q=nq.copy()

ans=10**9
for i in range(h):
    for j in range(w):
        if p[i][j]>=0:
            an=min(i,j,h-i-1,w-j-1)
            if ans>an:ans=an
print(-(-ans//k)+1)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(m)]
d={}
for i,j in a:
    d[i]=d.get(i,set())|{j}
    d[j]=d.get(j,set())|{i}
path=a[0][:]
sp=set(path)
while d[path[-1]]-set(path):
    t=d[path[-1]]-set(path)
    t=t.pop()
    path.append(t)
    sp.add(t)
path=path[::-1]
while d[path[-1]]-set(path):
    t=d[path[-1]]-set(path)
    t=t.pop()
    path.append(t)
    sp.add(t)
print(len(path))
print(*path)

Fixed submission:
n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(m)]
d={}
for i,j in a:
    d[i]=d.get(i,set())|{j}
    d[j]=d.get(j,set())|{i}
path=a[0][:]
sp=set(path)
while d[path[-1]]-sp:
    t=d[path[-1]]-sp
    t=t.pop()
    path.append(t)
    sp.add(t)
path=path[::-1]
while d[path[-1]]-sp:
    t=d[path[-1]]-sp
    t=t.pop()
    path.append(t)
    sp.add(t)
print(len(path))    
print(*path)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(m)]
d={}
for i,j in a:
    d[i]=d.get(i,set())|{j}
    d[j]=d.get(j,set())|{i}
path=a[0][:]
sp=set(path)
while d[path[-1]]-set(path):
    t=d[path[-1]]-set(path)
    t=t.pop()
    path.append(t)
    sp.add(t)
path=path[::-1]
while d[path[-1]]-set(path):
    t=d[path[-1]]-set(path)
    t=t.pop()
    path.append(t)
    sp.add(t)
print(len(path))
print(*path)

Fixed submission:
n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(m)]
d={}
for i,j in a:
    d[i]=d.get(i,set())|{j}
    d[j]=d.get(j,set())|{i}
path=a[0][:]
sp=set(path)
while d[path[-1]]-sp:
    t=d[path[-1]]-sp
    t=t.pop()
    path.append(t)
    sp.add(t)
path=path[::-1]
while d[path[-1]]-sp:
    t=d[path[-1]]-sp
    t=t.pop()
    path.append(t)
    sp.add(t)
print(len(path))    
print(*path)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
a.sort()
m=a[n:2*n]
ans=sum(m)
for i in range(0,n,2):
    if m[i]+m[i+1]<=a[2*n+i]+a[n-i-1]:
        ans+= a[2*n+i]+a[n-i-1]-m[i]-m[i+1]
    else:break
print(ans)

Fixed submission:
n=int(input())
a=sorted(list(map(int, input().split())))
print(sum(a[n::2]))
Buggy python submission (verdict: Runtime Error):
import math
from collections import Counter
def f(a,b):
    return math.factorial(a) // (math.factorial(a - b) * math.factorial(b))

n,a,b=map(int, input().split())
v=list(map(int, input().split()))
v.sort(reverse=True)
c=Counter(v)
count=0
if a==1 or v[0]==v[a-1]:
    for i in range(a,min(b,c[v[0]])+1):
        count+=f(min(b,c[v[0]]),i)
    print(v[0])
    print(count)
else: 
    print(sum(v[:a])/a)
    print(f(c[v[a]],a-c[v[0]]))

Fixed submission:
import math
def f(a,b):
    return math.factorial(a) // (math.factorial(a - b) * math.factorial(b))

n,a,b=map(int, input().split())
v=list(map(int, input().split()))
v.sort(reverse=True)
c=0
if v[0]==v[a-1]:
    for i in range(a,min(b,v.count(v[0]))+1):
        c+=f(v.count(v[a-1]),i)
    print(sum(v[:a])/a)
    print(c)
else: 
    print(sum(v[:a])/a)
    print(f(v.count(v[a-1]),v[:a].count(v[a-1])) )
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
a=[i%2 for i in a]
b=a.count(1)
anb,b=a.count(0)+b//2,b+b//2
if an%2+b%2==1:print('YES')
else:print('NO')

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
a=[i%2 for i in a]
b=a.count(1)
if b%2==0:print('YES')
else:print('NO')

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
a=[i%2 for i in a]
b=a.count(1)
anb,b=a.count(0)+b//2,b+b//2
if an%2+b%2==1:print('YES')
else:print('NO')

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
a=[i%2 for i in a]
b=a.count(1)
if b%2==0:print('YES')
else:print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c=map(int, input().split())
count=0
for i in range(a,b+1):
    if i%c==0:count+=1
print(count)

Fixed submission:
a,b,c=map(int, input().split())
if a!=0:print(b//c-(a-1)//c)
else: print(b//c+1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=list(map(int, input().split()))
a=list(range(1,n+1))
b=list(range(n,0,-1))
for i,j in enumerate(b):
    b[j-1]+=i
print(*a)
print(*b)

Fixed submission:
n=int(input())
c=list(map(int, input().split()))
a=list(range(n,n**2+1,n))
b=list(range(n**2,0,-n))
for i in range(n):
    b[c[i]-1]+=i
    
for i in a:
    print(i,end=' ')
print()
for i in b:
    print(i,end=' ')
print()

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

Fixed submission:
n=int(input())
c=list(map(int, input().split()))
a=list(range(n,n**2+1,n))
b=list(range(n**2,0,-n))
for i in range(n):
    b[c[i]-1]+=i
    
for i in a:
    print(i,end=' ')
print()
for i in b:
    print(i,end=' ')
print()
Buggy python submission (verdict: Runtime Error):
n,x=map(int, input().split())
if x==1 or x==2*n+1:print('No')
else:
    print('Yes')
    a=list(range(1,2*n))
    b=[]
    b.append(a.pop(x))
    b.append(a.pop(x-1))
    b.append(a.pop(x-2))
    for i in a[:n-2]+b+a[n-2:]:
        print(i)

Fixed submission:
n,x=map(int, input().split())
if x==1 or x==2*n-1:print('No')
else:
    print('Yes')
    a=list(range(1,2*n))
    b=[]
    b.append(a.pop(x))
    b.append(a.pop(x-1))
    b.append(a.pop(x-2))
    for i in a[:n-2]+b+a[n-2:]:
        print(i)

Buggy python submission (verdict: Runtime Error):
n,x=map(int, input().split())
if x==1 or x==2*n+1:print('No')
else:
    print('Yes')
    a=list(range(1,2*n))
    b=[]
    b.append(a.pop(x))
    b.append(a.pop(x-1))
    b.append(a.pop(x-2))
    for i in a[:n-1]+b+a[n-1:]:
        print(i)

Fixed submission:
n,x=map(int, input().split())
if x==1 or x==2*n-1:print('No')
else:
    print('Yes')
    a=list(range(1,2*n))
    b=[]
    b.append(a.pop(x))
    b.append(a.pop(x-1))
    b.append(a.pop(x-2))
    for i in a[:n-2]+b+a[n-2:]:
        print(i)
Buggy python submission (verdict: Runtime Error):
a=list(input())
b=list(input())
c=list(input())
oner='a'
while True:
        if oner=='a':
            if len(a)==0:break
            oner=a.pop(0)
        if oner=='b':
            if len(c)==0:break
            oner=b.pop(0)
        if oner=='c':
            if len(c)==0:break
            oner=c.pop(0)
print(oner.upper)

Fixed submission:
a=list(input())
b=list(input())
c=list(input())
oner='a'
while True:
        if oner=='a':
            if len(a)==0:break
            oner=a.pop(0)
        if oner=='b':
            if len(b)==0:break
            oner=b.pop(0)
        if oner=='c':
            if len(c)==0:break
            oner=c.pop(0)
print(oner.upper())

Buggy python submission (verdict: Runtime Error):
a=list(input())
b=list(input())
c=list(input())
oner='a'
while True:
        if oner=='a':
            if len(a)==0:break
            oner=a.pop(0)
        if oner=='b':
            if len(c)==0:break
            oner=b.pop(0)
        if oner=='c':
            if len(c)==0:break
            oner=c.pop(0)
        print(a,b,c)
print(oner.upper)

Fixed submission:
a=list(input())
b=list(input())
c=list(input())
oner='a'
while True:
        if oner=='a':
            if len(a)==0:break
            oner=a.pop(0)
        if oner=='b':
            if len(b)==0:break
            oner=b.pop(0)
        if oner=='c':
            if len(c)==0:break
            oner=c.pop(0)
print(oner.upper())
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split());k=10**9+7;c=(1<<n)%k-1;X=Y=1
for i in range(b):X=X*(n-i)%k;Y=Y*(i+1)%k;c-=X*pow(Y,k-2,k)if i+1in(a,b)else 0
print(c%k)

Fixed submission:
n,r=map(int,input().split());print(r+max(0,1000-100*n))
Buggy python submission (verdict: Runtime Error):
n=int(input());a=list(map(int,input().split()));b=[];c=0
for i in range(n-1):
	if a[i]>=a[i+1]:
		c+=1;b.append(c)
	else:
		c=0
print(max(b))

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

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

Fixed submission:
n=int(input());a=list(map(int,input().split()));b=[0];c=0
for i in range(n-1):
	if a[i]>=a[i+1]:
		c+=1;b.append(c)
	else:
		c=0
print(max(b))
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b,c,d,e=[int(input())for _ in range(6)]
t,T1,T2,T3,T4,T5,T6=0,n,0,0,0,0,0
while T6<n:
    t+=1
    T6=min(e,T5)+T6
    T5=min(d,T4)+T5-min(e,T5)
    T4=min(c,T3)+T4-min(d,T4)
    T3=min(b,T2)+T3-min(c,T3)
    T2=min(a,T1)+T2-min(b,T2)
    T1=T1-min(a,T1)
print(t)

Fixed submission:
n,*l=[int(input())for _ in range(6)]
m=min(l)
if m==1:print(n+4)
else:print(n//m+5)
Buggy python submission (verdict: Time Limit Exceeded):
#逆順にしてはやめにbreakできるように
N=int(input())
A=sorted(map(int,input().split()),reverse=True)
c=0
for n in range(N-1):
  if sum(A[n+1:])*2 >= A[n]:
    c+=1
  else:
    break
print(c+1)

Fixed submission:
#累積和で毎回sumしない
N=int(input())
A=sorted(map(int,input().split()))
b=0
c=0
for n in range(N-1):
  b += A[n]
  if b*2 >= A[n+1]:
    c+=1
  else:
    c=0
print(c+1)

Buggy python submission (verdict: Time Limit Exceeded):
#累積和のリストを作らない
N=int(input())
A=sorted(map(int,input().split()))
c=0
for n in range(N-1):
  if sum(A[:n+1])*2 >= A[n+1]:
    c+=1
  else:
    c=0
print(c+1)

Fixed submission:
#累積和で毎回sumしない
N=int(input())
A=sorted(map(int,input().split()))
b=0
c=0
for n in range(N-1):
  b += A[n]
  if b*2 >= A[n+1]:
    c+=1
  else:
    c=0
print(c+1)

Buggy python submission (verdict: Time Limit Exceeded):
#10:30〜10:46 再提出
N=int(input())
A=sorted(map(int,input().split()))
B=[]
for n in range(N):
  B.append(sum(A[:n+1]))
c=0
for n in range(N-1):
  if B[n]*2 >= A[n+1]:
    c+=1
  else:
    c=0
print(c+1)

Fixed submission:
#累積和で毎回sumしない
N=int(input())
A=sorted(map(int,input().split()))
b=0
c=0
for n in range(N-1):
  b += A[n]
  if b*2 >= A[n+1]:
    c+=1
  else:
    c=0
print(c+1)

Buggy python submission (verdict: Time Limit Exceeded):
#10:30〜10:46
#A.sort()
#1 2  7 20 30  40
#累積和=B
#1 3 10 30 60 100
#下克上可能か判定
#if B[i]*2 >= A[i+1] なら下克上可能　1をappend
#else 不可能 0をappend
#下克上可能リスト（=C）
#10111
#最後に出現した0以降の1の個数をカウント：c
#そして+1する
N=int(input())
A=sorted(map(int,input().split()))
B=[]
for n in range(N):
  B.append(sum(A[:n+1]))
c=0
for n in range(N-1):
  if B[n]*2 >= A[n+1]:
    c+=1
  else:
    c=0
print(c+1)

Fixed submission:
#累積和で毎回sumしない
N=int(input())
A=sorted(map(int,input().split()))
b=0
c=0
for n in range(N-1):
  b += A[n]
  if b*2 >= A[n+1]:
    c+=1
  else:
    c=0
print(c+1)
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int,input().split())
count = 0
if 1 <= (n/(a+b)):
    if a < n%(a+b):
        print ((n/(a+b)*a) +a)
    else:
        print (int(n/(a+b)*a) + int(n%(a+b)))
else:
    if a < n%(a+b):
        print (a)
    else:
        print (n%(a+b))

Fixed submission:
status = input()
if 'AB' in status or 'BA' in status:
    print('Yes')
else:
    print('No')