Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from heapq import heappush, heappop


class Dijkstra:
    def __init__(self, num_nodes):
        self.n = num_nodes
        # 隣接行列 d[u][v]: uからvへのコスト
        self.adj_matrix = [[float("inf")]*self.n for i in range(self.n)]

    # Edge数分回すことを想定
    def add_edge(self, start, end, weight=1, undirected=False):
        self.adj_matrix[start][end] = weight
        if undirected:
            self.adj_matrix[end][start] = weight

    def distance(self, start):
        # 始点から各頂点までの最短距離を格納する
        self.dist = [float('inf') for _ in range(self.n)]
        # 最短経路における, その頂点の前の頂点のIDを格納する
        self.prev = [float('inf') for _ in range(self.n)]
        self.dist[start] = 0
        # 各要素は，(頂点vのID, startからある頂点vまでの仮の距離)からなるタプル
        q = []
        heappush(q, (start, 0))
        while len(q) != 0:
            src, prov_cost  = heappop(q)
            # プライオリティキューに格納されている最短距離が, 現在計算できている最短距離より大きければ，distの更新をする必要はない
            if self.dist[src] < prov_cost:
                continue
            # 他の頂点の探索
            for dest in range(self.n):
                cost = self.adj_matrix[src][dest]
                if cost != float('inf') and self.dist[dest] > self.dist[src] + cost:
                    self.dist[dest] = self.dist[src] + cost # distの更新
                    heappush(q, (dest, self.dist[dest])) # キューに新たな仮の距離の情報をpush
                    self.prev[dest] = src
        return self.dist

    def shortest_path(self, goal):
        path = [goal]
        dest = goal
        # 終点から最短経路を逆順に辿る
        while self.prev[dest] != float('inf'):
            path.append(self.prev[dest])
            dest = self.prev[dest]
        return path[::-1]


# BFS pypyでAC
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    solver = Dijkstra(N)
    for val in _data:
        solver.add_edge(val[0]-1, val[1]-1, undirected=True)
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        dist = solver.distance(i)
        for j in range(i, N):
            dist_cnt[dist[j]] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)


Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from collections import deque


class BreadthFirstSearch:
    def __init__(self, num_nodes):
        self.n = num_nodes
        self.graph = [[] for _ in range(self.n)]

    # Edge数分回すことを想定
    def add_edge(self, start, end, undirected=True):
        self.graph[start].append(end)
        if undirected:
            self.graph[end].append(start)

    # depth = distance
    def search(self, start_node):
        order = [-1] * self.n # a bfs ordering of each vertex
        parent = [-1] * self.n # parent of each vertex in the bfs search tree
        depth = [-1] * self.n # the depth of each vertex
        q = deque([(start_node, -1, 0)]) # (vertex, parent, depth)
        num = 0 # current ordering
        while len(q) > 0:
            v, p, d = q.popleft()
            if order[v] < 0: # visited v for the first time
                order[v] = num; parent[v] = p; depth[v] = d
                num += 1
                for u in adj_list[v]:
                    if order[u] >= 0: continue
                    q.append((u, v, d+1))
        return order, parent, depth



# BFS
def breadth_first_search(adj_list, start_node):
    N = len(adj_list)
    order = [-1] * N # a bfs ordering of each vertex
    parent = [-1] * N # parent of each vertex in the bfs search tree
    depth = [-1] * N # the depth of each vertex
    q = deque([(start_node, -1, 0)]) # (vertex, parent, depth)
    num = 0 # current ordering
    while len(q) > 0:
        v, p, d = q.popleft()
        if order[v] < 0: # visited v for the first time
            order[v] = num; parent[v] = p; depth[v] = d
            num += 1
            for u in self.graph[v]:
                if order[u] >= 0: continue
                q.append((u, v, d+1))
    return order, parent, depth


# BFS pypyでAC
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    bfs = BreadthFirstSearch(N)
    for val in _data:
        bfs.add_edge(val[0]-1, val[1]-1)
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        _, _, depth = bfs.search(i)
        for j in range(i, N):
            dist_cnt[depth[j]] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)


Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from collections import deque


class BreadthFirstSearch:
    def __init__(self, num_nodes):
        self.n = num_nodes
        self.graph = [[] for _ in range(self.n)]

    # Edge数分回すことを想定
    def add_edge(self, start, end, undirected=True):
        self.graph[start].append(end)
        if undirected:
            self.graph[end].append(start)

    # depth = distance
    def search(self, start_node):
        order = [-1] * self.n # a bfs ordering of each vertex
        parent = [-1] * self.n # parent of each vertex in the bfs search tree
        depth = [-1] * self.n # the depth of each vertex
        q = deque([(start_node, -1, 0)]) # (vertex, parent, depth)
        num = 0 # current ordering
        while len(q) > 0:
            v, p, d = q.popleft()
            if order[v] < 0: # visited v for the first time
                order[v] = num; parent[v] = p; depth[v] = d
                num += 1
                for u in adj_list[v]:
                    if order[u] >= 0: continue
                    q.append((u, v, d+1))
        return order, parent, depth



# BFS
def breadth_first_search(adj_list, start_node):
    N = len(adj_list)
    order = [-1] * N # a bfs ordering of each vertex
    parent = [-1] * N # parent of each vertex in the bfs search tree
    depth = [-1] * N # the depth of each vertex
    q = deque([(start_node, -1, 0)]) # (vertex, parent, depth)
    num = 0 # current ordering
    while len(q) > 0:
        v, p, d = q.popleft()
        if order[v] < 0: # visited v for the first time
            order[v] = num; parent[v] = p; depth[v] = d
            num += 1
            for u in adj_list[v]:
                if order[u] >= 0: continue
                q.append((u, v, d+1))
    return order, parent, depth


# BFS pypyでAC
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    bfs = BreadthFirstSearch(N)
    for val in _data:
        bfs.add_edge(val[0]-1, val[1]-1)
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        _, _, depth = bfs.search(i)
        for j in range(i, N):
            dist_cnt[depth[j]] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)


Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from collections import deque


class BreadthFirstSearch:
    def __init__(self, num_nodes):
        self.n = num_nodes
        self.graph = [[] for _ in range(self.n)]

    # Edge数分回すことを想定
    def add_edge(self, start, end, undirected=True):
        self.graph[start].append(end)
        if undirected:
            self.graph[end].append(start)

    # depth = distance
    def search(self, start_node):
        order = [-1] * self.n # a bfs ordering of each vertex
        parent = [-1] * self.n # parent of each vertex in the bfs search tree
        depth = [-1] * self.n # the depth of each vertex
        q = deque([(start_node, -1, 0)]) # (vertex, parent, depth)
        num = 0 # current ordering
        while len(q) > 0:
            v, p, d = q.popleft()
            if order[v] < 0: # visited v for the first time
                order[v] = num; parent[v] = p; depth[v] = d
                num += 1
                for u in adj_list[v]:
                    if order[u] >= 0: continue
                    q.append((u, v, d+1))
        return order, parent, depth



# BFS
def breadth_first_search(adj_list, start_node):
    N = len(adj_list)
    order = [-1] * N # a bfs ordering of each vertex
    parent = [-1] * N # parent of each vertex in the bfs search tree
    depth = [-1] * N # the depth of each vertex
    q = deque([(start_node, -1, 0)]) # (vertex, parent, depth)
    num = 0 # current ordering
    while len(q) > 0:
        v, p, d = q.popleft()
        if order[v] < 0: # visited v for the first time
            order[v] = num; parent[v] = p; depth[v] = d
            num += 1
            for u in adj_list[v]:
                if order[u] >= 0: continue
                q.append((u, v, d+1))
    return order, parent, depth


# BFS pypyでAC
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    bfs = BreadthFirstSearch(N)
    for val in _data:
        bfs.add_edge(val[0], val[1])
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        _, _, depth = bfs.search(i)
        for j in range(i, N):
            dist_cnt[depth[j]] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)


Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Buggy python submission (verdict: Runtime Error):
# from sys import stdin

# # 解説のコード
# def get_result(data):
#     N, X, Y = data
#     dist_cnt = [0 for i in range(N)]
#     for i in range(1, N+1):
#         for j in range(i+1, N+1):
#             min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
#             dist_cnt[min_dist] += 1
#     for i in range(1, N):
#         print(dist_cnt[i])


# if __name__ == '__main__':
#     data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
#     get_result(data)

from sys import stdin
from collections import deque


# 重みなしグラフの隣接リスト
# 0-indexed nodes
def get_adj_list(num_nodes, data, undirected=True):
    graph = [[] for _ in range(num_nodes)]
    for val in data:
        x, y = val
        graph[x-1] = graph[x-1] + [y-1]
        if undirected:
            graph[y-1] = graph[y-1] + [x-1]
    return graph


# BFS
def depth_first_search(adj_list, start_node)):
    N = len(adj_list)
    preorder = [-1] * N # a dfs preordering of each vertex
    postorder = [-1] * N # a dfs postordering of each vertex
    parent = [-1] * N # parent of each vertex in the dfs search tree
    depth = [-1] * N # the depth of each vertex
    stack = [(start_node, -1, 0)] # (vertex, parent, status)
    pre_num = 0 # current preordering
    post_num = 0 # current postordering
    d = 0 # current depth
    while len(stack) > 0:
        v, p, st = stack.pop()
        if st == 0 and preorder[v] < 0: # visited v for the first time
            preorder[v] = pre_num; parent[v] = p; depth[v] = d
            pre_num += 1
            n_children = 0
            for u in adj_list[v]:
                if preorder[u] >= 0: continue
                if n_children == 0:
                    stack += [(v, p, 2), (u, v, 0)]
                    n_children += 1
                else:
                    stack += [(v, p, 1), (u, v, 0)]
                    n_children += 1
            if n_children == 0: # v is a leaf
                postorder[v] = post_num
                post_num += 1
                d -= 1
            else:
                d += 1
        elif st == 0 and preorder[v] >= 0: # the edge (v, p) is a back edge
            d -= 1
        elif st == 1: # now searching
            d += 1
        else: # search finished (st=2)
            postorder[v] = post_num
            post_num += 1
            d -= 1
    return preorder, postorder, parent, depth


# BFS pypyでAC
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    adj_list = get_adj_list(N, _data)
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        _, _, _,  depth = depth_first_search(adj_list, i)
        for j in range(i, N):
            dist_cnt[depth[j]] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)


Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Buggy python submission (verdict: Time Limit Exceeded):
# from sys import stdin

# # 解説のコード
# def get_result(data):
#     N, X, Y = data
#     dist_cnt = [0 for i in range(N)]
#     for i in range(1, N+1):
#         for j in range(i+1, N+1):
#             min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
#             dist_cnt[min_dist] += 1
#     for i in range(1, N):
#         print(dist_cnt[i])


# if __name__ == '__main__':
#     data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
#     get_result(data)

from sys import stdin
from collections import deque


# 重みなしグラフの隣接リスト
# 0-indexed nodes
def get_adj_list(num_nodes, data, undirected=True):
    graph = [[] for _ in range(num_nodes)]
    for val in data:
        x, y = val
        graph[x-1] = graph[x-1] + [y-1]
        if undirected:
            graph[y-1] = graph[y-1] + [x-1]
    return graph


# BFS
def breadth_first_search(adj_list, start_node):
    N = len(adj_list)
    order = [-1] * N # a bfs ordering of each vertex
    parent = [-1] * N # parent of each vertex in the bfs search tree
    depth = [-1] * N # the depth of each vertex
    q = deque([(start_node, -1, 0)]) # (vertex, parent, depth)
    num = 0 # current ordering
    while q:
        v, p, d = q.popleft()
        if order[v] < 0: # visited v for the first time
            order[v] = num
            parent[v] = p
            depth[v] = d
            num += 1
            for u in adj_list[v]:
                if order[u] >= 0: continue
                q.append((u, v, d+1))
    return order, parent, depth

# BFS pypyでAC
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    adj_list = get_adj_list(N, _data)
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        _, _, depth = breadth_first_search(adj_list, i)
        for j in range(i, N):
            dist_cnt[depth[j]] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)


Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from collections import deque


# 重みなしグラフの隣接リスト
# 0-indexed nodes
def get_adj_list(num_nodes, data, undirected=True):
    graph = [[] for _ in range(num_nodes)]
    for val in data:
        x, y = val
        graph[x-1] = graph[x-1] + [y-1]
        if undirected:
            graph[y-1] = graph[y-1] + [x-1]
    return graph


# BFS
def breadth_first_search(adj_list, start_node):
    N = len(adj_list)
    order = [-1] * N # a bfs ordering of each vertex
    parent = [-1] * N # parent of each vertex in the bfs search tree
    depth = [-1] * N # the depth of each vertex
    q = deque([(s, -1, 0)]) # (vertex, parent, depth)
    num = 0 # current ordering
    while q:
        v, p, d = q.popleft()
        if order[v] < 0: # visited v for the first time
            order[v] = num
            parent[v] = p
            depth[v] = d
            num += 1
            for u in adj_list[v]:
                if order[u] >= 0: continue
                q.append((u, v, d+1))
    return order, parent, depth

# BFS pypyでAC
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    adj_list = get_adj_list(N, _data)
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        _, _, depth = breadth_first_search(adj_list, i)
        for j in range(i, N):
            dist_cnt[depth[j]] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from collections import deque


def get_adj_list(num_nodes, data, undirected=True):
    # adj_list ex) {1:[2,3,4], 2:[1,4,5], 3:[1,4], 4:[1,2,3,5], 5:[2,4]}
    graph = {}
    for i in range(num_nodes):
        graph[i+1] = []
    for val in data:
        x, y = val
        graph[x] = graph[x] + [y]
        if undirected:
            graph[y] = graph[y] + [x]
    return graph


def breadth_first_search(adj_list, start_node):
    dist = {}
    queue = deque([(start_node, 0)])
    while len(queue) > 0:
        v, d = queue.popleft()
        if v in dist: continue
        dist[v] = d
        for u in adj_list[v]:
            if u not in dist:
                queue.append((u, d+1))
    return dist

# bfs
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    adj_list = get_adj_list(N, _data)
    dist_list = []
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        dist_list.append(breadth_first_search(adj_list, i+1))
    for i in range(N):
        for j in range(i, N):
            dist_cnt[dist_list[i][j+1]] += 1
    for i in range(1, N):
        print(dist_cnt[i])

# 解説のコード
# def get_result(data):
#     N, X, Y = data
#     dist_cnt = [0 for i in range(N)]
#     for i in range(1, N+1):
#         for j in range(i+1, N+1):
#             min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
#             dist_cnt[min_dist] += 1
#     for i in range(1, N):
#         print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from collections import deque


def get_adj_list(num_nodes, data, undirected=True):
    # adj_list ex) {1:[2,3,4], 2:[1,4,5], 3:[1,4], 4:[1,2,3,5], 5:[2,4]}
    graph = {}
    for i in range(num_nodes):
        graph[i+1] = []
    for val in data:
        x, y = val
        graph[x] = graph[x] + [y]
        if undirected:
            graph[y] = graph[y] + [x]
    return graph


def breadth_first_search(adj_list, start_node):
    dist = {}
    queue = deque([(start_node, 0)])
    while len(queue) > 0:
        v, d = queue.popleft()
        if v in dist: continue
        dist[v] = d
        for u in adj_list[v]:
            if u not in dist:
                queue.append((u, d+1))
    return dist

# bfs
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    adj_list = get_adj_list(N, _data)
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        dist = breadth_first_search(adj_list, i+1)
        for j in range(i, N):
            dist_cnt[dist[j+1]] += 1
    for i in range(1, N):
        print(dist_cnt[i])

# 解説のコード
# def get_result(data):
#     N, X, Y = data
#     dist_cnt = [0 for i in range(N)]
#     for i in range(1, N+1):
#         for j in range(i+1, N+1):
#             min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
#             dist_cnt[min_dist] += 1
#     for i in range(1, N):
#         print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

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


def get_result(data):
    N, X, Y = data
    min_dist = []
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist.append(min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)]))
    for i in range(1, N):
        print(min_dist.count(i))


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

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

def get_result(data):
    N, X, Y = data
    min_dist = []
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist.append(min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)]))
    for i in range(1, N):
        print(min_dist.count(i))


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)

Fixed submission:
from sys import stdin


def get_result(data):
    N, X, Y = data
    dist_cnt = [0 for i in range(N)]
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            min_dist = min([j-i, abs(X-i) + 1 + abs(Y-j), abs(Y-i) + 1 + abs(X-j)])
            dist_cnt[min_dist] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)