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):
from collections import deque,defaultdict

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

L= [[1]]+[[i-1,i+1] for i in range(1,N-1)]+ [[N-2]]
L[X-1].append(Y-1)
L[Y-1].append(X-1)

def BFS(x,L):
  d=[-1 for _ in range(N)] 
  d[x]=0
  v=deque([x])
  
  while len(v)>0:
    a=v.popleft()
    for num in L[a]:
      if d[num]==-1:
        d[num]=d[a]+1
        v.append(num)
  return d

ans=defaultdict(int)

for j in range(N):
  tmp=BFS(j,L)
  
  for num in tmp:
    ans[num] += 1
    
for k in range(1,N):
  if k in ans:
    print(ans[k]//2)
  else:
    print(0)

Solution (Python):
from collections import defaultdict


def main():
    N, X, Y = list(map(int, input().split(' ')))
    
    
    
    counter = defaultdict(int)
    for i in range(1, N + 1):
        for j in range(i + 1, N + 1):
            k = min([j - i, abs(i - X) + 1 + abs(j - Y)])
            counter[k] += 1
    for k in range(1, N):
        print(counter[k])


if __name__ == '__main__':
    main()

Solution (Python):
import itertools
import math
import numpy as np
import fractions
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
import sys
sys.setrecursionlimit(10**9)

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

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


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

    

if __name__ == "__main__":
  main()

Solution (Python):


n, x, y = map(int, input().split())
x, y = x - 1, y - 1

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

for i in range(1, len(cnt)):
    print(cnt[i])

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

def main():
    N, X, Y = map(int, input().split())
    dic = {key: 0 for key in range(1, N)}
    for i in range(1, N+1):
        for j in range(1, N+1):
            if(i < j):
                key = min(abs(j - i), abs(X - i)+1+abs(j - Y),
                      abs(Y - i) + 1 + abs(j - X))
                dic[key] += 1
    for ans in dic.values():
        print(ans)

if __name__ == "__main__":
    main()

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

def main():
    N, X, Y = map(int, input().split())
    dic = {key: 0 for key in range(1, N)}
    for i in range(1, N+1):
        for j in range(1, N+1):
            if(i < j):
                key = min(abs(j - i), abs(X - i)+1+abs(j - Y),
                      abs(Y - i) + 1 + abs(j - X))
                dic[key] += 1
    for ans in dic.values():
        print(ans)

if __name__ == "__main__":
    main()

Solution (Python):

N, X, Y = map(int, input().split())
dic = {key: 0 for key in range(1, N)}
for i in range(1, N+1):
    for j in range(1, N+1):
        if(i < j):
            key = min(abs(j - i), abs(X - i)+1+abs(j - Y),
                      abs(Y - i) + 1 + abs(j - X))
            dic[key] += 1
for ans in dic.values():
    print(ans)

Solution (Python):
n, x, y = map(int, input().split())
l = list(range(1,n+1))

k = [0]*(n-1)
for i in range(1,n+1):
    for j in range(i+1,n+1):
        if i < x:
            if j <= x:
                k[j-i-1] += 1
            else:
                k[min(j-i,abs(x-i)+abs(y-j)+1)-1] += 1
        elif i < y:
            k[min(j-i,abs(x-i)+abs(y-j)+1)-1] += 1
        else:
            k[j-i-1] += 1

for i in k:
    print(i)

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

D=[0]*(N-1)

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

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

D=[0]*(N-1)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6) 
import math
from copy import copy, deepcopy
from operator import itemgetter

from bisect import bisect_left, bisect, bisect_right

from collections import deque 



from collections import Counter

from itertools import accumulate

from heapq import heapify,heappop,heappush


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds










mod=10**4
def dk(edge,vis):
    q=[vis]
    visited=[False]*N
    heapify(q)
    while len(q):
        e=heappop(q)
        cd,ce=e//mod, e%mod
        
        if visited[ce]:
            continue
        
        visited[ce]=True
        if ce>vis:
            ans[cd]+=1
        for ne in edge[ce]:
            heappush(q,(cd+1)*mod+ne)



N, X, Y = map(int,input().split()) 
ans=[0]*(N)
edge = [[] for i in range(N)]
    
for i in range(N-1):
    x,y=i,i+1
    edge[x].append(y)
    edge[y].append(x)
edge[X-1].append(Y-1)
edge[Y-1].append(X-1)

for vis in range(N-1):
    dk(edge,vis)
    
for a in ans[1:]:
    print(a)

Solution (Python):
N, X, Y = [int(x) for x in input().split()]
A = [0]*N
for n in range(1,N+1):
  for m in range(n+1,N+1):
    
    A[min(m-n,abs(n-X)+1+abs(m-Y))]+=1
for n in range(1,N):
  print(A[n])

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

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

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

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

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

from collections import deque, defaultdict
INF = 10**9
d = defaultdict(int)
def bfs(n):
    reached = [INF] * N
    reached[n] = 0
    q = deque()
    q.append(n)
    while q:
        x = q.popleft()
        dx = [-1, 1]
        for i in dx:
            nx = x + i
            if nx < 0 or nx > N - 1 or reached[nx] != INF:
                continue
            reached[nx] = reached[x] + 1
            q.append(nx)
        if x == X and reached[Y] == INF:
            reached[Y] = reached[x] + 1
            q.append(Y)
        if x == Y and reached[X] == INF:
            reached[X] = reached[x] + 1
            q.append(X)
    for i in range(N):
        k = reached[i]
        d[k] += 1

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

Solution (Python):
N,X,Y=map(int,input().split())
ans=[0 for i in range(1,N)]

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

for i in ans:
    print(i)

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

for i in range(1,n):
	ans = 0
	for j in range(1,n-i+1):
		if i+j <= x:
			ans += 1
			continue
		elif j >= y and i+j < n:
			ans += 1
			continue
		else:
			
			
			
			if min(abs(x-j)+1+abs(y-i-j),i) == i:
				ans += 1
		num = i-(abs(x-j)+1)
		if num >= 0:
			d1 = y+num
			d2 = y-num
			if i+j < d1 and d1 <= n:
				ans += 1
			if i+j < d2 and d1 != d2:
				ans += 1
		
	print(ans)

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):
import sys
import numpy as np
from scipy.sparse import csr_matrix

from scipy.sparse.csgraph import dijkstra

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):
import sys
import numpy as np
from scipy.sparse import csr_matrix

from scipy.sparse.csgraph import dijkstra

input = sys.stdin.readline

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

A, B = [], []

for i in range(n-1):
    A.append(i)
    B.append(i+1)

A.append(x-1)
B.append(y-1)







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

Solution (Python):
import sys
import numpy as np
from scipy.sparse import csr_matrix

from scipy.sparse.csgraph import dijkstra

input = sys.stdin.readline

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

A, B, C = [], [], []

for i in range(n-1):
    A.append(i)
    B.append(i+1)
    C.append(1)

A.append(x-1)
B.append(y-1)
C.append(1)







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

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


counts = [0] * N
for i in range(1, N):
    for j in range(i+1, N+1):
        
        d1 = abs(j-i)
        
        d2 = abs(i-X) + abs(Y-j) + 1

        d = min(d1, d2)
        counts[d] += 1


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

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

Solution (Python):
"""
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)


inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""
from collections import deque
from collections import deque, defaultdict, Counter
import math
import sys
sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))



def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a




def round_up(a, b):
    """ a/b の切り上げ """
    c = (a + b - 1) / b
    return c


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def main():
    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):
            a = min(abs(x-i)+1+abs(j-y), abs(j-i))
            ans[a] += 1
    for i in range(1, len(ans)):
        print(ans[i])


if __name__ == '__main__':
    main()

Solution (Python):
"""
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)


inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""
from collections import deque
from collections import deque, defaultdict, Counter
import math
import sys
sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))



def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a




def round_up(a, b):
    """ a/b の切り上げ """
    c = (a + b - 1) / b
    return c


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def main():
    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)
    x -= 1
    y -= 1
    g[x].append(y)
    g[y].append(x)

    d = {}
    for i in range(n):
        d[i] = 0

    for i in range(n):
        q = deque()
        q.append(i)
        visit = [-1]*n
        visit[i] = 0
        while q:
            x = q.popleft()
            for nx in g[x]:
                if visit[nx] == -1:
                    visit[nx] = visit[x]+1
                    q.append(nx)
        for i in range(n):
            d[visit[i]] += 1
    
    for k in range(1, n):
        print(d[k]//2)


if __name__ == '__main__':
    main()

Solution (Python):
import itertools

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




















result = [0] * N

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

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

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):
        dist1=j-i
        dist2=abs(x-i)+abs(y-j)+1
        dist3=abs(y-i)+abs(x-j)+1
        d=min(dist1,dist2,dist3) 
        ans[d]+=1 
for i in range(1,n):
    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):
        mi = min([abs(j-i), (abs(x-i) +1 +abs(j-y)), abs(y-i) +1 +abs(j-x)])
        ans[mi] +=1
for a in range(1, len(ans)):
    print(ans[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):
        ans[min(j-i,abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x))-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
bypass = y - x
for i in range(n):
    for j in range(i + 1, n):
        far = min(j - i, abs(i - x) + 1 + abs(j - y))
        ans[far] += 1

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

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

cnt = [0]*(n-1)

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

for out in cnt:
  print(out)

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

distance_l = [0]*(n-1)

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

for val in distance_l:
    print(val)

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

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

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

Solution (Python):
n, a1, a2 = map(int, input().split(" "))
print(n)
wa = a2 - a1 + 1
l1 = a1 - 1
l2 = n - a2
hwa = wa // 2
pari = wa % 2

 
tmp = 0
for i in range(2, n):
    if l1 + l2 + 1 >= i:
        tmp += l1 + l2 - i + 2
    if i - 1 <= l1:
        tmp -= 1
    if i - 1 <= l2:
        tmp -= 1
    
    if hwa > i:
        tmp += wa
    elif hwa == i:
        if pari == 1:
        	tmp += wa
        else:
            tmp += hwa
    
    
    if i <= hwa + l1:
        
        tmp += min(hwa, l1, hwa + l1 - i + 1, i - 1) * 2
        if pari == 0 and hwa < i:
            tmp -= 1
            
        
    if i <= hwa + l2:
        
        tmp += min(hwa, l2, hwa + l2 - i + 1, i - 1) * 2
        if pari == 0 and hwa < i:
            tmp -= 1
            
        
    print(tmp)
    tmp = 0

Solution (Python):
n, a1, a2 = map(int, input().split(" "))
anscount = [0 for i in range(n + 1)]

for i in range(1, n):
    for j in range(i + 1, n + 1):
        anscount[min(abs(j - i), abs(i - a1) + abs(j - a2) + 1, abs(i - a2) + abs(j - a1) + 1)] += 1

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

Solution (Python):
from sys import stdin

n, x, y = [int(x) for x in stdin.readline().rstrip().split()]
dic = { x: 0 for x in range(1, n)}

for i in range(1, n):
    for j in range(i + 1, n + 1):
        if i >= y or j <= x:
            dis = j - i
        elif i <= x and j >= y:
            dis = j - y + x - i + 1
        elif i >= x and j <= y:
            dis = min(j - i, i + y - x + 1 - j)
        elif i >= x:
            dis = j - y + min(y - i, i - x + 1)
        else:
            dis = x - i + min(j - x, y + 1 - j)
        dic[dis] = dic[dis] + 1

for x in range(1, n):
    print(dic[x])

Solution (Python):
from sys import stdin

n, x, y = [int(x) for x in stdin.readline().rstrip().split()]
li = [0 for x in range(n - 1)]

for i in range(1, n):
    for j in range(i + 1, n + 1):
        if i >= y or j <= x:
            dis = j - i
        elif i <= x and j >= y:
            dis = j - y + x - i + 1
        elif i >= x and j <= y:
            dis = min(j - i, i + y - x + 1 - j)
        elif i >= x:
            dis = j - y + min(y - i, i - x + 1)
        else:
            dis = x - i + min(j - x, y + 1 - j)
        li[dis - 1] = li[dis - 1] + 1

for x in li:
    print(x)

Solution (Python):
N, X, Y = map(int, input().split())
l = [0] * (N-1)
for i in range(1, N):
    for j in range(i+1, N+1):
        s = j -i
        if 0 < i < Y:
            ss = abs(j - Y) + abs(X - i) + 1 
            l[min(s, ss)-1] += 1
        elif i >= Y:
            l[s-1] += 1
for i in range(N-1):
    print(l[i])

Solution (Python):
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce


def input(): return sys.stdin.readline().strip()


def INT(): return int(input())


def MAP(): return map(int, input().split())


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


def ZIP(n): return zip(*(MAP() for _ in range(n)))


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, X, Y = MAP()
    lis = [[0 for _ in range(N-1)]for _ in range(N-1)]
    ans = [0] * (N-1)

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

    for x in ans:
        print(x)


if __name__ == '__main__':
    main()

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

Solution (Python):
def main():
    import collections
    n,x,y = map(int,input().split(" "))
    dp = [[0]*n for i in range(n)]

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

    cnts = collections.Counter(dp_fl)

    for i in range(1,n):
        print(cnts.get(i,0))
main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    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+1,n):
            ans[min(j-i,abs(x-i)+1+abs(y-j),abs(x-j)+1+abs(y-i))]+=1
    for a in ans[1:]:
        print(a)


if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    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+1,n):
            ans[min(j-i,abs(x-i)+1+abs(y-j),abs(x-j)+1+abs(y-i))]+=1
    for a in ans[1:]:
        print(a)


if __name__=='__main__':
    main()

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


Ans = [0 for _ in range(N)]


for i in range(1, N): 
    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,x,y = map(int,raw_input().split(' '))

import collections
h = collections.Counter()
for i in range(1, n+1):
	for j in range(i+1, n+1):
		h[min(abs(j - i), abs(x - i) + 1 + abs(j - y), abs(y - i) + 1 + abs(j - x))] +=1
for distance in range(1, n):
	print h[distance]

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

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

Solution (Python):
from collections import Counter

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

X,Y = X-1, Y-1

lst = list(range(1,N+1))
d_lst = []
for left in range(0,N-1):
    for right in range(left+1,N):
        dis = min(right - left, abs(X-left) + abs(right-Y) +1)
        d_lst.append(dis)
c = Counter(d_lst)
            
for i in range(1,N):
    if i in c:
        print(c[i])
    else:
        print(0)

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

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


for i in count:
  print(i)

Solution (Python):
n,x,y = list(map(int, input().split()))
lst = [0 for i in range(n)]

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

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

Solution (Python):
n,x,y = list(map(int, input().split()))
lst = [0 for i in range(n)]

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

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

Solution (Python):
from collections import defaultdict
n,x,y=map(int,input().split())
d=defaultdict(lambda:0)
for i in range(1,n):
      for j in range(i+1,n+1):
            l=min(j-i,abs(j-x)+abs(i-y)+1,abs(i-x)+abs(j-y)+1)
            d[l]+=1
for i in range(1,n):
      print(d[i])

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

cnt = [0] * (n+1)

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

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

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

cnt = [0] * (n+1)

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

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

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

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

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

    answer = [0 for i in range(N+1)]

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

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


if __name__ == '__main__':
    main()

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

    answer = [0 for i in range(N+1)]

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

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


if __name__ == '__main__':
    main()

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

    answer = [0 for i in range(N+1)]

    for i in range(0, N):
        for j in range(i+1, N):
            
            if j <= X or Y <= i:
                answer[j-i] += 1
                continue
            
            if i == X and j == Y:
                answer [1] += 1
                continue
            
            if i < X and j < Y:
                answer[min(j-i, (X-i)+(Y-j)+1)] += 1
                continue
            
            if i > X and j > Y:
                answer[min(j-i, (j-Y)+(i-X)+1)] += 1
                continue
            
            if i < X and j == Y:
                answer[(X-i)+1] += 1
                continue
            
            if i == X and j > Y:
                answer[(j-Y)+1] += 1
                continue
            
            if i == X and j < Y:
                answer[min(j-i, 1+(Y-j))] += 1
                continue
            
            if i > X and j == Y:
                answer[min(j-i, 1+(i-X))] += 1
                continue
            
            if i < X and j > Y:
                answer[(X-i)+(j-Y)+1] += 1
                continue
            if i > X and j < Y:
                answer[min(j-i, (i-X)+(Y-j)+1)] += 1
                continue
            raise ValueError("error")

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


if __name__ == '__main__':
    main()

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

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

ans = [0]*N

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

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

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

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

Solution (Python):
N, X, Y = map(int,input().split())
l = [0]*(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),abs(Y-i)+1+abs(X-j))
        l[d-1] += 1
for k in range(N-1):
    print(l[k])

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

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

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

for i in count:
    print(i)