Buggy python submission (verdict: Time Limit Exceeded):
from heapq import heappush, heappop
n, x, y = map(int, input().split())

links = [[] for i in range(n)]
for i in range(1, n):
        links[i-1].append(i)
        links[i].append(i-1)
links[x-1].append(y-1)
links[y-1].append(x-1)

ans = [0] * (n+1)
for i in range(n):
        dist = [1e5] * n
        used = [0] * n
        que = []
        heappush(que, [0, i])
        while len(que):
                dis, v = heappop(que)
                if used[v]: continue
                ans[dis] += 1
                used[v] = True
                for to in links[v]:
                        if not used[to]:
                                heappush(que, [dis+1, to])
for i in range(1, n): print(ans[i]//2)

Fixed submission:
n, x, y = map(int, input().split())

ans = [0] * (n+1)
for i in range(1, n+1):
        for j in range(i+1, n+1):
                ans[min(j-i, abs(i-x)+1+abs(j-y))] += 1
for i in range(1, n): print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
from queue import Queue
n, x, y = map(int, input().split())

links = [[] for i in range(n)]
for i in range(1, n):
        links[i-1].append(i)
        links[i].append(i-1)
links[x-1].append(y-1)
links[y-1].append(x-1)

ans = [0] * n
for i in range(n):
        dist = [1e5] * n
        used = [0] * n
        que = Queue()
        que.put([i, 0])
        while not que.empty():
                v, dis = que.get()
                used[v] = True
                for to in links[v]:
                        if not used[to]:
                                dist[to] = min(dist[to], dis)
                                que.put([to, dis+1])
        for a in dist:
                if a<1e5: ans[a] += 1
for i in range(n-1): print(ans[i]//2)

Fixed submission:
n, x, y = map(int, input().split())

ans = [0] * (n+1)
for i in range(1, n+1):
        for j in range(i+1, n+1):
                ans[min(j-i, abs(i-x)+1+abs(j-y))] += 1
for i in range(1, n): print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
from queue import Queue
n, x, y = map(int, input().split())

links = [[] for i in range(n)]
for i in range(1, n):
        links[i-1].append(i)
        links[i].append(i-1)
links[x-1].append(y-1)
links[y-1].append(x-1)

ans = [0] * (n+1)
dist = [[1e11]*n for i in range(n)]
for i in range(n):
        used = [0] * n
        que = Queue()
        que.put([i, 0])
        while que.qsize():
                v, dis = que.get()
                used[v] = True
                for to in links[v]:
                        if not used[to]:
                                dist[i][to] = min(dist[i][to], dis+1)
                                que.put([to, dis+1])
        for a in dist[i]:
                if a!=1e11: ans[a] += 1
for i in range(n-1): print(ans[i+1]//2)

Fixed submission:
n, x, y = map(int, input().split())

ans = [0] * (n+1)
for i in range(1, n+1):
        for j in range(i+1, n+1):
                ans[min(j-i, abs(i-x)+1+abs(j-y))] += 1
for i in range(1, n): print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
from queue import Queue
n, x, y = map(int, input().split())

links = [[] for i in range(n)]
for i in range(1, n):
        links[i-1].append(i)
        links[i].append(i-1)
links[x-1].append(y-1)
links[y-1].append(x-1)

ans = [0] * (n+1)
dist = [[1e11]*n for i in range(n)]
for i in range(n):
        used = [0] * n
        que = Queue()
        que.put([i, 0])
        while que.qsize():
                v, dis = que.get()
                used[v] = True
                for to in links[v]:
                        if not used[to]:
                                dist[i][to] = min(dist[i][to], dis+1)
                                que.put([to, dis+1])
        for a in dist[i]:
                if a!=1e11: ans[a] += 1
for i in range(n-1): print(ans[i+1]//2)

Fixed submission:
n, x, y = map(int, input().split())

ans = [0] * (n+1)
for i in range(1, n+1):
        for j in range(i+1, n+1):
                ans[min(j-i, abs(i-x)+1+abs(j-y))] += 1
for i in range(1, n): print(ans[i])