Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N=int(input().split())
list=list(map(int,input().split()))
flg=0
for i in(list):
  if(i%2==0):
    if(i%3!=0 and i%5!=0):
      flg=1
      break
if(flg==0):
  print('APPROVED')
else:
  print('DENIED')

Fixed submission:
N=int(input())
list=list(map(int,input().split()))
flg=0
for i in(list):
  if(i%2==0):
    if(i%3!=0 and i%5!=0):
      flg=1
      break
if(flg==0):
  print('APPROVED')
else:
  print('DENIED')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
list = list(map(int, input().split()))

for i in range(len(list)):
  n=list[i]
  if(list.count(n)!=1):
    print("NO")
    break
  if(i==len(list)-1):
    print("YES")

Fixed submission:
import collections
N=int(input())
list = list(map(int, input().split()))
c = collections.Counter(list)

for i in range(len(list)):
  n=list[i]
  if(c[n]!=1):
    print("NO")
    break
  elif(i==len(list)-1):
    print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
a=input()
H,N=int(a.split()[0]),int(a.split()[1])
b=input()
list=[]
for i in range(N):
  list.append(int(b.split()[i]))
if(sum(list)>=H):
  print('Yes')
else:
  print('No')

Fixed submission:
a=input()
H,N=int(a.split()[0]),int(a.split()[1])
b=input().split()
list=list(map(int, b))
if(sum(list)>=H):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
a=input()
N,K=int(a.split()[0]),int(a.split()[1])
b=input().split()
list=list(map(int, b))

if (K>=len(list)):
  print(0)
else:
  for i in range(K):
    list.remove(max(list))
  print(sum(list))

Fixed submission:
a=input()
N,K=int(a.split()[0]),int(a.split()[1])
b=input().split()
list=list(map(int, b))

if (K>=len(list)):
  print(0)
else:
  print(sum(sorted(list, reverse=True)[K:]))
Buggy python submission (verdict: Runtime Error):
k,X=list(map(int,input().split()))
if(K*500>=X):
  print('Yes')
else:
  print('No')

Fixed submission:
K,X=list(map(int,input().split()))
if(K*500>=X):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K=list(map(int,input().split()))
for i in range(K):
  if(A>=1):
    A-=1
  elif(B>=1):
    B-=1
print(A,' ',B)

Fixed submission:
A,B,K=list(map(int,input().split()))
if(A<=K):
  K=K-A
  A=0
  if(B<=K):
    K=K-B
    B=0
  else:
    B=B-K
else:
  A=A-K
print(A,' ',B)
Buggy python submission (verdict: Runtime Error):
a=input()
A=int(a.split()[0])
B=int(a.split()[1])
K=int(a.split()[2])

a=0
if(A>B): i=A
if(B>A): i=B
count=0
while(a==0):
  if(A%i==0 and B%i==0):
    count+=1
    if(count==K):
      print(i)
      break
  i-=1

Fixed submission:
a=input()
A=int(a.split()[0])
B=int(a.split()[1])
K=int(a.split()[2])

a=0
if(A>B): i=A
else: i=B
count=0
while(a==0):
  if(A%i==0 and B%i==0):
    count+=1
    if(count==K):
      print(i)
      break
  i-=1
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input()
num=[]
num.append(int(a.split()[0]))
num.append(int(a.split()[1]))
num.append(int(a.split()[2]))
num.append(int(a.split()[3]))

num.sort()
b=0
for i in range(len(num)-1):
  b+=num[i]
if(num[len(num)-1]<b): print('Yes')
else: print('No')

Fixed submission:
N=int(input())
a=input()
num=[]
n=a.split()
for i in(n):
  num.append(int(i))

num.sort()
b=0
for i in range(len(num)-1):
  b+=num[i]
if(num[len(num)-1]<b): print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
str=input().split(' ')
a=[]
b=[]
c=[]
for i in range(2): a.append(int(str[i]))
for i in range(a[0]): b.append(input().split(' '))
for i in range(a[0]):
  for j in range(2):
    c.append(int(b[i][j]))
d=[]
e=[]
for i in range(a[0]):
  if(a[1]>=c[i*2-1]):
    d.append(c[i*2-2])
    e.append(c[i*2-1])
if(len(d)==0): print('TLE')
else: 
  num=min(d)
  print(num)

Fixed submission:
age=int(input())
if(age==1): print('Hello World')
if(age==2): A=int(input())
if(age==2): B=int(input())
if(age==2): print(A+B)

Buggy python submission (verdict: Runtime Error):
str=input().split(' ')
a=[]
b=[]
c=[]
for i in range(2): a.append(int(str[i]))
for i in range(a[0]): b.append(input().split(' '))
for i in range(a[0]):
  for j in range(2):
    c.append(int(b[i][j]))
d=[]
e=[]
for i in range(a[0]):
  if(a[1]>=c[i*2-1]):
    d.append(c[i*2-2])
    e.append(c[i*2-1])
if(len(d)==0): print('TLE')
else: 
  num=min(d)
  print(num)

Fixed submission:
age=int(input())
if(age==1): print('Hello World')
if(age==2): A=int(input())
if(age==2): B=int(input())
if(age==2): print(A+B)

Buggy python submission (verdict: Runtime Error):
str=input().split(' ')
a=[]
b=[]
c=[]
for i in range(2): a.append(int(str[i]))
for i in range(a[0]): b.append(input().split(' '))
for i in range(a[0]):
  for j in range(2):
    c.append(int(b[i][j]))
d=[]
e=[]
for i in range(a[0]):
  if(a[1]>=c[i*2-1]):
    d.append(c[i*2-2])
    e.append(c[i*2-1])
if(len(d)==0): print('TLE')
else: 
  num=min(d)
  print(num)

Fixed submission:
age=int(input())
if(age==1): print('Hello World')
if(age==2): A=int(input())
if(age==2): B=int(input())
if(age==2): print(A+B)
Buggy python submission (verdict: Runtime Error):
r=input()
print(3.141*2*r)

Fixed submission:
r=input()
print(3.141*2*int(r))
Buggy python submission (verdict: Runtime Error):
n,m=[int(i)for i in input()]
list=[int(i) for i in input().split()]
a=n-sum(list)
if a>=0:
  print(a)
else:
  print('-1')

Fixed submission:
n,m=[int(i)for i in input().split()]
list=[int(i) for i in input().split()]
a=n-sum(list)
if a>=0:
  print(a)
else:
  print('-1')
Buggy python submission (verdict: Runtime Error):
n,m=[int(i) for i in input().split()]
list=[int(i) for i in input().split()]
x=1/(4*m)
count=0
for i in range(1,n+1):
  if list[i]>=x:
    count+=1

if count>=m:
  print('Yes')
else:
  print('No')

Fixed submission:
n,m=[int(i) for i in input().split()]
list=[int(i) for i in input().split()]
x=1/(4*m)
y=sum(list)
count=0
for i in range(1,n+1):
  if list[i-1]>=x*y:
    count+=1

if count>=m:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n,m=[int(i)for i in input().split()]
list=[int(i) for i in input().split()]
x=1/(4*m)
count=0
for i in range(1,n+1):
  if list[i]>=x:
    count+=1

if count>=m:
  print('Yes')
else:
  print('No'

Fixed submission:
n,m=[int(i) for i in input().split()]
list=[int(i) for i in input().split()]
x=1/(4*m)
y=sum(list)
count=0
for i in range(1,n+1):
  if list[i-1]>=x*y:
    count+=1

if count>=m:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
h,a=[int(i)for i in input().split()]
if h%a==0:
  print(h//a)
else:
  print(''h//a+1)

Fixed submission:
h,a=[int(i)for i in input().split()]
if h%a==0:
  print(h//a)
else:
  print(h//a+1)
Buggy python submission (verdict: Runtime Error):
c=input()
z='abcdefghijklmnopqrstuvwxy'
print(z[z.index(c)+1])

Fixed submission:
c=input()
z='abcdefghijklmnopqrstuvwxyz'
print(z[z.index(c)+1])
Buggy python submission (verdict: Runtime Error):
k,x=[int(i)for i in input().split()]
if x>500k:
  print('No')
else:
  print('Yes')

Fixed submission:
k,x=[int(i)for i in input().split()]
if 500*k>=x:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
S=input()
list=[SUN,MON,TUE,WED,THU,FRI,SAT]
print(7-list.index(S))

Fixed submission:
S=input()
list=["SUN","MON","TUE","WED","THU","FRI","SAT"]
print(7-list.index(S))
Buggy python submission (verdict: Runtime Error):
print(int((input())**3))

Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
a,b,c=[int(i)for i in input().split()]
if c+b-a>0:
  print(c+b-a)
else:
  prnit("0")

Fixed submission:
a,b,c=[int(i)for i in input().split()]
if c+b-a>0:
  print(c+b-a)
else:
  print("0")
Buggy python submission (verdict: Runtime Error):
n,k=[int(i)for i in input().split()]
s=str(input())
S=list(s)
S[k-1]=S[k-1].lower
A=''.join(S)
print(A)

Fixed submission:
n,k = map(int, input().split())
s = input()
 
t = s[:k-1]+str.lower(s[k-1])+s[k:]
print(t)

Buggy python submission (verdict: Runtime Error):
n,k=[int(i)for i in input().split()]
s=str(input())
print(s.replace(s[k-1],s[k-1].lower))

Fixed submission:
n,k = map(int, input().split())
s = input()
 
t = s[:k-1]+str.lower(s[k-1])+s[k:]
print(t)

Buggy python submission (verdict: Runtime Error):
n,k=[int(i)for i in input().split()]
s=str(input())
print(s.replace(s[k],s[k].lower))

Fixed submission:
n,k = map(int, input().split())
s = input()
 
t = s[:k-1]+str.lower(s[k-1])+s[k:]
print(t)
Buggy python submission (verdict: Runtime Error):
a,b,c=[int(i) for i in input().split()]
prnit(a*b/2)

Fixed submission:
a,b,c=[int(i) for i in input().split()]
print((a*b)//2)
Buggy python submission (verdict: Runtime Error):
X=int(input())
if X=3 or X=5 or X=7:
  print('YES')
else:
  print('NO')

Fixed submission:
X=int(input())
if X==3 or X==5 or X==7:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
N=int(input())
if N%2==0:
  prnit(N)
else:
  print(2*N)

Fixed submission:
N=int(input())
if N%2==0:
  print(N)
else:
  print(2*N)
Buggy python submission (verdict: Runtime Error):
n=input()
if n>=1000:
  print('ABD')
else:
  print('ABC')

Fixed submission:
n=int(input())
if n>=1000:
  print('ABD')
else:
  print('ABC')
Buggy python submission (verdict: Runtime Error):
a,b,c,d=[int(i) for i in input().split()]
if (abs(a,b)>=d and abs(b,c)>=d) or abs(a,c)>=d:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b,c,d=[int(i) for i in input().split()]
T=abs(a-b)<=d and abs(b-c)<=d
if T or abs(a-c)<=d:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a,b=[int(i) for i in input().sprit()]
if b>=a:
  print(a)
else:
  print(a-1)

Fixed submission:
a,b=[int(i) for i in input().split()]
if b>=a:
  print(a)
else:
  print(a-1)
Buggy python submission (verdict: Runtime Error):
S=str(input())
x=S.count('o')
prnit(700+x*100)

Fixed submission:
S=str(input())
x=S.count('o')
print(700+x*100)
Buggy python submission (verdict: Runtime Error):
a,b,X=[int(i) for i in input().split()]
if x>=a and a+b>=x:
  print('YES')
else:
  print('NO')

Fixed submission:
a,b,x=[int(i) for i in input().split()]
if x>=a and a+b>x:
  print('YES')
else:
  print('NO')

Buggy python submission (verdict: Runtime Error):
a,b,X=[int(i for i in input().split())]
if x>=a and a+b>=x:
  print('YES')
else:
  print('NO')

Fixed submission:
a,b,x=[int(i) for i in input().split()]
if x>=a and a+b>x:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
s=str(input())
list=[a,b,c]
S=[s[0],s[1],s[2]]
S.sort()
if S==list:
  print('Yes')
else:
  print('No')

Fixed submission:
s=str(input())
list=["a","b","c"]
S=[s[0],s[1],s[2]]
S.sort()
if S==list:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
s=input()
list=[a,b,c]
x=[s.split()]
x.sort()
if x==list:
  print('Yes')
else:
  print('No')

Fixed submission:
s=str(input())
list=["a","b","c"]
S=[s[0],s[1],s[2]]
S.sort()
if S==list:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
s=input()
list=[a,b,c]
s.split().sort()
if s==list:
  print('Yes')
else:
  print('No')

Fixed submission:
s=str(input())
list=["a","b","c"]
S=[s[0],s[1],s[2]]
S.sort()
if S==list:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N=input()
A=input()
if N%500>=A:
  print('No')
else:
  print('Yes')

Fixed submission:
N=int(input())
A=int(input())
if N%500>A:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
x=int(input())
a=int(input())
b=int(input())
prnit((x-a)%b)

Fixed submission:
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)
Buggy python submission (verdict: Runtime Error):
a=str(input())
a.replace(a[3],"8")
prnit(a)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
print("2018"+input()(4:))

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=str(input())
s[3]="8"
print(s)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=str((input())
s[3]="8"
print(s)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=str(input())
s[3]="8"
print(s)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=str(input())
s[3]='8'
print(s)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=str(input())
s.replace(s[3],'8')'
print(s)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=str(input())
a=s.replace(s[3],'8')'
print(a)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=int(input())
s[3]='8'
print(s)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=input()
s[3]='8'
print(s)

Fixed submission:
print("2018"+input()[4:])

Buggy python submission (verdict: Runtime Error):
s=str(input())
s[3]='8'
print(s)

Fixed submission:
print("2018"+input()[4:])
Buggy python submission (verdict: Runtime Error):
x=input()
print(48-x)

Fixed submission:
x=int(input())
print(48-x)
Buggy python submission (verdict: Runtime Error):
a,b=[int(i) for i in input().split()]
if  (a+b)%2==0:
  print(x)
else:
  print((a+b+1)/2)

Fixed submission:
a,b=[int(i) for i in input().split()]
x=a+b+1
print(x//2)

Buggy python submission (verdict: Runtime Error):
a,b=[int(i) for i in input().split()]
x=(a+b)/2
if  (a+b)%2==0:
  prnit(x)
else:
  print(x%1+1)

Fixed submission:
a,b=[int(i) for i in input().split()]
x=a+b+1
print(x//2)

Buggy python submission (verdict: Runtime Error):
a,b=[int(i) for i in input().split()]
x=(a+b)/2
prnit(a%1+1)

Fixed submission:
a,b=[int(i) for i in input().split()]
x=a+b+1
print(x//2)
Buggy python submission (verdict: Runtime Error):
n=input()
a=input()
print(n**2-a)

Fixed submission:
n=int(input())
a=int(input())
print(n**2-a)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if N[0]=='9' or N[1]=='9':
  print('Yes')
else:
  print('NO')

Fixed submission:
N=str(input())
if N[0]=='9' or N[1]=='9':
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N=int(input())
if N[0]=='9' or N[1]=='9':
  print('Yes')
else:
  print('NO')

Fixed submission:
N=str(input())
if N[0]=='9' or N[1]=='9':
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
print('ABC'+N)

Fixed submission:
N=str(input())
print('ABC'+N)
Buggy python submission (verdict: Runtime Error):
a,b,c=[int(i) for i in input().split()]
d=100a+10b+c
if d%4==0:
  print('YES')
else:
  print('NO')

Fixed submission:
a,b,c=[int(i) for i in input().split()]
d=100*a+10*b+c
if d%4==0:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a,b=[int(i) for i in input().split()]
c=a+b
if c>=10:
  print(''error)
else:
  print(c)

Fixed submission:
a,b=[int(i) for i in input().split()]
c=a+b
if c>=10:
  print('error')
else:
  print(c)
Buggy python submission (verdict: Runtime Error):
a,b=[str(i) for i in input().split()]
list1=["1","3","5","7","8","10","12"]
list2=["4","6","9","11"]
if a,b in list1 or a,b in list2:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b=[str(i) for i in input().split()]
list1=["1","3","5","7","8","10","12"]
list2=["4","6","9","11"]
if a in list1 and b in list1:
  print('Yes')
elif a in list2 and b in list2:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c=[str(i) for i in input().split()]
if a[-1]==b[1] and b[-1]==c[1]:
  print('YES')
else:
  print('NO')

Fixed submission:
a,b,c=[str(i) for i in input().split()]
if a[-1]==b[0] and b[-1]==c[0]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a,b=[int(i) for i in input().split()]
list=["2","3","4","5","6","7","8","9","10","11","12","13","1"]
A=list.index(a)
B=list.index(b)
if A>B:
  print('Alice')
elif A==B:
  print('Draw')
else:
  print('Bob'

Fixed submission:
a,b=[str(i) for i in input().split()]
list=["2","3","4","5","6","7","8","9","10","11","12","13","1"]
A=list.index(a)
B=list.index(b)
if A>B:
  print('Alice')
elif A==B:
  print('Draw')
else:
  print('Bob')
Buggy python submission (verdict: Runtime Error):
c=str(input())
list=[a,i,u,o,e]
if c in list:
  print("vowel")
else:
  print("consonant")

Fixed submission:
c=str(input())
list=["a","i","u","o","e"]
if c in list:
  print("vowel")
else:
  print("consonant")

Buggy python submission (verdict: Runtime Error):
c=input()
list=[a,i,u,o,e]
if c in list:
  print("vowel")
else:
  print("consonant")

Fixed submission:
c=str(input())
list=["a","i","u","o","e"]
if c in list:
  print("vowel")
else:
  print("consonant")
Buggy python submission (verdict: Runtime Error):
a,b,c=[for i in input().split()]
print("A"+b[0]+"C")

Fixed submission:
a,b,c=[str(i) for i in input().split()]
print("A"+b[0]+"C")
Buggy python submission (verdict: Runtime Error):
(a+b)*h/2

Fixed submission:
a=int(input())
b=int(input())
h=int(input())
print((a+b)*h//2)
Buggy python submission (verdict: Runtime Error):
return N(N+1)/2

Fixed submission:
n=int(input())
print(n*(n+1)//2)
Buggy python submission (verdict: Runtime Error):
list=[int(i) for i in input().split()]
list1=sorted(list)
if list1=[5,5,7]:
  print('YES')
else:
  print('NO')

Fixed submission:
a,b,c,=map(int,input().split())
list1=[a,b,c]
if list1==[5,7,5]:
    print("YES")
elif list1==[7,5,5]:
    print("YES")
elif list1==[5,5,7]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a = input()
if a%10==7:
  print("Yes")
elif( a%100 )//10==7:
  print("Yes")
elif( a//100 )==7:
  print("Yes")
else:
  print("No")

Fixed submission:
a = input()
a = int(a)
if a%10==7:
  print("Yes")
elif( a%100 )//10==7:
  print("Yes")
elif( a//100 )==7:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a = input()
if a%10==7:
  print(True)
elif( a%100 )//10==7:
  print(True)
elif( a//100 )==7:
  print(True)
else:
  print(False)

Fixed submission:
a = input()
a = int(a)
if a%10==7:
  print("Yes")
elif( a%100 )//10==7:
  print("Yes")
elif( a//100 )==7:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a = input()
if a%10==7:
  print(True)
elif( a%100 )//10==7:
  print(True)
elif( a//100 )==7:
  print(True)
else:
  print(False)



Fixed submission:
a = input()
a = int(a)
if a%10==7:
  print("Yes")
elif( a%100 )//10==7:
  print("Yes")
elif( a//100 )==7:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
A.append(0)
for i in range(0, N):
    cost = 0
    pos = 0
    for p in range(0, N+1):
        if p != i:
            cost += abs(pos - A[p])
            pos = A[p]
    print(cost)


Fixed submission:
N = int(input())
A = [0] + [int(i) for i in input().split()] + [0]

cost = 0
pos = 0
for p in range(0, len(A)):
    cost += abs(pos - A[p])
    pos = A[p]

for i in range(1, len(A)-1):
    n_cost = 0
    if A[i-1] <= A[i] and A[i] <= A[i + 1]:
        n_cost = cost
    elif A[i] <= A[i - 1] and A[i] <= A[i + 1]:
        n_cost = cost - abs(A[i - 1] - A[i]) - abs(A[i] - A[i + 1]) + abs(A[i - 1] - A[i + 1])
    elif A[i] >= A[i - 1] and A[i] >= A[i + 1]:
        n_cost = cost - abs(A[i - 1] - A[i]) - abs(A[i] - A[i + 1]) + abs(A[i - 1] - A[i + 1])
    elif A[i-1] >= A[i] and A[i] >= A[i + 1]:
        n_cost = cost

    print(n_cost)
Buggy python submission (verdict: Time Limit Exceeded):
N, X, Y = map(int, input().split())

INF = 1 << 30
dis = [ [abs(i-j) if abs(i-j) < 2 else INF for i in range(N)] for j in range(N)]
dis[X-1][Y-1] = 1
dis[Y-1][X-1] = 1

for k in range(N):
  for i in range(N):
    for j in range(N): dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j])

for i in range(1, N):
  ans = 0
  for j in range(N): ans += dis[j].count(i)
  print(ans//2)

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

X -= 1
Y -= 1

ans = [0] * (N-1)

for i in range(N):
  for j in range(i+1, N):
    ans[min(j-i, abs(X-i)+1+abs(Y-j))-1] += 1

for x in ans: print(x)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())

if a == b == c || a != b != c: print("No")
else: print("Yes")

Fixed submission:
a,b,c = map(int, input().split())

if a == b == c or a != b != c != a: print("No")
else: print("Yes")
Buggy python submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A = [ list(map(int,input().split())) for _ in range(N) ]

ans = 0
for a,b in A,B:
  ans += 1 if sum([i*j for i,j in a,b])+C>0
 print(ans)

Fixed submission:
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A = [ list(map(int,input().split())) for _ in range(N) ]
 
ans = 0
for a in A:
  s = 0
  for i in range(M):
    s += a[i] * B[i]
  ans += 1 if s+C > 0 else 0
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

A = [ list(map(int,input().split())) for _ in range(N) ]
A.sort()
ans = 0
for M == 0:
  if M >= A[0][1]:
    ans += A[0][0] * A[0][1]
    M -= A[0][1]
    del A[0]
  else:
    ans += A[0][0] * M
    M = 0
print(ans)

Fixed submission:
N,M = map(int,input().split())
 
A = [ list(map(int,input().split())) for _ in range(N) ]
A.sort()
ans = 0
while M > 0:
  if M >= A[0][1]:
    ans += A[0][0] * A[0][1]
    M -= A[0][1]
    del A[0]
  else:
    ans += A[0][0] * M
    M = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

def f(n):
  s = ""
  if n == 0:
    return 0
  for i in reversed(range(int(math.log2(n))+1)):
    if i == 0:
      s += "1" if ((n-1)//2)%2 == 0 else "0"
    else:
      s += "1" if (n//(2**i))%2 + (n+1)%2 == 2 else "0"
  return int(s,2)

a,b = map(int,input().split())
print( f(a-1) ^ f(b) )

Fixed submission:
import math

def f(n):
  s = ""
  if n <= 0:
    return 0
  for i in reversed(range(int(math.log2(n))+1)):
    if i == 0:
      s += "1" if ((n-1)//2)%2 == 0 else "0"
    else:
      s += "1" if (n//(2**i))%2 + (n+1)%2 == 2 else "0"
  return int(s,2)

a,b = map(int,input().split())
print( f(a-1) ^ f(b) )

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

ans = 0
for i in range(a,b+1):
  ans ^= i
print(ans)

Fixed submission:
import math

def f(n):
  s = ""
  if n <= 0:
    return 0
  for i in reversed(range(int(math.log2(n))+1)):
    if i == 0:
      s += "1" if ((n-1)//2)%2 == 0 else "0"
    else:
      s += "1" if (n//(2**i))%2 + (n+1)%2 == 2 else "0"
  return int(s,2)

a,b = map(int,input().split())
print( f(a-1) ^ f(b) )
Buggy python submission (verdict: Runtime Error):
S = input()
a = -1
z = len(S)
for i, c in enumerate(input()):
  if c == "A" and a == -1: a = i
  if c == "Z": z = i

print(z-a+1)

Fixed submission:
a = -1
z = 0
for i, c in enumerate(input()):
  if c == "A" and a == -1: a = i
  if c == "Z": z = i

print(z-a+1)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

ans = 0
for x in range(K+1):
  for y in range(K+1):
    for z in range(K+1):
      if x+y+z == S: ans += 1

print(ans)

Fixed submission:
K, S = map(int, input().split())

ans = 0
for x in range(K+1):
  for y in range(min(S-x, K)+1):
    if S-x-y <= K: ans += 1
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]

flg = True
if N%2 == 0:
  for i in range(1, N, 2): flg &= A.count(i) == 2
else:
  flg &= A.count(0) == 1
  for i in range(2, N+1, 2): flg &= A.count(i) == 2

print(2**(N//2) if flg else 0)


Fixed submission:
N = int(input())
A = sorted([int(x) for x in input().split()])

flg = True
if N%2 == 0:
  for i in range(0, N//2): flg &= A[2*i] == A[2*i+1] == 2*i+1
else:
  flg &= A[0] == 0
  for i in range(1, (N+1)//2): flg &= A[2*i-1] == A[2*i] == 2*i

def modpow(n, r, m):
  if r == 0: return 1
  if r%2 == 0: return modpow(n, r//2, m)**2 % m
  return n * modpow(n, r-1, m) % m

print(modpow(2, N//2, 10**9+7) if flg else 0)