Problem:
 Score : 400 points    Problem Statement  We have an undirected graph G with N vertices numbered 1 to N and N edges as follows:   For each i=1,2,...,N-1 , there is an edge between Vertex i and Vertex i+1 .  There is an edge between Vertex X and Vertex Y .   For each k=1,2,...,N-1 , solve the problem below:   Find the number of pairs of integers (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j in G is k .       Constraints   3 \leq N \leq 2 \times 10^3  1 \leq X,Y \leq N  X+1 < Y  All values in input are integers.         Input  Input is given from Standard Input in the following format:  N  X  Y       Output  For each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.        Sample Input 1 5 2 4      Sample Output 1 5
4
1
0  The graph in this input is as follows:     There are five pairs (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j is 1 : (1,2)\,,(2,3)\,,(2,4)\,,(3,4)\,,(4,5) . There are four pairs (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j is 2 : (1,3)\,,(1,4)\,,(2,5)\,,(3,5) . There is one pair (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j is 3 : (1,5) . There are no pairs (i,j) (1 \leq i < j \leq N) such that the shortest distance between Vertex i and Vertex j is 4 .       Sample Input 2 3 1 3      Sample Output 2 3
0  The graph in this input is as follows:           Sample Input 3 7 3 7      Sample Output 3 7
8
4
2
0
0       Sample Input 4 10 4 8      Sample Output 4 10
12
10
8
4
1
0
0
0

Solution (Python):



import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read


n,x,y = [int(i) for i in read().split()]
x -= 1
y -= 1

ans = [0]*n
for p in range(n):
    for q in range(p+1,n):
        d = min(q-p,abs(p-x)+1+abs(q-y),abs(p-y)+1+abs(q-x))
        ans[d] += 1

print(*ans[1:],sep="\n")

Solution (Python):
n,x,y=map(int,input().split())

x-=1
y-=1
ans=[0]*(n-1)

for i in range(n-1):
    for j in range(i+1,n):
        saisho=j-i
        
        

        x_kyori=abs(i-x)
        y_kyori=abs(j-y)
        
        
        
        tikamiti=x_kyori+y_kyori+1
        saisho=min(saisho,tikamiti)
        ans[saisho-1]+=1



for a in ans:
    print(a)

Solution (Python):
n,x,y=map(int,input().split())

x-=1
y-=1
ans=[0]*(n-1)

for i in range(n-1):
    for j in range(i+1,n):
        saisho=j-i
        
        

        x_kyori=abs(i-x)
        y_kyori=abs(j-y)
        
        
        
        tikamiti=x_kyori+y_kyori+1
        saisho=min(saisho,tikamiti)
        ans[saisho-1]+=1



for a in ans:
    print(a)

Solution (Python):
n, x, y = map(int, input().split())
ans = [0] * (n - 1)
for i in range(1, n):
    for j in range(i + 1, n + 1):
        dis = min(j - i, abs(x - i) + 1 + abs(y - j))
        ans[dis - 1] += 1
for i in range(n - 1):
    print(ans[i])

Solution (Python):
n,x,y = map(int,input().split())

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




for i in range(1,n):
  print(ans[i])

Solution (Python):
N, X, Y = map(int, input().split())

ans_array = [0] * N

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

for i in ans_array[1:]:
    print(i)

Solution (Python):
N, X, Y = list(map(int, input().split()))

X, Y = X-1, Y-1

def solve_shortest(a, b):
    if a > b:
        a, b = b, a
    l = [
        b - a,
        abs(X - a) + 1 + abs(b - Y)
    ]
    
    return min(l)

counts = [0]*N
for i in range(N):
    for j in range(N):
        if i < j:
            counts[solve_shortest(i, j)] += 1

for i in range(1, N):
    print(counts[i])

Solution (Python):

import sys
input = sys.stdin.readline
import heapq
INF = 10**9

class Dijkstra:
    def __init__(self, adj):
        self.adj = adj
        self.dist = [INF] * len(adj)
        self.q = []
    
    def reset(self):
        self.dist = [INF] * len(self.adj)
        self.q = []

    def calc(self, start):
        self.dist[start] = 0
        heapq.heappush(self.q, (0, start))
        while len(self.q) != 0:
            prov_cost, src = heapq.heappop(self.q)
            if self.dist[src] < prov_cost:
                continue
            for dest in self.adj[src]:
                if self.dist[dest] > self.dist[src] + 1:
                    self.dist[dest] = self.dist[src] + 1
                    heapq.heappush(self.q, (self.dist[dest], dest))
        return self.dist

n, x, y = map(int, input().split())
x -= 1; y -= 1
edge = [[] for _ in range(n)]
for i in range(n-1):
    edge[i].append(i+1)
    edge[i+1].append(i)
edge[x].append(y)
edge[y].append(x)
DIJK = Dijkstra(edge)

dist_cnt = [0] * n
for i in range(n):
    dist = DIJK.calc(i)
    for j in range(i+1, n):
        dist_cnt[dist[j]] += 1
    DIJK.reset()

for item in dist_cnt[1:]:
    print(item)

Solution (Python):
N,X,Y = map(int,input().split())

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

Solution (Python):
n, x, y = [int(i) for i in input().split()]
k = [0 for _ in range(n-1)]
x -= 1
y -= 1

for i in range(n):
    for j in range(i + 1, n):
        l = min(abs(j - i), abs(x - i) + 1 + abs(y - j))
        k[l - 1] += 1

for i in k:
    print(i)

Solution (Python):
n,x,y = map(int, input().split())
x -= 1
y -= 1
ans = [0 for i in range(n+1)]
for i in range(0,n):
    for j in range(i+1,n):
        if (i <= x and j <= x) or (i >= y and j >= y):
            ans[j-i] += 1
        else:
            k = min(abs(x-i) + 1 + abs(y-j), j-i)
            ans[k] += 1
for i in range(1,n):
    print(ans[i])

Solution (Python):
def main():
    N,X,Y = [int(n) for n in input().split()]
    X -= 1
    Y -= 1
    res = [0] * N
    for i in range(N):
        for j in range(i,N):
            dis = min([j - i, abs(i - X) + 1 + abs(j-Y), abs(i - Y) + 1 + abs(j-Y)])
            
            
            res[dis]+=1
    for i in range(1,N):
        print(res[i])
main()

Solution (Python):
n,x,y=map(int,input().split())
x-=1;y-=1
ans=[0]*(n)
for i in range(n-1):
    for j in range(i,n):
        dist=min(j-i,abs(x-i)+1+abs(y-j))
        ans[dist]+=1
for i in range(1,n):
    print(ans[i])

Solution (Python):
N,X,Y = map(int,input().split())
X-=1
Y-=1

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

for i in range(N-1):
    print(ans[i])

Solution (Python):
N,X,Y=map(int,input().split())
X-=1
Y-=1
ans=[0]*(N-1)

for l in range(N):
  for r in range(l+1,N):
    a=min(r-l,abs(X-l)+abs(Y-r)+1)
    ans[a-1]+=1
    
for a in ans:
  print(a)

Solution (Python):
n, x, y = map(int, input().split())
x -= 1
y -= 1
ans = [0 for _ in range(n-1)]
for i in range(0, n-1):
    for j in range(i+1, n):
        cur = min(j-i, abs(x-i)+1+abs(y-j))
        ans[cur-1] += 1
        
print(*ans, sep='\n')

Solution (Python):
N, X, Y = map(int, input().split())

ans = [0] * (N - 1)

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

for a in ans:
    print(a)

Solution (Python):
import sys
input = sys.stdin.readline

N,X,Y=map(int,input().split())
E=[[] for i in range(N+1)]
for i in range(1,N):
    E[i].append(i+1)
    E[i+1].append(i)
E[X].append(Y)
E[Y].append(X)

ANS=[0]*(N+1)
from collections import deque
for i in range(1,N+1):
    Q=deque()
    Q.append(i)
    D=[-1]*(N+1)
    D[i]=0
    
    while Q:
        x=Q.popleft()
        for to in E[x]:
            if D[to]==-1:
                D[to]=D[x]+1
                Q.append(to)
                ANS[D[to]]+=1
    
for i in range(1,N):
    print(ANS[i]//2)

Solution (Python):
n,x,y = map(int,input().split())
x -= 1
y -= 1
def d(i,j):
    return min(abs(i-x) + abs(j-y) + 1, j-i)
ans = [0] * (n-1)
for i in range(n-1):
    for j in range(i+1,n):
        ans[d(i,j) - 1] += 1
for i in ans:
    print(i)

Solution (Python):
N,X,Y = map(int,input().split())
Ans = [0]*(N+1000)

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

Solution (Python):
n,x,y = (int(num) for num in input().split())
x -= 1
y -= 1

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

Solution (Python):
from heapq import heappush, heappop
from collections import defaultdict
def dijkstra(graph:list, node:int, start:int) -> list:
    
    inf = float('inf')
    dist = [inf]*node

    dist[start] = 0
    heap = [(0,start)]
    while heap:
        cost,thisNode = heappop(heap)
        for NextCost,NextNode in graph[thisNode]:
            dist_cand = dist[thisNode]+NextCost
            if dist_cand < dist[NextNode]:
                dist[NextNode] = dist_cand
                heappush(heap,(dist[NextNode],NextNode))
    return dist

N,X,Y = map(int,input().split())
graph = [[] for _ in range(N)]
graph[X-1].append((1,Y-1))
graph[Y-1].append((1,X-1))
for i in range(N-1):
    graph[i].append((1,i+1))
    graph[i+1].append((1,i))

ans = defaultdict(lambda:0)
for i in range(N):
    d = dijkstra(graph,N,i)

    for k in d:
        ans[k] += 1
for i in range(1,N):
    print(ans[i]//2)

Solution (Python):
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))



N,X,Y = LI()

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

for i in range(1,N):
    print(d[i])

Solution (Python):
def main():
    import sys
    input=sys.stdin.readline
    n,x,y=map(int,input().split())
    x-=1
    y-=1
    ans=[0]*(n-1)
    for i in range(n-1):
        for j in range(i+1,n):
            d=min(j-i,abs(x-i)+abs(y-j)+1,abs(y-i)+abs(x-j)+1)
            ans[d-1]+=1
    for i in range(n-1):
        print(ans[i])

if __name__ == '__main__':
    main()

Solution (Python):
N, X, Y = map(int, input().split())

ans = [0] * N

for a in range(1, N+1):
    for b in range(a+1, N+1):
        t = b - a
        t2 = abs(X-a) + abs(Y-b) + 1
        t = t if t < t2 else t2
        ans[t] += 1

for i in range(1, N):
    print(ans[i])

Solution (Python):
from collections import deque


def BFS(G, V, start):
    dist = [-1] * V
    que = deque([start])
    dist[start] = 0

    while que:
        v = que.popleft()
        d = dist[v]
        for w in G[v]:
            if dist[w] > -1:
                continue
            dist[w] = d + 1
            que.append(w)

    return dist


N, X, Y = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(N-1):
    G[i].append(i+1)
    G[i+1].append(i)
G[X-1].append(Y-1)
G[Y-1].append(X-1)

Dist = [0] * (N-1)
for i in range(N):
    D = BFS(G, N, i)
    for d in D:
        Dist[d-1] += 1

for ans in Dist[:N-2]:
    print(ans//2)
print(0)

Solution (Python):
import sys
input = sys.stdin.readline

N, X, Y = map(int, input().split())
X -= 1; Y -= 1

graph = [[] for _ in range(N)]
for i in range(N-1):
    graph[i].append(i+1)
    graph[i+1].append(i)

graph[X].append(Y)
graph[Y].append(X)

def bfs(a):
    D = [-1]*N
    D[a] = 0
    q = [a]
    while q:
        qq = []
        for p in q:
            for np in graph[p]:
                if D[np] == -1:
                    D[np] = D[p] + 1
                    qq.append(np)
        q = qq
    return D

ans = [0]*(N-1)
for n in range(N):
    D = bfs(n)
    for m in range(N):
        if m == n: continue
        ans[D[m]-1] += 1

for a in ans:
    print(a//2)

Solution (Python):
from itertools import combinations
n,x,y = map(int,input().split())
x -= 1
y -= 1
ans = [0]*n
for i,j in combinations(range(n),2):
  dist = min(j-i,abs(i-x)+abs(j-y)+1)
  ans[dist-1] += 1
anss = ans[:n-1]
print(*anss,sep="\n")

Solution (Python):
n,x,y = map(int,input().split())
x -= 1
y -= 1
ans = [0 for _ in range(n)]
for i in range(n):
  for j in range(i+1,n):
    tmp = min(j-i,abs(j-y)+abs(i-x)+1)
    ans[tmp] += 1
    
for i in range(1,n):
  print(ans[i])

Solution (Python):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N, X, Y = map(int, read().split())

dist = []
for i in range(1, N + 1):
    x = np.arange(1, N + 1)
    
    d1 = np.abs(x - i)
    
    d2 = np.abs(i - X) + np.abs(Y - x) + 1
    
    d3 = np.abs(i - Y) + np.abs(X - x) + 1
    d = np.minimum(np.minimum(d1, d2), d3)
    dist.append(d)

dist = np.concatenate(dist)
count = np.bincount(dist, minlength=N)
print('\n'.join((count[1:] // 2).astype(str)))

Solution (Python):

from collections import Counter
from itertools import combinations
import sys


def d(i: int, j: int, X: int, Y: int):
    res = min(
        abs(i - j),
        abs(i - X) + 1 + abs(Y - j),
        abs(i - Y) + 1 + abs(X - j),
    )
    return res


def solve(N: int, X: int, Y: int):
    X -= 1
    Y -= 1
    ctr = Counter(
        d(i, j, X, Y)
        for i, j in combinations(range(N), 2)
    )
    for di in range(1, N):
        print(ctr[di])


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    X = int(next(tokens))  
    Y = int(next(tokens))  
    solve(N, X, Y)


if __name__ == '__main__':
    main()

Solution (Python):
N,X,Y = map(int,input().split())
ans = [0] * (N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        d = min(j-i, abs(X-i) + abs(j-Y) + 1)
        ans[d-1] += 1
print(*ans, sep='\n')

Solution (Python):
def examA():
    S = SI()
    if S[2]==S[3] and S[4]==S[5]:
        print("Yes")
    else:
        print("No")
    return

def examB():
    X = I()
    ans = 0
    ans += (X//500) * 1000
    X %= 500
    ans += (X//5) * 5
    print(ans)
    return

def examC():
    K, N = LI()
    A = LI()
    L = [0]*N
    L[0] = K-A[-1] + A[0]
    for i in range(1,N):
        L[i] = A[i]-A[i-1]
    ans = sum(L) - max(L)
    
    print(ans)
    return

def examD():
    def bfs(n, e, fordfs):
        
        W = [-1] * n
        
        W[e] = 0
        que = deque()
        que.append(e)
        while que:
            now = que.popleft()
            nowW = W[now]
            for ne in fordfs[now]:
                if W[ne] == -1:
                    W[ne] = nowW + 1
                    que.append(ne)
        return W
    N, X, Y = LI()
    V = [[]for _ in range(N)]
    for i in range(N-1):
        V[i].append(i+1)
        V[i+1].append(i)
    V[X-1].append(Y-1)
    V[Y-1].append(X-1)
    
    ans = [0]*(N-1)
    for i in range(N):
        L = bfs(N,i,V)
        for l in L:
            if l==0:
                continue
            ans[l-1] += 1
    for v in ans:
        print(v//2)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examD()

"""

"""

Solution (Python):
from heapq import heappush, heappop


def dijkstra(graph: list, n: int, v_s: int, INF: int = float('inf')) -> list:
    
    dist = [INF] * n

    dist[v_s] = 0
    heap = [(0, v_s)]  
    while heap:
        _, v_from = heappop(heap)
        for v_to in graph[v_from]:
            dist_cand = dist[v_from] + 1
            if dist_cand < dist[v_to]:
                dist[v_to] = dist_cand
                heappush(heap, (dist[v_to], v_to))
    return dist


n, x, y = map(int, input().split())
x -= 1
y -= 1
g = [[] for _ in range(n)]
for i in range(n):
    if i - 1 >= 0:
        g[i].append(i - 1)
    if i + 1 < n:
        g[i].append(i + 1)
g[x].append(y)
g[y].append(x)

d = [dijkstra(g, n, i) for i in range(n)]


ans = [0] * n
for i in range(n):
    for j in range(i + 1, n):
        ans[d[i][j]] += 1

for k in range(1, n):
    print(ans[k])

Solution (Python):
N,X,Y=map(int,input().split())

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

for k in range(1,N):
    print(ans[k])

Solution (Python):
n, x, y = map(int, input().split())

x -= 1
y -= 1

k = [0] * n

a = y - x
for i in range(n-1):
    for j in range(i+1, n):
        temp = j - i
        b = 1 + abs(x - i) + abs(y - j)
        k[min(temp, b)] += 1

for i in range(1, n):
    print(k[i])

Solution (Python):
import os
import sys

import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph._shortest_path import dijkstra

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


N, X, Y = list(map(int, sys.stdin.buffer.readline().split()))

V = [X - 1]
U = [Y - 1]
for i in range(N - 1):
    V.append(i)
    U.append(i + 1)

graph = csr_matrix(([1] * N, (V, U)), shape=(N, N))
dist = dijkstra(graph, directed=False).astype(int)
ans = np.bincount(dist.ravel(), minlength=N) // 2
print(*ans[1:], sep='\n')

Solution (Python):
from collections import deque
n, x, y = map(int, input().split())
G = [[] for _ in range(n)]
for i in range(n-1):
    G[i].append(i+1)
    G[i+1].append(i)
G[x-1].append(y-1)
G[y-1].append(x-1)
ans = [0]*n
for i in range(n):
    que = deque([i])
    dist = [-1]*n
    dist[i] = 0
    while que:
        v = que.popleft()
        for nv in G[v]:
            if dist[nv] == -1:
                dist[nv] = dist[v]+1
                que.append(nv)
    for i in range(n):
        ans[dist[i]]+=1
for i in range(n):
    ans[i]//=2
print(*ans[1:], sep = '\n')

Solution (Python):
n, x, y = map(int, input().split())

def dis(a, b):
    ret = abs(a - b)
    ret = min(ret, abs(a - x) + 1 + abs(b - y))
    ret = min(ret, abs(a - y) + 1 + abs(b - x))
    return ret

ans = [0] * (n-1)
for i in range(1, n+1):
    for j in range(i+1, n+1):
        ans[dis(i, j)-1] += 1

for x in ans:
    print(x)

Solution (Python):
n,x,y=map(int,input().split())
x-=1
y-=1
k=[0]*n
for i in range(n-1):
  for j in range(i+1,n):
    m=min(j-i,abs(i-x)+1+abs(y-j),abs(j-x)+1+abs(y-i))
    k[m]+=1
for i in range(1,n):print(k[i])

Solution (Python):
import sys
sys.setrecursionlimit(10000)

n, x, y = map(int, input().split())
adj = [[] for _ in range(n)]
for i in range(n-1):
	adj[i].append(i+1)
	adj[i+1].append(i)
adj[x-1].append(y-1)
adj[y-1].append(x-1)


def dfs(x, r):
	for v in adj[x]:
		if dist[r][v] > dist[r][x] + 1:
			dist[r][v] = dist[r][x] + 1
			dfs(v, r)
	return

dist = [[10000 for _ in range(n)] for _ in range(n)]
for i in range(n):
	dist[i][i] = 0
	dfs(i, i)

ans = [0 for _ in range(n)]
for i in range(n):
	for j in range(i+1, n):
		ans[dist[i][j]] += 1
print(*ans[1:], sep="\n")

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    n, x, y = LI()
    dist = [[inf] * n for i in range(n)]
    edg = [[] for i in range(n)]
    for i in range(1, n):
        edg[i].append(i - 1)
        edg[i - 1].append(i)
    edg[x - 1].append(y - 1)
    edg[y - 1].append(x - 1)
    for i in range(n):
        dist[i][i] = 0
        q = [(0, i)]
        while q:
            s, p = heappop(q)
            for e in edg[p]:
                if dist[i][e] > dist[i][p] + 1:
                    dist[i][e] = dist[i][p] + 1
                    heappush(q, (dist[i][e], e))
    ans = [0] * n
    for i in range(n):
        for j in range(n):
            if dist[i][j] != inf:
                ans[dist[i][j]] += 1
    for ai in ans[1:]:
        print(ai//2)
    
    return



if __name__ == '__main__':
    solve()

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline

    N, X, Y = map(int, input().split())
    L = Y-X+1
    ans = [0] * N
    for i in range(1, N):
        for j in range(i, N+1):
            d = min(j - i, abs(i-X) + abs(j-Y) + 1, abs(i-Y) + abs(j-X) + 1)
            ans[d] += 1
    for i in range(1, N):
        print(ans[i])


if __name__ == '__main__':
    main()

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

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


if __name__ == "__main__":
    solve()

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

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

for i in range(1, n):
    print(anss[i])

Solution (Python):
N, X, Y = map(int, input().split())
X -= 1
Y -= 1

def dist(a, b):
    return min(abs(b-a), abs(X-a) + 1 + abs(b-Y), abs(Y-a) + 1 + abs(b-X))

ANS = [0] * N
for i in range(N):
    for j in range(i):
        ANS[dist(i, j)] += 1

for a in ANS[1:]:
    print(a)