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(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'

def main():
    N,X,Y=mis()
    ans = [0] * N
    for d in range(1, N):
        for l in range(1, N):
            r = l + d
            if r > N:
                break
            dist = min(abs(l-r), abs(l-X)+1+abs(Y-r))
            ans[dist] += 1
    for d in range(1, N):
        print(ans[d])



main()

Solution (Python):
from collections import defaultdict

import heapq
import sys

input = sys.stdin.readline

def main():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    d = [[float("inf")]*N for i in range(N)]
    for i in range(N-1):
        d[i][i+1] = 1
        d[i+1][i] = 1

    d[X][Y] = 1
    d[Y][X] = 1
    e = defaultdict(int)
    for i in range(N):
        for j in range(i,N):
            if i == j:
                continue
            tmp = min(j - i, abs(X-i) + 1 + abs(Y-j))
            e[tmp] += 1
    for i in range(1,N):
        print(e[i])






if __name__ == "__main__":
    main()

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

ans = [0] * (N - 1)

for i in range(N - 1):
    vst = [False] * N
    q = [(i, 0)]
    vst[i] = True
    for u, c in q:
        if i < u: ans[c - 1] += 1
        next = [u + 1, u - 1]
        if u == X - 1:
            next.append(Y - 1)
        if u == Y - 1:
            next.append(X - 1)

        for v in next:
            if 0 <= v < N and not vst[v]:
                q.append((v, c + 1))
                vst[v] = True

print(*ans, sep='\n')

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

def solve(N, X, Y):
    INF = N + N
    X -= 1
    Y -= 1
    e = [[INF for j in range(N)] for i in range(N)]
    for i in range(N-1):
        e[i][i+1] = 1
        e[i+1][i] = 1
    e[X][Y] = 1
    e[Y][X] = 1

    c = [0 for i in range(N)]

    for i in range(N):
        for j in range(i+1, N):
            if j <= X or Y <= i:
                e[i][j] = j - i
            else:
                e[i][j] = min(abs(j-i), abs(X-i) + 1 + abs(Y-j))
    
    for i in range(N):
        for j in range(i+1, N):
            if e[i][j] < INF:
                c[e[i][j]] += 1

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

if __name__ == '__main__':
    inputs = read()
    solve(*inputs)

Solution (Python):
def LI():
	return [ int(s) for s in input().split() ]

N,X,Y = LI()
dist = [0]*(N-1)

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

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

li = [0 for k in range(N)]
for i in range(1,N+1):
    for j in range(i+1,N+1):
        if i <= X:
            if j <= X:
                li[j-i] += 1
            elif j < Y:
                d_to_x = min(j - X, Y - j + 1)
                li[X - i + d_to_x] += 1
            else:
                li[(X - i) + (j - Y) + 1] += 1
        elif i < Y:
            if j < Y:
                li[min(j - i, (i - X) + (Y - j) + 1)] += 1
            else:
                d_to_y = min(Y - i, i - X + 1)
                li[j - Y + d_to_y] += 1
        else:
            li[j - i] += 1
for i in range(1,N):
    print(li[i])

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

d = dict(zip(range(1, N), [0]*(N-1)))
for i in range(1, N):
  for j in range(i+1, N+1):
    l1 = j - i
    l2 = abs(X - i) + 1 + abs(Y - j)
    l = min(l1, l2)
    d[l] += 1

for k in d:
  print(d[k])

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

def distance(i, j):
    d1 = abs(j-i)
    d2 = abs(i-X)+abs(j-Y)+1
    d3 = abs(i-Y)+abs(j-X)+1
    return min(d1, d2, d3)

ret = [0]*(N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        ret[distance(i,j)-1] += 1

for val in ret:
    print(val)

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

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

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

cnt=[0 for i in range(n)]

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

Solution (Python):

import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    
    N,X,Y = LMIIS()
    X -= 1
    Y -= 1
    dp =[[0]*N for _ in range(N)]
    for i in range(N):
        for j in range(i+1,N):
            if i <= X < Y <= j:
                dp[i][j] = j - i  - (Y - X) + 1
            elif  i <= X and j <= Y:
                dp[i][j] = min(j-i, Y-j+1+X-i)
            elif X <= i and j <= Y:
                dp[i][j] = min(j-i,Y-j+1+i-X)
            elif X <= i and Y <= j:
                dp[i][j] = min(j-i,j-Y+1+i-X)

            else:
                dp[i][j] = j - i
    num_length = [0] * N
    for i in range(N):
        for j in range(i+1,N):
            num_length[dp[i][j]] += 1
    
    for i in range(1,N):
        print(num_length[i])
    


if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter

n,x,y = map(int,input().split())
x -= 1
y -= 1
r = y - x + 1
ans = []

for i in range(n):
    for j in range(i+1,n):
        if (x<i and i<y) and (x<j and j<y):
            ans.append(min(j-i , r - (j-i)))
        elif (i <= x) and (x<j and j<y):
            ans.append(min(j-x , r - (j-x)) + (x-i))
        elif (i <= x) and (j <= x):
            ans.append(j-i)
        elif (i <= x) and (y <= j):
            ans.append(j-i- (y-x) + 1)
        elif (y <= j) and (x<i and i<y):
            ans.append(min(y-i , r - (y-i)) + (j-y))
        elif (x <= j) and (y <= i):
            ans.append(j-i)
            
aa = Counter(ans)

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

Solution (Python):
import sys
from collections import deque
readline = sys.stdin.readline

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

a = [[1e9] * N for i in range(N)]

def test(n):
    b = [1e9] * N
    q = deque()

    q.append((n, 0))
    while len(q) > 0:
        n, d = q.popleft()
        if b[n] == 1e9:
            b[n] = d
            if n - 1 >= 0:
                q.append((n - 1, d + 1))
            
            if n + 1 < N:
                q.append((n + 1, d + 1))
            
            if n == X:
                q.append((Y, d + 1))
            elif n == Y:
                q.append((X, d + 1))
    
    return b

for n in range(N):
    a[n] = test(n)

ans = [0] * (N - 1)
for i in range(N):
    for j in range(i + 1, N):
        ans[int(a[i][j] - 1)] += 1

for x in ans:
    print(x)

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

Solution (Python):
n, l, r = map(int, input().split())

l -= 1
r -= 1

dist = [0] * 10000000

for a in range(n):
    for b in range(a+1, n):
        
        c = 9999999999
        c = min(c, b - a)
        
        c = min(c, abs( abs(l - a) + abs(r - b) ) + 1 )
        dist[c] += 1
for k in range(1, n):
    print(dist[k])

Solution (Python):
N,x,y=map(int,input().split())
dp=[[abs(i-k) for k in range(N)]for i in range(N)]
dp[x-1][y-1]=1
dp[y-1][x-1]=1
for k in [x-1,y-1]:
    for i in range(N):
        for j in range(N):
            dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j],abs(i-j))

cnt={}
for k in range(N):
    for i in range(N):
        if dp[k][i] in cnt:
            cnt[dp[k][i]]+=1
        else:
            cnt[dp[k][i]]=1

for i in range(1,N):
    try :
        print(cnt[i]//2)
    except:
        print(0)

Solution (Python):
def D():
    N, X, Y = map(int, input().split())
    dist = {i: 0 for i in range(1,N)}
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            distance = min(j-i, abs(i-X)+abs(j-Y)+1)
            
            dist[distance] += 1
    for i in dist:
        print(dist[i])
D()

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

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

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

for i in A:
    print(i)

Solution (Python):

N,X,Y = list(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):
            a = min(j-i,abs(X-i)+abs(Y-j)+1,abs(X-j)+abs(Y-i)+1)
            ans[a]+=1
            

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

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

ans=[]
for i in range(N-1):
    ans.append(N-1-i)


K=[0]*(N)
for i in range(1,N):
    for j in range(i+1,N+1):
        a=j-i
        b=abs(i-X)+1+abs(j-Y)
        c=abs(i-Y)+1+abs(j-X)
        val=min(a,b,c)
        K[val]+=1
for i in range(len(K)):
    if i==0:
        continue
    print(K[i])

Solution (Python):
N,X,Y = map(int,input().split())
X,Y = X-1,Y-1
for k in range(1,N):
    res = 0
    for n in range(N):
        r = k-abs(Y-n)-1
        for x in {n-k, X-r, X+r}:
            if 0 <= x < n and min(n-x, abs(Y-n)+1+abs(X-x)) == k:
                res += 1
    print(res)

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

ans = [0 for i in range(N)]

def dist(i,j):
  
  r1 = abs(i-j)
  
  r2 = abs(i-X) + 1 + abs(j-Y)
  
  r3 = abs(i-Y) + 1 + abs(j-X)
  return(min(r1,r2,r3))

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

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

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



dis_list = [0 for k in range(N-1)]
for i in range(N-1):
    for j in range(i+1,N):
        simple_dis = j-i
        shortcut_dis = abs(X-i-1)+1+abs(Y-1-j)
        dis = min(simple_dis,shortcut_dis)
        dis_list[dis-1]+=1
for d in dis_list:
    print(d)

Solution (Python):
import heapq

def djsktra(node,edges,dist):
    heap = []
    heapq.heappush(heap,(0,node))
    visited = set()
    while heap:
        curr = heapq.heappop(heap)
        d,node = curr[0],curr[1]
        if node not in visited:
            visited.add(node)
            dist[d] += 1
            for kid in edges[node]:
                heapq.heappush(heap,(d+1,kid))

def main():
    n,x,y = map(int,input().split())
    edges = {}
    for i in range(1,n):
        if i not in edges.keys():
            edges[i] = []

        if i+1 not in edges.keys():
            edges[i+1] = []
            
        edges[i].append(i+1)
        edges[i+1].append(i)
        
    edges[x].append(y)
    edges[y].append(x)
    dist = [0]*n
    for i in range(1,n+1):
        djsktra(i,edges,dist)

    dist.pop(0)
    for i in dist:
        print(i//2)

main()

Solution (Python):
def main():
    n,x,y=map(int,input().split())
    cnt=[0]*(n-1)
    for i in range(n-1):
        for j in range(i+1,n):
            res=min(j-i,abs(x-1-i)+abs(y-1-j)+1)
            if res>0 and res<n:
                cnt[res-1]+=1
    for i in range(n-1):
        print(cnt[i])
if __name__=="__main__":
    main()

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

d_dict = [0] * N

for i in range(1, N + 1):
  for j in range(i + 1, N + 1):
    d = j - i
    if X < j  and i < Y:
      d = min(d, abs(i-X) + abs(j-Y) + 1)
    
    d_dict[d] += 1

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

Solution (Python):


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

mid = (X + Y + 1) * 0.5



ans = [0] * N

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

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

Solution (Python):
from collections import deque, Counter


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

edge = [[] for _ in range(N)]
for i in range(1, N - 1):
    edge[i].append(i + 1)
    edge[i].append(i - 1)
edge[0].append(1)
edge[N - 1].append(N - 2)
edge[X - 1].append(Y - 1)
edge[Y - 1].append(X - 1)


C = Counter()
for i in range(N):
    path = [float('inf')] * N
    path[i] = 0
    q = deque()
    q.append((i, 0))
    while q:
        p, step = q.popleft()
        for np in edge[p]:
            if path[np] > step + 1:
                q.append((np, step + 1))
                path[np] = step + 1
    for j in range(i + 1, N):
        C[path[j]] += 1

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

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

R = [0 for _ in range(N - 1)]

for i in range(N - 1):
    for j in range(i + 1, N):
        res = j - i
        if i <= X <= j <= Y:
            res = min(res, Y - j + X - i + 1)
        if X <= i <= Y <= j:
            res = min(res, i - X + j - Y + 1)
        if i <= X and Y <= j:
            res = min(res, j - Y + X - i + 1)
        if X <= i <= j <= Y:
            res = min(res, i - X + Y - j + 1)
        R[res - 1] += 1
for r in R:
    print(r)

Solution (Python):
n, x, y = map(int, input().split())
x -= 1; y -= 1
cnt = [0] * (n-1)

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

print(*cnt, sep="\n")

Solution (Python):
from scipy.sparse.csgraph import dijkstra
import numpy as np
N, X, Y = map(int, input().split())
X -= 1
Y -= 1

g = np.zeros((N, N), dtype=int)
a = np.arange(N - 1)
np.add.at(g, (a, a + 1), 1)
np.add.at(g, (a + 1, a), 1)
np.add.at(g, (X, Y), 1)
np.add.at(g, (Y, X), 1)
fw = dijkstra(g, directed=False)
fw = (fw + 0.5).astype(int)
fw = np.tril(fw).ravel()
fw = fw[fw > 0]

cnt = np.bincount(fw).tolist()
ans = [0] * (N - 1)
for i, c in enumerate(cnt[1:]):
    ans[i] = c

print(*ans, sep="\n")

Solution (Python):
import itertools
N,X,Y = map(int, input().strip().split())
ans_dict = {k:0 for k in range(1, N)}
for i,j in itertools.combinations(range(1, N+1), 2):
  if i > j: i, j = j, i
  
  if i < X and j <= X:  
    ans_dict[j-i] += 1
  elif Y <= i and Y < j:  
    ans_dict[j-i] += 1
  elif i <= X and Y <= j:  
    ans_dict[(X-i)+(j-Y)+1] += 1
  elif X <= i <= Y and X <= j <= Y:  
    
    d = min(j-i, (i-X)+(Y-j)+1)
    ans_dict[d] += 1
  elif i <= X and X <= j <= Y:  
    d = min(j-i, (X-i)+(Y-j)+1)
    ans_dict[d] += 1
  elif X <= i <= Y and Y <= j:  
    d = min(j-i, (i-X)+(j-Y)+1)
    ans_dict[d] += 1

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

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

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

ans_list=[0]*N
for i in range(N-1):
  for j in range(i+1,N):
    p1=j-i
    p2=abs(X-1-i)+1+abs(Y-1-j)
    p=min(p1,p2)
    
    ans_list[p]+=1
  

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

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
n,x,y=map(int,input().split())
x-=1
y-=1
Ans=[0]*(n-1)
for i in range(n):
  for j in range(i+1,n):
    d=j-i
    if i<=x<=j<=y:
      d=min(d,x-i+y-j+1)
    if i<=x<=y<=j:
      d=min(d,x-i+j-y+1)
    if x<=i<=j<=y:
      d=min(d,i-x+y-j+1)
    if x<=i<=y<=j:
      d=min(d,i-x+j-y+1)
    Ans[d-1]+=1
for a in Ans:
  print(a)

Solution (Python):
import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N, X, Y = [int(x) for x in input().split()]

    ans = [0] * N
    for i in range(1, N + 1):
        s = collections.deque()
        s.append([i, 0])
        v = set()
        v.add(i)
        while s:
            c = s.popleft()
            ans[c[1]] += 1

            if c[0] == X:
                if Y not in v:
                    s.append([Y, c[1] + 1])
                    v.add(Y)
            if c[0] == Y:
                if X not in v:
                    s.append([X, c[1] + 1])
                    v.add(X)

            if c[0] != 1:
                if c[0] - 1 not in v:
                    s.append([c[0] - 1, c[1] + 1])
                    v.add(c[0] - 1)

            if c[0] != N:
                if c[0] + 1 not in v:
                    s.append([c[0] + 1, c[1] + 1])
                    v.add(c[0] + 1)

    for a in ans[1:]:
        print(a // 2)


if __name__ == '__main__':
    main()

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

l=[0 for i in range(n-1)]
for i in range(1,n):
    for j in range(i+1,n+1):
        if x>j and x>i:
            l[j-i-1]+=1
        elif y>j>=x and x>i:
            l[min(j-i,y-j+x-i+1)-1]+=1
        elif j>=y and x>i:
            l[j-y+x-i+1-1]+=1
        elif y>j>=x and y>i>=x:
            l[min(j-i,y-j+i-x+1)-1]+=1
        elif j>=y and y>i>=x:
            l[min(j-i,j-y+i-x+1)-1]+=1
        elif j>=y and i>=y:
            l[j-i-1]+=1

for i in l:
    print(i)

Solution (Python):
from itertools import combinations
N,X,Y=(int(x) for x in input().split())
result={x:0 for x in range(1,N)}
for i in combinations(range(1,N+1),2):
	result[min(abs(i[0]-X)+abs(i[1]-Y)+1,i[1]-i[0])] += 1
for i in range(1,N):
  print(result[i])

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

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

Solution (Python):
from collections import Counter
from itertools import combinations

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

C = Counter(min(j - i, abs(X - 1 - i) + 1 + abs(Y - 1 - j)) for i, j in combinations(range(N), 2))

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

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def bfs(nodes, src):
    """ BFS(一般グラフ、重みなし) """
    from collections import deque

    N = len(nodes)
    que = deque([(src, 0)])
    dist = [INF] * N
    while que:
        u, c = que.popleft()
        if dist[u] != INF:
            continue
        dist[u] = c
        for v in nodes[u]:
            que.append((v, c+1))
    return dist

N, x, y = MAP()
x -= 1; y -= 1

nodes = [[] for i in range(N)]
for i in range(N-1):
    nodes[i].append(i+1)
    nodes[i+1].append(i)
nodes[x].append(y)
nodes[y].append(x)

distx = bfs(nodes, x)
disty = bfs(nodes, y)

G = list2d(N, N, 0)
for i in range(N):
    for j in range(i+1, N):
        G[i][j] = min(j - i, distx[i] + disty[j] + 1, distx[j] + disty[i] + 1)
ans = [0] * N
for i in range(N):
    for j in range(i+1, N):
        ans[G[i][j]] += 1
[print(a) for a in ans[1:]]

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

Solution (Python):
from collections import deque

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

for i in range(1, n):
    adj[i].append(i + 1)
    adj[i + 1].append(i)

adj[x].append(y)
adj[y].append(x)

def bfs(root):
    visited = [0] * (n + 1)
    q = deque([root])

    while q:
        x = q.popleft()
        for y in adj[x]:
            if visited[y] == 0:
                visited[y] = visited[x] + 1
                q.append(y)
    
    return visited

result = [0] * (n + 1)

for i in range(1, n + 1):
    data = bfs(i)
    for j in range(i + 1, n + 1):
        result[data[j]] += 1

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

Solution (Python):
from collections import Counter,deque
def bfs(G,s,N):
    dist=[-1]*(N+1)
    d=deque()
    dist[s]=0
    d.append(s)
    while(len(d)!=0):
        v=d[0]
        d.popleft()
        for nv in G[v]:
            if(dist[nv]!=-1):
                continue
            
            dist[nv]=dist[v]+1
            d.append(nv)
            
    return dist

N,X,Y=map(int,input().split())
G=[[] for i in range(N+1)]
for i in range(1,N):
    G[i].append(i+1)
    G[i+1].append(i)
G[X].append(Y);G[Y].append(X)
Count=[0]*(N+1)
for i in range(1,N+1):
    li=bfs(G,i,N)
    c=Counter(li)
    for i in range(1,N+1):
        Count[i]+=c[i]
for i in range(1,N):
    print(Count[i]//2)

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

ans = [0 for _ in range(n - 1)]
for i in range(1, n):
    for j in range(i + 1, n + 1):
        d = min(j - i, abs(x - i) + 1 + abs(y - j))
        ans[d - 1] += 1
print('\n'.join(map(str, ans)))

Solution (Python):
n, x, y = map(int, input().split())
c = [0 for _ in range(1, n)]
for i in range(1, n+1):
  for j in range(1, n+1):
    if i <= j:
      continue
    a = i - j
    b = abs(j - x)+1+abs(i - y)
    if a < b:
      c[a-1] += 1
    else:
      c[b-1] += 1
for e in c:
  print(e)

Solution (Python):
i=list(map(int, input().split()))
n=i[0]
x=i[1]-1
y=i[2]-1
l=[0]*n
for j in range (0,n-1):
    for k in range (j+1,n):
        s=abs(k-y)+abs(x-j)+1
        if s>k-j:
            s=k-j
        l[s]=l[s]+1

for z in range (1,n):
    print(l[z])

Solution (Python):
from collections import *
from heapq import *
from itertools import *
from fractions import gcd
import sys
from decimal import *
import copy
from bisect import *
input=lambda :sys.stdin.readline().rstrip()


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


dic=defaultdict(int)
for n in range(1,N+1):
    stack=deque([[n,0]])
    visited=set()
    while stack:
        
        a,m=stack.popleft()
        for p in data[a]:
            if not p in visited:
                visited.add(p)
                stack.append([p,m+1])
                if p>n:
                    dic[m+1]+=1


lst=[]
for i in range(N-1):
    print(dic[i+1])

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









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


k = [0 for _ in range(n)]
for i in graf:
    for j in i:
        k[j] += 1

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

Solution (Python):
n, x, y = [int(c) for c in input().split()]

d = {i : 0 for i in range(1,n)}
for i in range(1,n+1):
    for i2 in range(i+1, n+1):
        dist = min(i2 - i, abs(x-i) + 1 + abs(y-i2))
        d[dist] += 1
for v in d.values():
    print(v)

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, X, Y):
    ans = 0


    c = Counter()
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            a = j - i
            b = abs(i-X) + 1 + abs(j-Y)
            c[min(a, b)] += 1


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


    return ans


def main():
    N, X, Y = read_int_n()
    (slv(N, X, Y))

    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter
N, X, Y = map(int, input().split())
ans = Counter()
for i in range(1, N):
    for j in range(i+1, N+1):
        cost = min([j-i, abs(X-i)+abs(Y-j)+1, abs(Y-i)+abs(X-j)+1])
        ans[cost] += 1
for k in range(1, N):
    
    print(ans[k])

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

N, X, Y = map(int, input().split())
X -= 1
Y -= 1
dist= [0] * N 
check = [[] for _ in range(N)]
for i in range(N - 1):
    for j in range(i + 1, N):
        if j <= X or Y <= i:
            dist[j - i] += 1
            check[j - i].append((i, j))
        elif i <= X and Y <= j:
            d = (X - i) + 1 + (j - Y)
            dist[d] += 1
            check[d].append((i, j))
        elif X <= i and j <= Y:
            d = min(j - i, (i - X) + 1 + (Y - j))
            dist[d] += 1
            check[d].append((i, j))
        elif i <= X and X <= j and j <= Y:
            d = min(j - i, (X - i) + 1 + (Y - j))
            dist[d] += 1
            check[d].append((i, j))
        elif X <= i and i <= Y and Y <= j:
            d = min(j - i, (i - X) + 1 + (j - Y))
            dist[d] += 1
            check[d].append((i, j))



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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
import heapq
n,x,y = map(int,input().split())
G = [[]*n for i in range(n)]
for i in range(n-1):
  G[i].append((i+1))
  G[i+1].append(i)
x-=1;y-=1
G[x].append((y))
G[y].append((x))

def bfs(g,s):
    n=len(g)
    dist = [inf]*n
    dist[s] = 0
    q = collections.deque()
    q.append(s)
    while q:
        u = q.popleft()
        for v in g[u]:
            if dist[v] != inf:continue
            dist[v] = dist[u] + 1
            q.append(v)
    return dist
D = [0]*n
for i in range(n-1):
  dist = bfs(G,i)
  for j in range(i+1,n):
    D[dist[j]] += 1
for i in range(1,n):
  print(D[i])

Solution (Python):
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):
        if i <= x and j >= y:
            ans[x-i+j-y] += 1
        else:
            if i < x and j < y:
                temp = min(j-i, x-i+1+y-j)
                ans[temp-1] += 1
            elif i > x and j > y:
                temp = min(j-i, i-x+1+j-y)
                ans[temp-1] += 1
            else:
                temp = min(j-i, i-x+1+y-j)
                ans[temp-1] += 1
for i in range(n-1):
    print(ans[i])

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

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

from collections import Counter
c = Counter(temp)

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

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


if __name__ == '__main__':
    resolve()