Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
def solve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1

    ans = [0] * N
    
    for start_vertex in range(N):
        q = deque()
        distance_list = [float('inf')] * N
        def push(vertex, distance):
            if distance_list[vertex] != float('inf'):
                return
            distance_list[vertex] = distance
            q.append(vertex)
        
        push(start_vertex, 0)
        while len(q) > 0:
            vertex = q.popleft()
            distance = distance_list[vertex]

            if vertex - 1 >= 0:
                push(vertex-1,distance+1)
            if vertex + 1 < N:
                push(vertex+1,distance+1)
            if vertex == X:
                push(Y,distance+1)
            if vertex == Y:
                push(X,distance+1)
        for d in distance_list:
            ans[d] += 1
    
    ans = list(map(lambda x: x // 2, ans))
    print(*ans[1:], sep='\n')
        

if __name__ == '__main__':
    solve()

Fixed submission:
from collections import defaultdict, deque
def solve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    cnter = defaultdict(int)

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


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict, deque
def solve():
    N, X, Y = map(int, input().split())
    cnter = [0] * N

    for start in range(N-1):
        deq = deque()
        deq.append(start)
        n_step = [float('inf')] * N
        n_step[start] = 0
        visited = [False] * N

        while len(deq) > 0:
            fr = deq.popleft()
            visited[fr] = True

            if fr == X-1:
                if not visited[Y-1] or n_step[Y-1] > n_step[X-1]+1:
                    n_step[Y-1] = n_step[X-1]+1
                    deq.append(Y-1)
                    visited[Y-1] = True

            if fr == Y-1:
                if not visited[X-1] or n_step[X-1] > n_step[Y-1]+1:
                    n_step[X-1] = n_step[Y-1]+1
                    deq.append(X-1)
                    visited[X-1] = True
                    
            if fr != N-1:
                if not visited[fr+1] or n_step[fr+1] > n_step[fr]+1:
                    deq.append(fr+1)
                    n_step[fr+1] = n_step[fr]+1
                    visited[fr+1] = True

            if fr != 0:
                if not visited[fr-1] or n_step[fr-1] > n_step[fr]+1:
                    deq.append(fr-1)
                    n_step[fr-1] = n_step[fr]+1
                    visited[fr-1] = True
        
        for i in range(start,N):
            cnter[n_step[i]] += 1
            
    for i in range(1,N):
        print(cnter[i])

if __name__ == '__main__':
    solve()


Fixed submission:
from collections import defaultdict, deque
def solve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    cnter = defaultdict(int)

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


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict, deque
def solve():
    N, X, Y = map(int, input().split())
    cnter = defaultdict(int)

    for start in range(N-1):
        deq = deque()
        deq.append(start)
        n_step = [float('inf')] * N
        n_step[start] = 0
        visited = [False] * N

        while len(deq) > 0:
            fr = deq.popleft()
            visited[fr] = True

            if fr == X-1:
                if not visited[Y-1] or n_step[Y-1] > n_step[X-1]+1:
                    n_step[Y-1] = n_step[X-1]+1
                    deq.append(Y-1)
                    visited[Y-1] = True

            if fr == Y-1:
                if not visited[X-1] or n_step[X-1] > n_step[Y-1]+1:
                    n_step[X-1] = n_step[Y-1]+1
                    deq.append(X-1)
                    visited[X-1] = True
                    
            if fr != N-1:
                if not visited[fr+1] or n_step[fr+1] > n_step[fr]+1:
                    deq.append(fr+1)
                    n_step[fr+1] = n_step[fr]+1
                    visited[fr+1] = True

            if fr != 0:
                if not visited[fr-1] or n_step[fr-1] > n_step[fr]+1:
                    deq.append(fr-1)
                    n_step[fr-1] = n_step[fr]+1
                    visited[fr-1] = True
        
        for i in range(start,N):
            if n_step[i] == float('inf'):
                continue
            cnter[n_step[i]] += 1
            
    for i in range(1,N):
        print(cnter[i])

if __name__ == '__main__':
    solve()

Fixed submission:
from collections import defaultdict, deque
def solve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    cnter = defaultdict(int)

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


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict, deque
def solve():
    N, X, Y = map(int, input().split())
    cnter = defaultdict(int)

    for start in range(N-1):
        deq = deque()
        deq.append(start)
        n_step = [float('inf')] * N
        n_step[start] = 0
        visited = [False] * N

        while len(deq) > 0:
            fr = deq.popleft()
            visited[fr] = True

            if fr == X-1:
                if not visited[Y-1] or n_step[Y-1] > n_step[X-1]+1:
                    n_step[Y-1] = n_step[X-1]+1
                    deq.append(Y-1)
                    visited[Y-1] = True

            if fr == Y-1:
                if not visited[X-1] or n_step[X-1] > n_step[Y-1]+1:
                    n_step[X-1] = n_step[Y-1]+1
                    deq.append(X-1)
                    visited[X-1] = True
                    
            if fr != N-1:
                if not visited[fr+1] or n_step[fr+1] > n_step[fr]+1:
                    deq.append(fr+1)
                    n_step[fr+1] = n_step[fr]+1
                    visited[fr+1] = True

            if fr != 0:
                if not visited[fr-1] or n_step[fr-1] > n_step[fr]+1:
                    deq.append(fr-1)
                    n_step[fr-1] = n_step[fr]+1
                    visited[fr-1] = True
        
        for i in range(start,N):
            if n_step[i] == float('inf'):
                continue
            cnter[n_step[i]] += 1
            
    for i in range(1,N):
        print(cnter[i])

if __name__ == '__main__':
    solve()

Fixed submission:
from collections import defaultdict, deque
def solve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    cnter = defaultdict(int)

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


if __name__ == '__main__':
    solve()