Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=list(map(int, input().split()))
l=d//2
dif=d[l]-d[l-1]
if dif==0:
  print(0)
else:
  print(dif)

Fixed submission:
n=int(input())
d=list(map(int, input().split()))
l=len(d)//2
d.sort()
dif=d[l]-d[l-1]
if dif==0:
  print(0)
else:
  print(dif)

Buggy python submission (verdict: Runtime Error):
n=int(input())
d=list(map(int, input().split()))
l=d//2
def=d[l]-d[l-1]
if def==0:
  print(0)
else:
  print(def)

Fixed submission:
n=int(input())
d=list(map(int, input().split()))
l=len(d)//2
d.sort()
dif=d[l]-d[l-1]
if dif==0:
  print(0)
else:
  print(dif)
Buggy python submission (verdict: Runtime Error):
n,l=map(int, input().split())
t=0
c=0
for i in range(n):
  if i==0:
    t=abs(l+(i+1)-1)
    c=0
  else:
    t=min(t, abs(l+(i+1)-1))
    if t=abs(l+(i+1)-1):
      c=i+1
g=0
for i in range(n):
  g+=(l+(i+1)-1)
print(g-l-c)

Fixed submission:
n,l=map(int, input().split())
t=0
c=0
for i in range(n):
  if i==0:
    t=abs(l+(i+1)-1)
    c=i+1
  else:
    t=min(t, abs(l+(i+1)-1))
    if t==abs(l+(i+1)-1):
      c=i+1
#print(c)
g=0
for i in range(n):
  g+=(l+(i+1)-1)
#print(g)
print(g-l-c+1)
Buggy python submission (verdict: Runtime Error):
X,A=map(int, input().split())
if X<A:
  print(0)
 else:
  print(10)

Fixed submission:
X,A=map(int, input().split())
if X<A:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
n,k=map(int, input().split())
s=str(input())
S=list(s)
if S[k]=='A':
  S[k]='a'
elif S[k]=='B':
  S[k]='b'
else:
  S[k]='c'
print(','.join(S))

Fixed submission:
n,k=map(int, input().split())
s=str(input())
S=list(s)
if S[k-1]=='A':
  S[k-1]='a'
elif S[k-1]=='B':
  S[k-1]='b'
else:
  S[k-1]='c'
print(''.join(S))
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())
K=int(input())
s=list(S)
t=s[K]
a=''
for i in range(N):
  if s[i]!=t:
    s[i]='*'
  a+=s[i]
print(a)

Fixed submission:
N=int(input())
S=str(input())
K=int(input())
s=list(S)
t=s[K-1]
a=''
for i in range(N):
  if s[i]!=t:
    s[i]='*'
  a+=s[i]
print(a)
Buggy python submission (verdict: Runtime Error):
A=[0]*6
for i in range(6):
  A[i]=int(input())
for i in range(5):
  for j in range(5):
    if A[i]-A[j]>A[6]:
      print(':(')
      exit()
print('Yay!')

Fixed submission:
A=[0]*6
for i in range(6):
  A[i]=int(input())
for i in range(5):
  for j in range(5):
    if A[i]-A[j]>A[5]:
      print(':(')
      exit()
print('Yay!')
Buggy python submission (verdict: Runtime Error):
n,m,c=map(int, input().split())
B=list(map(int, input().split()))
g=0
for i in range(n):
  A=list(map(int, input().split()))
  for i in range(m):
    t+=A[i]*B[i]
  if t+c>0:
    g+=1
  t=0
print(g)

Fixed submission:
n,m,c=map(int, input().split())
B=list(map(int, input().split()))
g=0
t=0
for i in range(n):
  A=list(map(int, input().split()))
  for i in range(m):
    t+=A[i]*B[i]
  if t+c>0:
    g+=1
  t=0
print(g)
Buggy python submission (verdict: Runtime Error):
n=int(input())
t=0
for i in range(n):
  x,y=input().split()
  if y=='JPN':
    t+=x
  else:
    t+=x*380000
print(t)

Fixed submission:
n=int(input())
t=0
c=0
for i in range(n):
  x,y=input().split()
  if y=='JPY':
    t+=int(x)
  else:
    c+=float(x)
print(t+c*380000)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int, input().split())
h=list(map(int, input().split()))

dp=[2000000000 for i in range(n)]
dp[0]=0
for i in range(n):
    
    for j in range(k+1):
        #print(i,j)
        if i+j>=n:
            break
        else:
            dp[i+j]=min(abs(h[i+j]-h[i])+dp[i],dp[i+j])
            #print(dp[i+j])
print(dp[n-1])
#print(dp)
    


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

dp=[2000000000 for i in range(n)]
dp[0]=0
for i in range(n):
    
    for j in range(k+1):
        #print(i,j)
        if i+j>=n:
            break
        else:
            dp[i+j]=min(abs(h[i+j]-h[i])+dp[i],dp[i+j])
            #print(dp[i+j])
print(dp[n-1])
#print(dp)
Buggy python submission (verdict: Time Limit Exceeded):
n,W=map(int, input().split())
w=[0]*n
v=[0]*n
for i in range(n):
    x,y=map(int, input().split())
    w[i]=x
    v[i]=y
dp=[[0 for i in range(W+1)] for j in range(n+1)]
for i in range(n):
    for j in range(W+1):
        if j<w[i]:
            dp[i+1][j]=dp[i][j]
        else:
            dp[i+1][j]=max(dp[i][j],dp[i][j-w[i]]+v[i])
print(dp[n][W])
#print(dp)


Fixed submission:
n,W=map(int, input().split())
w=[0]*n
v=[0]*n
for i in range(n):
    x,y=map(int, input().split())
    w[i]=x
    v[i]=y
dp=[[0 for i in range(W+1)] for j in range(n+1)]
for i in range(n):
    for j in range(W+1):
        if j<w[i]:
            dp[i+1][j]=dp[i][j]
        else:
            dp[i+1][j]=max(dp[i][j],dp[i][j-w[i]]+v[i])
print(dp[n][W])
#print(dp)

Buggy python submission (verdict: Time Limit Exceeded):
n,W=map(int, input().split())
w=[0]*n
v=[0]*n
for i in range(n):
    x,y = map(int, input().split())
    w[i] = x
    v[i] = y
dp = [[0 for i in range(W+1)] for j in range(n+1)]
for i in range(n):
    for j in range(W+1):
        if j < w[i]:
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i + 1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i])
#print(dp)
print(dp[n][W])

Fixed submission:
n,W=map(int, input().split())
w=[0]*n
v=[0]*n
for i in range(n):
    x,y=map(int, input().split())
    w[i]=x
    v[i]=y
dp=[[0 for i in range(W+1)] for j in range(n+1)]
for i in range(n):
    for j in range(W+1):
        if j<w[i]:
            dp[i+1][j]=dp[i][j]
        else:
            dp[i+1][j]=max(dp[i][j],dp[i][j-w[i]]+v[i])
print(dp[n][W])
#print(dp)
Buggy python submission (verdict: Time Limit Exceeded):
INF = 2000000000
n,limit_w = map(int, input().split())
w = [0]*n
v = [0]*n
for i in range(n):
    w[i], v[i] = map(int, input().split())
sum_v = sum(v)
dp = [INF for i in range(sum_v + 1)]
dp[0] = 0
for i in range(n):
    for j in range(sum_v ,-1 ,-1):
        if j >= v[i]:
            dp[j] = min(dp[j], dp[j - v[i]] + w[i])
for i in range(sum_v, -1, -1):
    if dp[i] <= limit_w:
        print(i)
        break

Fixed submission:
INF = 2000000000
n,limit_w = map(int, input().split())
w = [0]*n
v = [0]*n
for i in range(n):
    w[i], v[i] = map(int, input().split())
sum_v = sum(v)
dp = [INF for i in range(sum_v + 1)]
dp[0] = 0
for i in range(n):
    for j in range(sum_v ,-1 ,-1):
        if j >= v[i]:
            dp[j] = min(dp[j], dp[j - v[i]] + w[i])
for i in range(sum_v, -1, -1):
    if dp[i] <= limit_w:
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
n,T=map(int, input().split())
m=-1
for i in range(n):
  c,t=map(int, input().split())
  if t<=T:
    if m=-1:
      m=c
    else:
      m=min(m,c)
if m==-1:
  print('TLE')
else:
  print(m)


Fixed submission:
n,T=map(int, input().split())
m=-1
for i in range(n):
  c,t=map(int, input().split())
  if t<=T:
    if m==-1:
      m=c
    else:
      m=min(m,c)
if m==-1:
  print('TLE')
else:
  print(m)

Buggy python submission (verdict: Runtime Error):
n,T=map(int, input().split())'
m=-1
for i in range(n):
  c,t=map(int, input().split())
  if t<=T:
    if m=-1:
      m=c
    else:
      m=min(m,c)
if m==-1:
  print('TLE')
else:
  print(m)

Fixed submission:
n,T=map(int, input().split())
m=-1
for i in range(n):
  c,t=map(int, input().split())
  if t<=T:
    if m==-1:
      m=c
    else:
      m=min(m,c)
if m==-1:
  print('TLE')
else:
  print(m)
Buggy python submission (verdict: Runtime Error):
A=list(map(int, input().split()))
A.sort()
m=abs(A1-A2)
n=abs(A2-A3)
print(m+n)

Fixed submission:
A=list(map(int, input().split()))
A.sort()
m=abs(A[0]-A[1])
n=abs(A[1]-A[2])
print(m+n)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(str(n))
S=0
for i in range(len(s)):
  S+=int(s[i])
if n%S==0:
  print('Yes')
elsE:
  print('No')


Fixed submission:
n=int(input())
s=list(str(n))
S=0
for i in range(len(s)):
  S+=int(s[i])
if n%S==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N,X=map(int, input().split())
m=[input() for i in range(N)]
t=int(min(m))

for i in range(N):
    X-=int(m[i])
if X>=t:
    x=X//t
print(N+x)
    


Fixed submission:
N,X=map(int, input().split())
m=[int(input()) for i in range(N)]
t=min(m)
#print(t)
for i in range(N):
    X-=m[i]
if X>=t:
    x=X//t
else:
    x=0
print(N+x)
Buggy python submission (verdict: Runtime Error):
a,b=int(input().split())
c=0
while a<=b:
  s=str(a)
  if s==s[::-1]:
    c+=1
  a+=1
print(c)

Fixed submission:
a,b=map(int, input().split())
c=0
while a<=b:
  s=str(a)
  if s==s[::-1]:
    c+=1
  a+=1
print(c)
Buggy python submission (verdict: Runtime Error):
n=int(input())
C=list(map(int, input().split()))
c=set(C)
if len(c)==4:
  print('Four')
else:
  print('Three')

Fixed submission:
n=int(input())
C=list(map(str, input().split()))
c=set(C)
if len(c)==4:
  print('Four')
else:
  print('Three')
Buggy python submission (verdict: Runtime Error):
a,b=map(str, input().split())
t=a+b
g=1
while g*g<t:
  g+=1
if g*g==t:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b=map(str, input().split())
t=int(a+b)
g=1
while g*g<t:
    g+=1
if g*g==t:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,A,B=map(int, input().split())
turn=0
while (A!=1 and B!=N) or turn==0:
  if A!=B-1:
    A+=1
  else:
      A=A-1
  if B!=A+1:
    B=B-1
  else:
    B=B+1
  turn+=1
if A==1:
  print('Borys')
else:
  print('Alice')
    


Fixed submission:
N,A,B=map(int, input().split())
turn=0
while A!=1 and B!=N or turn==0:
  if A!=B-1:
    A+=1
  else:
      A=A-1
  if A<1:
      A=1
  if B!=A+1:
    B=B-1
  else:
    B=B+1
  if B>N:
      B=N
  turn+=1
if A==1:
  print('Borys')
else:
  print('Alice')

Buggy python submission (verdict: Time Limit Exceeded):
N,A,B=map(int, input().split())
turn=0
while A!=1 and B!=N or turn==0:
  if A!=B-1:
    A+=1
  else:
      A=A-1
  if B!=A+1:
    B=B-1
  else:
    B=B+1
  turn+=1
if A==1:
  print('Borys')
else:
  print('Alice')

Fixed submission:
N,A,B=map(int, input().split())
turn=0
while A!=1 and B!=N or turn==0:
  if A!=B-1:
    A+=1
  else:
      A=A-1
  if A<1:
      A=1
  if B!=A+1:
    B=B-1
  else:
    B=B+1
  if B>N:
      B=N
  turn+=1
if A==1:
  print('Borys')
else:
  print('Alice')
Buggy python submission (verdict: Runtime Error):
s=str(input())
s[3]='8'
print(s)

Fixed submission:
s=str(input())
S=list(s)
S[3]='8'
s=''.join(S)
print(s)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(str(n))
t=0
for i in range(len(s)):
  t+=int(s[i])
if n%s==0:
  print('Yes')
else:
  print('No')

Fixed submission:
n=int(input())
s=list(str(n))
t=0
for i in range(len(s)):
  t+=int(s[i])
if n%t==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(str(n))
t=0
for i in range(len(s)):
  t+=s[i]
if n%s==0:
  print('Yes')
else:
  print('No')

Fixed submission:
n=int(input())
s=list(str(n))
t=0
for i in range(len(s)):
  t+=int(s[i])
if n%t==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n=str(input())
a=set(n)
p=0
if len(a)==1:
  p=1
elif len(a)==2:
  b=n[0]
  if b==n[1]:
    if b==n[2] or b==n[3]:
        p=1
  elif b==n[2] and b==n[3]:
      p=1
if p=1:
    print('Yes')
else:
    print('No')


Fixed submission:
n=str(input())
a=set(n)
p=0
if len(a)==1:
  p=1
elif len(a)==2:
  b=n[0]
  if b==n[1] and b==n[2]:
      p=1
  b=n[1]
  if b==n[2] and b==n[3]:
      p=1
if p==1:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[0]*n
l[0]=2
l[1]=1
for i in range(n):
  if i==0 or i==1:
    continue
  else:
    l[i]=l[i-1]+l[i-2]
print(l[n-1])

Fixed submission:
n=int(input())
l=[0]*(n+1)
l[0]=2
l[1]=1
for i in range(n+1):
  if i==0 or i==1:
    continue
  else:
    l[i]=l[i-1]+l[i-2]
print(l[n])

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[0]*n
l[0]=2
l[1]=1
for i in range(n):
  if i==0 or i==1:
    continue
  else:
    l[i]=l[i-1]+l[i-2]
print(l[n])

Fixed submission:
n=int(input())
l=[0]*(n+1)
l[0]=2
l[1]=1
for i in range(n+1):
  if i==0 or i==1:
    continue
  else:
    l[i]=l[i-1]+l[i-2]
print(l[n])
Buggy python submission (verdict: Runtime Error):
a=list(map(int, input().split()))
sort(a)
print(a[0]+a[1])

Fixed submission:
a=list(map(int, input().split()))
a.sort()
print(a[0]+a[1])
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a<b:
  print('LESS')
elif a=b:
  print('EQUAL')
else:
  print('GREATER')

Fixed submission:
a=int(input())
b=int(input())
if a<b:
  print('LESS')
elif a==b:
  print('EQUAL')
else:
  print('GREATER')
Buggy python submission (verdict: Runtime Error):
A=str(input())
B=str(input())
a=list(A)
b=list(B)
t=''
for i in range(len(a)):
  t+=a[i]+b[i]
if len(a)>len(b):
  t+=a[len(a)-1]
print(t)


Fixed submission:
A=str(input())
B=str(input())
a=list(A)
b=list(B)
t=''
for i in range(len(b)):
  t+=a[i]+b[i]
if len(a)>len(b):
  t+=a[len(a)-1]
print(t)

Buggy python submission (verdict: Runtime Error):
A=str(input())
B=str(input())
a=list(A)
b=list(B)
t=''
for i in range(len(a)+len(b)):
  t+=a[i]+b[i]
if len(a)>len(b):
  t+=a[len(a)-1]
print(t)

Fixed submission:
A=str(input())
B=str(input())
a=list(A)
b=list(B)
t=''
for i in range(len(b)):
  t+=a[i]+b[i]
if len(a)>len(b):
  t+=a[len(a)-1]
print(t)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
s=set(a,b,c)
print(len(set))


Fixed submission:
a,b,c=map(int, input().split())
s={a,b,c}
print(len(s))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = list(map(int, input().split()))
ans = 1
for l in ls:
    ans *= l
if (ans > 1000000000000000000):
    print(-1)
else:
    print(ans)

Fixed submission:
def main():
    n = int(input())
    ls = list(map(int, input().split()))
    ans = 1
    if 0 in ls:
        print(0)
        return
    for l in ls:
        ans *= l
        if (ans > 1000000000000000000):
            print(-1)
            return
    print(ans)
    return
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
print('Yes' if "A" in input() and "B" in input() else "No")

Fixed submission:
s=input()
print('Yes' if "A" in s and "B" in s else "No")
Buggy python submission (verdict: Time Limit Exceeded):
N, S = map(int,input().split())
A = list(map(int,input().split()))
mod = 998244353
dp = [[0 for j in range(S + 1)] for i in range(N + 1)]
dp[0][0] = 1
for i in range(N) : 
    for j in range(S + 1) : 
        dp[i + 1][j] += 2 * dp[i][j]
        dp[i + 1][j] %= mod 
        if j + A[i] <= S : 
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= mod
print(dp[N][S])


Fixed submission:
N, S = map(int,input().split())
A = list(map(int,input().split()))
mod = 998244353
dp = [[0 for j in range(S + 1)] for i in range(N + 1)]
dp[0][0] = 1
for i in range(N) : 
    for j in range(S + 1) : 
        dp[i + 1][j] += 2 * dp[i][j]
        dp[i + 1][j] %= mod 
        if j + A[i] <= S : 
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= mod
print(dp[N][S])
Buggy python submission (verdict: Runtime Error):
from collections import deque

s = deque()
s.append(input())
q = int(input())

reverse_status = False

for i in range(q):
  query = list(map(format, input().split()))
  if int(query[0]) == 1:
    if reverse_status:
      reverse_status = False
    else:
      reverse_status = True
  else:
    if int(query[1]) == 1:
      if reverse_status:
        s.append(query[2])
      else:
        s.appendleft(query[2])
    else:
      if reverse_status:
        s.appendleft(query[2])
      else:
        s.append(query[2])

if reverse_status:
  s.reverse()
print(''.join(s))


Fixed submission:
s = input()

if s.count('A') > 0 and s.count('B') > 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())

reverse_status = False

for i in range(q):
  query = list(map(format, input().split()))
  if int(query[0]) == 1:
    if reverse_status:
      reverse_status = False
    else:
      reverse_status = True
  else:
    if int(query[1]) == 1:
      if reverse_status:
        s = s + query[2]
      else:
        s = query[2] + s
    else:
      if reverse_status:
        s = query[2] + s
      else:
        s = s + query[2]

if reverse_status:
  print(s[::-1])
else:
  print(s)

Fixed submission:
from collections import deque

s = deque()
s.extend(list(input()))
q = int(input())

reverse_status = False

for i in range(q):
  query = list(map(format, input().split()))
  if int(query[0]) == 1:
    if reverse_status:
      reverse_status = False
    else:
      reverse_status = True
  else:
    if int(query[1]) == 1:
      if reverse_status:
        s.append(query[2])
      else:
        s.appendleft(query[2])
    else:
      if reverse_status:
        s.appendleft(query[2])
      else:
        s.append(query[2])

if reverse_status:
  s.reverse()
print(''.join(s))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())

reverse_status = False

for i in range(q):
  query = list(map(format, input().split()))
  if int(query[0]) == 1:
    if reverse_status:
      reverse_status = False
    else:
      reverse_status = True
  else:
    if int(query[1]) == 1:
      if reverse_status:
        s = s + query[2]
      else:
        s = query[2] + s
    else:
      if reverse_status:
        s = query[2] + s
      else:
        s = s + query[2]

if reverse_status:
  print(''.join(list(reversed(s))))
else:
  print(s)

Fixed submission:
from collections import deque

s = deque()
s.extend(list(input()))
q = int(input())

reverse_status = False

for i in range(q):
  query = list(map(format, input().split()))
  if int(query[0]) == 1:
    if reverse_status:
      reverse_status = False
    else:
      reverse_status = True
  else:
    if int(query[1]) == 1:
      if reverse_status:
        s.append(query[2])
      else:
        s.appendleft(query[2])
    else:
      if reverse_status:
        s.appendleft(query[2])
      else:
        s.append(query[2])

if reverse_status:
  s.reverse()
print(''.join(s))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = [int(a) for a in input().split()]

for i in range(n):
  if a.count(a[i]) > 1:
    print('NO')
    sys.exit()

print('YES')

Fixed submission:
import sys
n = int(input())
a = [int(a) for a in input().split()]

done = {}
flag = 0
for i in range(n):
  try:
    if done[a[i]] > 0:
      flag = 1
    done[a[i]] = 1
  except:
    done[a[i]] = 1

if flag:
  print('NO')
else:
  print('YES')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = [int(a) for a in input().split()]

for i in range(n):
  if a.count(a[i]) > 1:
    print('NO')
    sys.exit()

print('YES')

Fixed submission:
import sys
n = int(input())
a = [int(a) for a in input().split()]

done = {}
flag = 0
for i in range(n):
  try:
    if done[a[i]] > 0:
      flag = 1
    done[a[i]] = 1
  except:
    done[a[i]] = 1

if flag:
  print('NO')
else:
  print('YES')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
h, n = map(int, input().split())
INF = 10 ** 20
masics = []
for i in range(n):
  a, b = map(int, input().split())
  masics.append([a, b])
dp = [0] + [INF] * h

for masic in masics:
  for j in range(h):
    k = min(j+masic[0], h)
    dp[k] = min(dp[k], dp[j] + masic[1])

print(dp[h])

Fixed submission:
import sys
import math
h, n = map(int, input().split())
INF = 10 ** 20
masics = []
for i in range(n):
  a, b = map(int, input().split())
  masics.append([a, b])
dp = [0] + [INF] * h

for masic in masics:
  for j in range(h):
    k = min(j+masic[0], h)
    dp[k] = min(dp[k], dp[j] + masic[1])

print(dp[h])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(a) for a in input().split()]

ans = 1
done = [p[0]]
for i in range(1, n):
  if min(done) < p[i]:
    pass
  else:
    ans += 1
  done.append(p[i])

print(ans)

Fixed submission:
n = int(input())
p = [int(a) for a in input().split()]

ans = 1
min_num = p[0]
for i in range(1, n):
  if min_num < p[i]:
    pass
  else:
    ans += 1
    min_num = p[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
n, k, s = map(int, input().split())
 
ans = []
if k % 2 == 1:
  for _ in range(k):
    ans.append(s)
  while n > len(ans):
    if s == 1000000000:
      ans.append(999999999)
    else:
      ans.append(1000000000)
elif k == 0:
  while n > len(ans):
    if s == 1000000000:
      ans.append(999999999)
    else:
      ans.append(1000000000)
else:
  if s % 2 == 0:
    count = 1
    ans.append(s/2)
    ans.append(s/2)
    while n > count:
      ans.append(s/2)
      count += 1
    while n > len(ans):
      if s == 1000000000:
        ans.append(999999999)
      else:
        ans.append(1000000000)
  else:
    count = 1
    ans.append(1)
    ans.append(s-1)
    while n > count:
      ans.append(1)
      count += 1
      if n > count:
        break
      ans.append(s-1)
      count += 1
    while n > len(ans):
      if s == 1000000000:
        ans.append(999999999)
      else:
        ans.append(1000000000)
 
print(' '.join(map(str, ans)))


Fixed submission:
h = int(input())
w = int(input())
n = int(input())

big = max(h,w)

count = 0
black = 0
while n > black:
  black += big
  count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

machines = []
for i in range(n):
  x, l = map(int, input().split())
  machines.append([x+l, x-l])
machines.sort()

stock = []
stock.append(machines.pop(0))
while len(machines) > 0:
  point = machines.pop(0)
  if stock[-1][0] > point[1]:
    continue
  else:
    stock.append(point)

print(len(stock))

Fixed submission:
n = int(input())

machines = []
for i in range(n):
  x, l = map(int, input().split())
  machines.append([x+l, x-l])
machines.sort()

ans = 1
first = machines.pop(0)
stock_r = first[0]
for r,l in machines:
  if stock_r > l:
    continue
  else:
    ans += 1
    stock_r = r

print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())

score = {
  'r': r,
  's': s,
  'p': p
}

win_map = {
  'r': 'p',
  's': 'r',
  'p': 's'
}

lose_map = {
  'r': 's',
  's': 'p',
  'p': 'r'
}

result = [''] * n
result_num = 0
for j in range(n):
  if j >= k and result[j - k] == win_map[t[j]]:
    if j < k + 2 and t[j] == win_map[t[j + k]]:
      result[j] = lose_map[t[j]]
    else:
      result[j] = t[j]
  else:
    result[j] = win_map[t[j]]
    result_num += score[win_map[t[j]]]


print(result_num)

Fixed submission:
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())

score = {
  'r': r,
  's': s,
  'p': p
}

win_map = {
  'r': 'p',
  's': 'r',
  'p': 's'
}

lose_map = {
  'r': 's',
  's': 'p',
  'p': 'r'
}

result = [''] * n
result_num = 0
for j in range(n):
  if j >= k and result[j - k] == win_map[t[j]]:
    if j + k < n and t[j] == win_map[t[j + k]]:
      result[j] = lose_map[t[j]]
    else:
      result[j] = t[j]
  else:
    result[j] = win_map[t[j]]
    result_num += score[win_map[t[j]]]


print(result_num)
Buggy python submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())

result = a * b / math.gcd(a, b)

print(int(result))



Fixed submission:
import fractions

a, b = map(int, input().split())

result = a * b / fractions.gcd(a, b)

print(int(result))