Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque 
def main():
    n,x,y=map(int,input().split())
    root=[[]for i in range(n)]
    for i in range(1,n):
        root[i-1].append(i)
        root[i].append(i-1)
    root[x-1].append(y-1)
    root[y-1].append(x-1)
    short=[0 for i in range(n)]
    dictlen={}
    for i in range(1,n):
        dictlen[i]=0
    for start in range(n):
        distance=[0]*n
        toVis=deque()
        checkVis=[-1 for i in range(n)]
        toVis.append(start)
        while len(toVis)>0:
            now=toVis.popleft()
            checkVis[now]=1
            for nex in root[now]:
                if checkVis[nex]==1:
                    continue
                toVis.append(nex)
                checkVis[nex]=1
                tonex=distance[now]+1
                distance[nex]=tonex
                dictlen[tonex]+=1
    #print(dictlen)
    for key in dictlen.keys():
        print(dictlen[key]//2)
if __name__=="__main__":
    main()

Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        num=0
        
        Tovis=[start]
        kyori[start]=0
        visited=[]
        
        while Tovis:
            nex=Tovis.pop(0)
            
            visited.append(nex)
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    if v in visited:
                        continue
                    if v in Tovis:
                        continue
                    Tovis.append(v)
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       

Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue


def main():
    
    input=sys.stdin.readline
    n,x,y=map(int,input().split())

    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1

    
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    
    for i in range(n):
        bfs(i,edge,step)
        
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue

import numpy as np
def main():
    #t1=time.time()
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=np.array([0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)])
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    np.array(edge)
    #t2=time.time()
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    
    for i in range(n):
        bfs(i,edge,step)
        
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue

import numpy as np
def main():
    #t1=time.time()
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    np.array(edge)
    #t2=time.time()
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    
    for i in range(n):
        bfs(i,edge,step)
        
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Runtime Error):
import sys
import queue

import numpy as np
def main():
    #t1=time.time()
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    np.array(edge)
    #t2=time.time()
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    
    for i in range(n):
        bfs(i,edge,step)
        
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Runtime Error):
import sys
import queue
import numpy as np
def main():
    #t1=time.time()
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    np.array(edge)
    #t2=time.time()
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    
    for i in range(n):
        bfs(i,edge,step)
        
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
import time
import numpy as np
def main():
    #t1=time.time()
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    np.array(edge)
    #t2=time.time()
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    
    for i in range(n):
        bfs(i,edge,step)
        
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Runtime Error):
import sys
import queue
import time
import numpy as np
def main():
    #t1=time.time()
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    np.array(edge)
    #t2=time.time()
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    
    for i in range(n):
        bfs(i,edge,step)
        if i==n-1:
     #       t3=time.time()
    for i in range(1,len(step)):
        print(int(step[i]))
    #t4=time.time()
    #t=[0,t2-t1,t3-t2,t4-t3,t4-t1]
    #print(t)
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*n#queueに入ったかを記録する
        Tovis=queue.Queue()#探索待ちの点を入れるキュー
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0        
        while Tovis.empty()==False:            
            nex=Tovis.get()            
            for v in range(n):                
                tmp=graph[nex][v]
                if tmp!=-1:                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*len(graph[0])
        Tovis=queue.Queue()
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0
        
        while Tovis.empty()!=True:
            #print(que_check)
            
            nex=Tovis.get()
            #print(nex)
            
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        que_check=[0]*len(graph[0])
        Tovis=queue.Queue()
        Tovis.put(start)
        que_check[start]=1
        kyori[start]=0
        
        while Tovis.empty()!=True:
            #print(que_check)
            
            nex=Tovis.get()
            #print(nex)
            que_check[nex]=1
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    
                    if que_check[v]==1:
                        continue
                    Tovis.put(v)
                    que_check[v]=1
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
import numpy as np
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        num=0
        
        Tovis=[start]
        kyori[start]=0
        visited=[]
        
        while Tovis:
            nex=Tovis.pop(-1)
            
            visited.append(nex)
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    if v in visited:
                        continue
                    if v in Tovis:
                        continue
                    Tovis.reverse()
                    Tovis.append(v)
                    Tovis.reverse()
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        num=0
        
        Tovis=[start]
        kyori[start]=0
        visited=[]
        qu=0
        while qu<len(Tovis):
            nex=Tovis[qu]#Tovis.pop(0)
            qu+=1
            visited.append(nex)
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    if v in visited:
                        continue
                    if v in Tovis:
                        continue
                    Tovis.append(v)
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import queue
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        num=0
        
        Tovis=[start]
        kyori[start]=0
        visited=[]
        qu=0
        while qu<len(Tovis):
            nex=Tovis[qu]#Tovis.pop(0)
            qu+=1
            visited.append(nex)
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    if v in visited:
                        continue
                    if v in Tovis:
                        continue
                    Tovis.append(v)
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))
if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        num=0
        Tovis=[start]
        kyori[start]=0
        visited=[]
        while Tovis:
            nex=Tovis.pop(0)
            visited.append(nex)
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    if v in visited:
                        continue
                    if  v in Tovis:
                        continue
                    Tovis.append(v)
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))

if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        num=0
        Tovis=[start]
        kyori[start]=0
        visited=[]
        while Tovis:
            nex=Tovis.pop(0)
            visited.append(nex)
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    if v in visited:
                        continue
                    if  v in Tovis:
                        continue
                    Tovis.append(v)
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))

if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
def main():
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    edge=[]
    for i in range(int(n)):
        tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
        edge.append(tmp)
    edge[x-1][y-1]=1
    edge[y-1][x-1]=1
    step=[0]*n#ある歩数の点の選び方をカウントする
    def bfs(start,graph,step):
        kyori={}#スタートからある点までの距離をある点をキーとして入れる
        num=0
        Tovis=[start]
        kyori[start]=0
        visited=[]
        while Tovis:
            nex=Tovis.pop(0)
            visited.append(nex)
            for v in range(len(graph[nex])):
                
                tmp=graph[nex][v]
                if tmp!=-1:
                    if v in visited:
                        continue
                    if  v in Tovis:
                        continue
                    Tovis.append(v)
                    res=kyori[nex]+1
                    kyori[v]=res#点ｖまでの距離はその前に通った点までの距離+1
                    step[res]+=0.5#i->j j->iの二回数えてしまうので
    for i in range(n):
        bfs(i,edge,step)
    for i in range(1,len(step)):
        print(int(step[i]))

if __name__ == '__main__':
    main()       


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
edge=[]
for i in range(int(n)):
    tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
    edge.append(tmp)
edge[x-1][y-1]=1
edge[y-1][x-1]=1
step=[0]*n#ある歩数の点の選び方をカウントする
def bfs(start,graph,step):
    kyori={}#スタートからある点までの距離をある点をキーとして入れる
    num=0
    Tovis=[start]
    kyori[start]=0
    visited=[]
    while Tovis:
        nex=Tovis.pop(0)
        visited.append(nex)
        for v in range(len(graph[nex])):
            tmp=graph[nex][v]
            if tmp!=-1:
                if v in visited:
                    continue
                if  v in Tovis:
                    continue
                Tovis.append(v)
                kyori[v]=kyori[nex]+1#点ｖまでの距離はその前に通った点までの距離+1
                step[kyori[v]]+=0.5#i->j j->iの二回数えてしまうので
for i in range(n):
    bfs(i,edge,step)
for i in range(1,len(step)):
    print(int(step[i]))
                


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
edge=[]
for i in range(int(n)):
    tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
    edge.append(tmp)
edge[x-1][y-1]=1
edge[y-1][x-1]=1
step=[0 for i in range(n)]#ある歩数の点の選び方をカウントする
def bfs(start,graph,step):
    kyori={}#スタートからある点までの距離をある点をキーとして入れる
    num=0
    Tovis=[start]
    kyori[start]=0
    visited=[]
    while Tovis:
        nex=Tovis.pop(0)
        visited.append(nex)
        for v in range(len(graph[nex])):
            tmp=graph[nex][v]
            if tmp!=-1:
                if v in visited:
                    continue
                if  v in Tovis:
                    continue
                Tovis.append(v)
                kyori[v]=kyori[nex]+1#点ｖまでの距離はその前に通った点までの距離+1
                step[kyori[v]]+=0.5#i->j j->iの二回数えてしまうので
for i in range(n):
    bfs(i,edge,step)
for i in range(1,len(step)):
    print(int(step[i]))

Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
edge=[]
for i in range(int(n)):
    tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
    edge.append(tmp)
edge[x-1][y-1]=1
edge[y-1][x-1]=1
step=[0 for i in range(n)]
def bfs(start,graph,step):
    kyori={}
    num=0
    Tovis=[start]
    kyori[start]=0
    visited=[]
    while Tovis:
        nex=Tovis.pop(0)
        visited.append(nex)
        for v in range(len(graph[nex])):
            tmp=graph[nex][v]
            if tmp!=-1:
                if v in visited:
                    continue
                if  v in Tovis:
                    continue
                Tovis.append(v)
                kyori[v]=kyori[nex]+1
                step[kyori[v]]+=0.5
    return kyori
for i in range(n):
    bfs(i,edge,step)
for i in range(1,len(step)):
    print(int(step[i]))
    

Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
edge=[]
for i in range(int(n)):
    tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
    edge.append(tmp)
edge[x-1][y-1]=1
edge[y-1][x-1]=1
step=[0 for i in range(n)]
def bfs(start,graph,step):
    kyori={}
    num=0
    Tovis=[start]
    kyori[start]=0
    visited=[]
    while Tovis:
        nex=Tovis.pop(0)
        visited.append(nex)
        for v in range(len(graph[nex])):
            tmp=graph[nex][v]
            if tmp!=-1:
                if v in visited:
                    continue
                if  v in Tovis:
                    continue
                Tovis.append(v)
                kyori[v]=kyori[nex]+1
                step[kyori[v]]+=0.5
    return kyori
for i in range(n):
    bfs(i,edge,step)
for i in range(1,len(step)):
    print(int(step[i]))
    

Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
edge=[]
for i in range(int(n)):
    tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
    edge.append(tmp)
edge[x-1][y-1]=1
edge[y-1][x-1]=1
def bfs(start,goal,graph):
    keiro={}
    Tovisit=[start]
    visited=[]
    while len(Tovisit)>0:
        #print(Tovisit)
        if goal in Tovisit:
            break      
        nex=Tovisit.pop(0)
        visited.append(nex)
        for v in range(len(graph[nex])):
            if graph[nex][v]!=-1:
                if v in visited:
                    continue
                if v in Tovisit:
                    continue
                Tovisit.append(v)
                keiro[v]=nex
    sum=0
    x=goal
    while x!=start:
        sum+=1
        x=keiro[x]
    return sum
for k in range(1,n):
    num=0
    for i in range(n):
        for j in range(i,n):
            if bfs(i,j,edge)==k:
                num+=1
    print(num)


Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
edge=[]
for i in range(int(n)):
    tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
    edge.append(tmp)
edge[x-1][y-1]=1
edge[y-1][x-1]=1
#print(edge)

def bfs(start,goal,graph):
    keiro={}
    i=0
    Tovisit=[start]
    visited=[]
    while len(Tovisit)>0:
        #print(Tovisit)
        if goal in Tovisit:
            break      
        nex=Tovisit.pop(0)
        visited.append(nex)
        #行けるポイントを探す G[nex][]!=none
        for v in range(len(graph[nex])):
            if graph[nex][v]!=-1:
                if v in visited:
                    continue
                if v in Tovisit:
                    continue
                Tovisit.append(v)
                keiro[v]=nex
    sum=0
    x=goal
    while x!=start:
        sum+=1
        x=keiro[x]
    return sum

for k in range(1,n):
    num=0
    for i in range(n):
        for j in range(i,n):
            if bfs(i,j,edge)==k:
                num+=1
    print(num)

        

Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
edge=[]
for i in range(int(n)):
    tmp=[0 if i==j else 1 if abs(i-j)==1 else -1 for j in range(n)]
    edge.append(tmp)
edge[x-1][y-1]=1
edge[y-1][x-1]=1
#print(edge)

def bfs(start,goal,graph):
    keiro={}
    i=0
    Tovisit=[start]
    visited=[]
    while len(Tovisit)>0:
        #print(Tovisit)
        if goal in Tovisit:
            break      
        nex=Tovisit.pop(0)
        visited.append(nex)
        #行けるポイントを探す G[nex][]!=none
        for v in range(len(graph[nex])):
            if graph[nex][v]!=-1:
                if v in visited:
                    continue
                if v in Tovisit:
                    continue
                Tovisit.append(v)
                keiro[v]=nex
    sum=0
    x=goal
    while x!=start:
        sum+=1
        x=keiro[x]
    return sum

for k in range(1,n):
    num=0
    for i in range(n):
        for j in range(i,n):
            if bfs(i,j,edge)==k:
                num+=1
    print(num)

        

Fixed submission:
N,X,Y=map(int,input().split())
ans=0
right=X-1
cycle=Y-X+1
left=N-Y
import copy
ring=copy.copy(cycle)
branchr=copy.copy(right)
if right>0:
    branchr+=1
branchl=copy.copy(left)
if left>0:
    branchl+=1
ring_branchr=0
ring_branchl=0
branchrl=0
count=0
if cycle%2==0:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k==cycle//2:
            ring = cycle//2
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2:
                ring_branchr-=2*(k-cycle//2)-1
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2:
                ring_branchl-=2*(k-cycle//2)-1
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
if cycle%2==1:
    for k in range(1,max(left+cycle//2,right+cycle//2,left+right+1)+1):
        if k>cycle//2:
            ring = 0
        if right>0:
            branchr-=1
            if k>right:
                branchr=0
        if left>0:
            branchl-=1
            if k>left:
                branchl=0
        if right>0:
            ring_branchr=min(2*(k-1),right*2)
            if k>cycle//2+1:
                ring_branchr-=2*(k-cycle//2-1)
            if ring_branchr<0:
                ring_branchr=0
        if left>0:
            ring_branchl=min(2*(k-1),left*2)
            if k>cycle//2+1:
                ring_branchl-=2*(k-cycle//2-1)
            if ring_branchl<0:
                ring_branchl=0
        if right>0 and left>0:
            if 3<=k<min(right,left)+3:
                branchrl+=1
            if k>max(right,left)+2:
                branchrl-=1
            if branchrl<0:
                branchrl=0
        ans=ring+branchr+branchl+ring_branchr+ring_branchl+branchrl
        print(ans)
        count+=1
for k in range(count+1,N):
    print(0)