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 sys import stdin


def main():
    N, X, Y = [int(x) for x in stdin.readline().rstrip().split()]
    result = [0] * (N - 1)
    for left in range(1, N):
        for right in range(left + 1, N + 1):
            if (left <= X) and (Y <= right):
                x = (X - left) + 1 + (right - Y)
            elif (left <= X) and (X <= right <= Y):
                x = (X - left) + min((right - X), (Y - right) + 1)
            elif (X <= left <= Y) and (Y <= right):
                x = min((Y - left), (left - X) + 1) + (right - Y)
            elif (X <= left <= Y) and (X <= right <= Y):
                x = min((right - left), (left - X) + (Y - right) + 1)
            else:
                x = right - left
            result[x - 1] += 1
    print(*result, sep='\n')


if __name__ == "__main__":
    main()

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

for el in result:
    print(el)

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

dist = [0] * (n + 1)
dist[0] = -1

for i in range(1, n + 1):
    if y == i:
        dist[i] = dist[x] + 1
    else:
        dist[i] = dist[i - 1] + 1

for i in range(y - 1, x - 1, -1):
    dist[i] = min(dist[i], dist[y] + (y - i))

cnt = [0] * (n + 1)

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

for i in range(1, n):
    print(cnt[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):
        
        '''
        1 2,1 3,1 4
        2 3,2 4
        3 4
        '''
        if i<=x and j>=y:
            dis = min(j-i,x-i +1+ j-y)
            l[dis-1] += 1
            
        elif i>=x and j<=y:
            dis = min(j-i,i-x+y-j+1)
            l[dis-1] += 1
        elif i<=x and x<=j<=y:
            dis = min(j-i,x-i+y-j+1)
            l[dis-1] += 1
        elif x<=i<=y and j>=y:
            dis = min(j-i,i-x+j-y+1)
            l[dis-1] += 1
        elif i<=x and j<=x:
            dis = j-i
            l[dis-1] += 1
        elif i>=y and j>=y:
            dis = j-i
            l[dis-1] += 1
for kkk in l:
    print(kkk)

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

M = [[N] * N for _ in range(N)]


for j in range(N):
    if j > X:
        M[j][j-1] = 1
        for k in range(j-1, X-1, -1):
            M[j][k] = min(M[j][k], M[j][k+1] + 1)
        M[j][Y] = M[j][X] + 1
        for k in range(Y-1, X, -1):
            M[j][k] = min(M[j][k], M[j][k+1] + 1)

    for i in range(j+1, N):

        if j == X:
            M[j][Y] = 1
            for m in range(Y-1, X, -1):
                M[j][m] = min(M[j][m], M[j][m+1] + 1)
        if i - j == 1:
            M[j][i] = 1
        M[j][i] = min(M[j][i], M[j][i-1] + 1)
        if i == X:
            M[j][Y] = M[j][i] + 1
            for m in range(Y-1, X, -1):
                M[j][m] = min(M[j][m], M[j][m+1] + 1)

ans = [0] * N

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

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

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

  dist_count = [0 for _ in range(n)]

  x -= 1
  y -= 1
  for i in range(n):
    for j in range(i + 1, n):
      min_dist = min(abs(i - j), min(abs(i - x) + 1 + abs(y - j), abs(i - y) + 1 + abs(x - j)))
      dist_count[min_dist] += 1
  
  dist_count.pop(0)
  for dist in dist_count:
    print(dist)

if __name__ == "__main__":
  solve()

Solution (Python):
from sys import stdin

N, X, Y = map(int, stdin.readline().split())
k = [0] * N

X -= 1
Y -= 1
for start in range(N - 1):
    for end in range(start + 1, N):

        if start < X:
            if end <= X:
                distance = end - start
                k[distance] += 1
            elif X < end < Y:
                if end <= (X + Y) / 2:
                    distance = end - start
                    k[distance] += 1
                else:
                    distance = (X - start) + 1 + (Y - end)
                    k[distance] += 1
            else:
                distance = (X - start) + 1 + (end - Y)
                k[distance] += 1

        elif X <= start < Y:
            if end < Y:
                tmp = (start - X) + 1 + (Y - end)
                distance = min(end - start, tmp)
                k[distance] += 1
            else:
                tmp = (start - X) + 1 + (end - Y)
                distance = min(end - start, tmp)
                k[distance] += 1

        else:
            distance = end - start
            k[distance] += 1

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

Solution (Python):





def solv(N, X, Y):
    ans = list(range(N, 0, -1))
    X = X - 1
    Y = Y - 1
    NN = N
    while X >= 0:
        
        
        x = X + 1
        y = Y
        while y < NN:
            
            ans[x] += 1
            ans[y] -= 1
            x += 1
            y += 1
        
        y = Y-1
        x = X+2
        while x < y:
            
            ans[x] += 1
            ans[y] -= 1
            x += 1
            y -= 1
        X -= 1
        Y -= 1
        NN -= 1

    X = 1
    while X < Y:
        
        
        x = X + 1
        y = Y
        while y < NN:
            
            ans[x] += 1
            ans[y] -= 1
            x += 1
            y += 1
        
        y = Y-1
        x = X+2
        while x < y:
            
            ans[x] += 1
            ans[y] -= 1
            x += 1
            y -= 1
        X += 1
        Y -= 1
        NN -= 1

    return ans


if __name__ == "__main__":

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

    print("\n".join(map(str, ans[1:])))

Solution (Python):
n,x,y=map(int,input().split())
ans=[int(0)]*n

for i in range(1,n):
  for j in range(i+1,n+1):
    a=j-i
    if i<=x:
      if j>=y:
        a=a-(y-x-1)
      else:
        b=y-j+1+x-i
        a=min(a,b)
    else:
      if j>=y:
        b=i-x+1+j-y
        a=min(a,b)
      else:
        b=i-x+1+y-j
        a=min(a,b)
    ans[a-1]=ans[a-1]+1

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

Solution (Python):
N, X, Y = map(int, input().split())
from itertools import combinations

ans = {i+1:0 for i in range(N)}
for a, b in combinations(range(1, N+1), 2):
    t = b - a
    if a <= X:
        t = min(t, X - a + 1 + abs(Y - b))
    elif a <= Y:
        t = min(t, abs(a - X) + 1 + abs(Y - b))
    ans[t] += 1

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

Solution (Python):
from collections import defaultdict
N, X, Y = map(int, input().split())
d = [[0 for _ in range(N)] for _ in range(N)]
for i in range(N-1):
    for j in range(i+1, N):
        d[i][j] = d[i][j-1] + 1
X -= 1
Y -= 1
for i in range(N-1):
    for j in range(i + 1, N):
        diff = abs(X - i) + abs(Y - j) + 1
        if diff < d[i][j]:
            d[i][j] = diff

ans = defaultdict(int)
for i in range(N-1):
    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())

dis = [0]*n

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

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

Solution (Python):
N, X, Y = map(int, input().split())
dist = [0]*N
for i in range(N):
    for k in range(i+1,N):
        if i == X - 1 and k == Y - 1:
            dist[1] += 1
            continue
        if X - 1 <= k <= Y - 1 and i <= X - 1:
            tmp = min(k-i,(X-1)-i+1+(Y-1-k))
            dist[tmp] += 1
            continue
        if X - 1 < i < Y - 1 and k >= Y - 1:
            tmp = min(k-i,i-(X-1)+1+k-(Y-1))
            dist[tmp] += 1
            continue
        if X - 1 <= k <= Y - 1 and X - 1 <= i <= Y - 1:
            tmp = min(k-i,i-(X-1)+1+(Y-1-k))
            dist[tmp] += 1
            continue
        if i <= X - 1 and k >= Y - 1:
            dist[k-i-(Y-X-1)] += 1
            continue
        dist[k-i] += 1
for i in range(1,N):
    print(dist[i])

Solution (Python):
n, x, y = map(int, input().split())
x = x-1
y = y-1
from collections import deque
que = deque()

INF = 10**5
seen = [[INF] * n for _ in range(n)]

for i in range(n):
    que.append(i)
    seen[i][i] = 0
    
    while len(que) > 0:
        t = que.popleft()
        step = [t-1, t+1]
        if t == x:
            step.append(y)
        if t == y:
            step.append(x)
        for ti in step:
            
            if ti < 0 or ti >= n:
                continue
            if seen[i][ti] == INF:
                que.append(ti)
            seen[i][ti] = min(seen[i][t] + 1, seen[i][ti])
    


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

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

Solution (Python):
N,X,Y=map(int,input().split())
cost=[[] for _ in range(N)]

for i in range(N-1):
  cost[i].append(i+1)
for j in range(1,N):
  cost[j].append(j-1)

cost[X-1].append(Y-1)
cost[Y-1].append(X-1)


def bfs(v):
    d=[-1]*N
    d[v]=0
    q=[v]
    c=1
    while q:
        q1=[]
        for i in q:
            for j in cost[i]:
                if d[j]==-1:
                    d[j]=c
                    q1.append(j)
        q=q1
        c+=1
        
    return d

d=dict()
for m in range(N):
  tmp=bfs(m)
  
  for num in tmp:
    if num not in d:
      d[num]=1
    else:
      d[num] += 1


for z in range(1,N):
  if z in d:
    print(d[z]//2)
  else:
    print(0)

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

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

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

import heapq

def dijkstra_heap(s):
    d = [float("inf")] * n
    used = [True] * n
    d[s] = 0
    used[s] = False
    edgelist = []
    for e in es[s]:
        heapq.heappush(edgelist,e)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        d[v] = minedge[0]
        used[v] = False
        for e in es[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[e[0]+d[v],e[1]])
    return d

from collections import defaultdict, Counter
from copy import deepcopy
dist=dijkstra_heap(0)
distx=dijkstra_heap(x-1)
disty=dijkstra_heap(y-1)
counts=[]
for i in range(n-1):
    if i<x-1:
        tmp=[d-i for d in dist[i:]]
        counts.append(Counter(tmp))
    elif x-1<=i<y-1:
        tmp=[min(distx[i]+distx[d], disty[i]+disty[d], abs(d-i)) for d in range(i,n)]
        counts.append(Counter(tmp))
    else:
        tmp=[disty[d]-disty[i] for d in range(i,n)]
        counts.append(Counter(tmp))
ans=defaultdict(int)

for i in range(n-1):
    keys=counts[i].keys()
    for kk in keys:
        ans[kk]+=counts[i][kk]

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

Solution (Python):


from collections import deque

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

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

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

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

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

from collections import defaultdict
ans = defaultdict(int)
for i in range(N):
    for j in range(i + 1, N):
        idx = min(j - i, abs(j + 1 - Y) + 1 + abs(X - i - 1))
        ans[idx] += 1
        
for i in range(1, N):
    print(ans[i])

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):
		d1=j-i
		d2=abs(X-i)+1+abs(Y-j)
		d=min(d1,d2)
		ans[d-1]+=1
for i in ans:
	print(i)

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

for i in l:
    print(i)

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

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




ans_dict = {i:0 for i in range(1,N+1)}

for i in range(1,N+1):
    for j in range(i+1,N+1):
        
        
        straight = j-i
        
        throught_XY = min(abs(X-i),abs(Y-i))+min(abs(X-j),abs(Y-j))+1
        
        distance = min(straight,throught_XY)
        
        ans_dict[distance] += 1
        
for i in range(1,N):
    print(ans_dict[i])

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

knum = [0]*(n-1);
d = [[0]*(n) for i in range(n)];

for i in range(n) :
    for j in range(i+1,n) :
        d[i][j] = j - i;
        d[j][i] = j - i;

d[x-1][y-1] = 1;
d[y-1][x-1] = 1;

for i in range(n) :
    for j in range(i+1,n) :
        mind = min(d[i][j],d[i][x-1]+1+d[y-1][j],d[i][y-1]+1+d[x-1][j]);
        d[i][j] = mind;
        d[j][i] = mind;

for i in range(n) :
    for j in range(i+1,n) :
        knum[d[i][j]-1] += 1;

for i in range(n-1) :
    print(knum[i]);

Solution (Python):

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

if X > Y:
    tmp = Y
    Y = X
    X = tmp

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

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

Solution (Python):
from collections import deque

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

d = {i:set() for i in range(N)}
for i in range(0,N):
  if i-1>=0:
    d[i-1].add(i)
  if i+1<=N-1:
    d[i+1].add(i)
  if i==X:
    d[Y].add(X)
    d[X].add(Y)

ans = {i+1:0 for i in range(N-1)}

for i in range(0,N):
  dist = [-1]*N
  q = deque([i])
  dist[i] = 0
  while q:
    v = q.popleft()
    for j in d[v]:
      if  dist[j] == -1:
        dist[j] = dist[v] + 1
        ans[dist[j]] += 1
        q.appendleft(j)
      elif dist[v] + 1 < dist[j]:
        ans[dist[j]] -= 1
        dist[j] = dist[v] + 1
        ans[dist[j]] += 1
        q.appendleft(j)

for l in ans.values():
  print(l//2)

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

Solution (Python):

def abs(n):
    if n < 0:
        return -n
    else:
        return n

def min(a, b):
    if a < b:
        return a
    else:
        return b

def abc160d(n, x_in, y_in):
    d_arr = [0 for _ in range(n-1)]
    x = x_in - 1
    y = y_in - 1
    for a in range(0,n):
        for tgt in range(a+1,n):
            d_normal = tgt - a
            d_min = d_normal - 1
            if tgt < x or y < a:
                pass
            else:
                d_short = abs(x-a) + 1 + abs(y-tgt)
                d_min = min(d_normal, d_short) - 1

            d_arr[d_min] += 1

    return d_arr    



if(__name__ == '__main__'):
    
    n, x, y = map(int, input().split(" "))
    
    ans = abc160d(n, x, y)
    
    
    for a in ans:
        print(a)

Solution (Python):
import sys,math,copy,queue,itertools
from fractions import gcd
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**4
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))
N,X,Y = LI()

c = [0 for _ in range(N+1)]

for k in range(1,N+1):
    j = 1
    m = [0 for _ in range(N+1)]
    
    
    
    
    j = 1
    for i in range(k+1,N+1):
        c[j] += 1
        m[i] = j
        j += 1
    if k <= X:
        j = X - k + 1
        a = 0
        while j + a < m[Y - a]:
            c[m[Y-a]] -= 1
            c[j + a] += 1
            m[Y -a] = j + a
            a += 1
        a = 1
        if Y + a <= N:
            while j + a < m[Y + a]:
                c[m[Y+a]] -= 1
                c[j + a] += 1
                m[Y + a] = j + a
                a += 1
                if Y + a > N : break
    elif k <= Y:
        j = k - X + 1
        a = 0
        while j + a < m[Y - a]:
            c[m[Y-a]] -= 1
            c[j + a] += 1
            m[Y -a] = j + a
            a += 1
        a = 1
        if Y + a <= N:
            while j + a < m[Y + a]:
                c[m[Y+a]] -= 1
                c[j + a] += 1
                m[Y + a] += 1
                a += 1
                if Y + a > N : break
for k in range(1,N):
    print (c[k])

Solution (Python):



def main():
  n, x, y = map(int, input().split()) 
  x -= 1
  y -= 1
  counts = [0] * (n)
  for i in range(n):
    s = 0
    for j in range(i+1, n):
      nv = min((j - i + 1), abs(i-x) + 1 + abs(j-y) + 1)
      if nv-2 < 0 or nv-2 >= n:
        continue
      counts[nv-2] += 1

  print('\n'.join(map(str, counts[:n-1])))

if __name__=='__main__':
  main()

Solution (Python):
N, X, Y = [int(x) for x in input().split()]
P = Y - X + 1
limit = (P + 1) // 2
L = X - 1
R = N - Y
for k in range(1, N):
  ans = 0
  if limit > k:
    ans += P
  elif limit == k:
    if P % 2 == 0:
      ans += P // 2
  for i in range(1, X):
    t = k - (X - i)
    if t <= 0:
      ans += 1
    elif t < limit:
      ans += 2
    elif t == limit:
      if P % 2 == 0:
        ans += 1
    if t - 1 > 0 and t - 1 <= R:
      ans += 1
  for i in range(N, Y, -1):
    if k - (i - Y) <= 0:
      ans += 1
    elif k - (i - Y) < limit:
      ans += 2
    elif k - (i - Y) == limit:
      if P % 2 == 0:
        ans += 1
  print(ans)

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

from collections import deque
from collections import Counter

def bfs(i): 
    visited=[0]*n
    visited[i]=1
    que=deque([])
    que.append((i,1))
    
    while len(que)>0:
        di,c=que.popleft()
        nm=di-1
        np=di+1
        no=-1
        if di==x-1:
            no=y-1
        if di==y-1:
            no=x-1
        if 0<=nm and visited[nm]==0:
            visited[nm]=c+1
            que.append((nm,c+1))
        if np<=n-1 and visited[np]==0:
            visited[np]=c+1
            que.append((np,c+1))
        if no>=0 and visited[no]==0:
            visited[no]=c+1
            que.append((no,c+1))
    return visited

l=[0]
myc=Counter(l)
for i in range(n):
    myc += Counter(bfs(i))
ans=list(myc.values())
p=len(ans)
for i in range(2,n+1):
    if i>=p:
        print(0)
    else:
        print(ans[i]//2)

Solution (Python):
n,x,y = [int(e) for e in input().split() ]
dst=[0]*(n+1)
for i in range(1,n+1):
  for j in range(i+1,n+1):
    l = abs(i - j)
    lxi = abs( x - i )
    lyj = abs( y - j )
    lu  = lxi + 1 + lyj
    dst[min([l,lu])] += 1

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

Solution (Python):
from collections import defaultdict


def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))

n,X,Y = invr()
ans = defaultdict(int)

for i in range(1,n):
    for j in range(i + 1,n + 1):
        if i < X:
            if j > Y:
                result = min(j - i,(X-i) + (j - Y) + 1)
            else:
                result = min(j - i,(X-i) + (Y - j) + 1)
        else:
            if j > Y:
                result = min(j - i,(i - X) + (j - Y) + 1)
            else:
                result = min(j - i,(i - X) + (Y - j) + 1)
        ans[result] += 1
    

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

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

for i in range(1,n+1):
    for j in range(i+1,n+1):
        dist= j-i
        alt_dist= abs(x-i)+1+abs(y-j)
        if alt_dist<dist:
            dist=alt_dist
        arr[dist]+=1
for a in arr[1:]:
    print(a)

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

result = [0] * (n-1)
short = y - x - 1
for i in range(n-1):
  for j in range(n-i-1):
    start = i + 1
    end = j + i + 2
    dist_no_shortcut = end - start
    dist_with_shortcut = abs(start - x) + abs(end - y) + 1
    dist = min(dist_no_shortcut, dist_with_shortcut)
    result[dist-1] += 1

for v in result:
  print(v)

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

d = {}

for i in range(1, n):
	d[i] = d.get(i, 0)

for i in range(1,n):
	for j in range(i+1,n+1):
		if i<=x and j<=y:
			k = min(j-i, (x-i)+1+(y-j))
		elif i<=x and y<=j:
			k = (x-i) + 1 + (j-y)
		elif x<=i and j<=y:
			k = min(j-i, (i-x)+1+(y-j))
		elif x<=i and y<=j:
			k = min(j-i, (i-x)+1+(j-y))
		d[k] = d.get(k, 0) + 1

for v in d.values():
	print(v)

Solution (Python):
n,x,y = map(int,input().split())
r = y-x+1
for k in range(1,n):
  ans = 0
  left=right=circle = 0
  for i in range(1,n+1):
    
    if i < x:
      if i + k <= x:
        left += 1
        continue
      elif r/2 == k- (x-i):
        left += 1
      elif r/2 > k - (x-i):
        left += 2
      if (x-i)+1 < k and k - (x-i)-1 - (n-y) <= 0:
        left += 1
  
    elif i >= y:
      if i + k <= n:
        right += 1
      if i == y:
        continue
      if r / 2 == k-(i-y):
        right += 1
      elif r / 2 > k-(i-y)>0:
      
        right += 2
  
  if r /2 == k:
    circle = r//2
  elif r/2 > k:
    circle = r
  print(left+right+circle)

Solution (Python):
n,x,y = (int(x) for x in input().split())
x-=1
y-=1
middle=(y+x)/2
dic={}
for i in range(n-1):
    for j in range(i+1,n):
        if i<=x and j<=x:
            k = j-i
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif j==middle:
            k = j-i
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i==middle:
            k = j-i
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i<=x and j>=x and j<=middle:
            k = j-i
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i<=x and j>=middle and j<=y:
            k = (x-i) + 1 + (y-j)
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i<=x and j>=middle and j>=y:
            k = (x-i) + 1 + (j-y)
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i>=x and i<=middle and j<=middle:
            k = j-i
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i>=x and i<=middle and j>=middle and j<=y:
            k = min(j-i, i-x+y-j+1)
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i>=x and i<=middle and j>=y:
            k = i-x + j-y + 1
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i>=middle and j<=y:
            k = j-i
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i>=middle and j>=y:
            k = j-i
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
        elif i>=y and j>=y:
            k = j-i
            if k not in dic:
            	dic[k]=1
            else:
            	dic[k]+=1
for i in range(1,n):
    if i not in dic:
        print(0)
    else:
        print(dic[i])

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

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

Solution (Python):
import sys
from collections import defaultdict, deque

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N, X, Y = MI()

aaa = [None] * (N + 1)
for v0 in range(1, N + 1):
    dx = [0] * N
    seen = set()
    seen.add(v0)
    q = deque()
    q.append((v0, -1, 0))
    while len(q) > 0:
        v, p, dist = q.popleft()

        dx[v - 1] = dist
        next = []
        if v > 1: next.append(v - 1)
        if v < N: next.append(v + 1)
        if v == X: next.append(Y)
        if v == Y: next.append(X)
        for next_v in next:
            if next_v not in seen:
                q.append((next_v, v, dist + 1))
                seen.add(next_v)
    d = defaultdict(int)
    for x in dx:
        d[x] += 1
    aaa[v0] = d

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

Solution (Python):
n, x, y = map(int, input().split())
ans = list(0 for _ in range(n+1))
for i in range(1, n):
    for j in range(i+1, n+1):
        if i < x:
            if j <=x:
                ans[j-i] += 1
            elif x < j < y:
                p = min(j-x, (y-j)+1)
                ans[x-i+p] += 1
            else:
                pos = (x - i) + 1 + (j - y)
                ans[pos] += 1
        elif y < i:
            ans[j-i] += 1
        else:
            if j < y:
                p = (i - x) + (y - j) + 1
                if (j - i) < p:
                    ans[j-i] += 1
                else:
                    ans[p] += 1
            else:
                p = min(y-i, (i - x) + 1)
                ans[p + (j - y)] += 1
for i in range(1, n):
    print(ans[i])

Solution (Python):
import sys
from collections import defaultdict

INF = sys.maxsize

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


X -= 1
Y -= 1

distance = [[INF] * N for _ in range(N)]

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

counter = defaultdict(int)

for i in range(N):
    for j in range(N):
        counter[distance[i][j]] += 1

for k in range(1, N):
    print(counter[k] // 2)

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):
        if j<=x:
            tmp=j-i
            
        elif x<i and j<y:
            tmp=min(j-i,(i-x)+1+(y-j))
            
        elif y<=i:
            tmp=j-i

        elif i<=x and y<=j:
            tmp=j-i -(y-x-1)

        elif i<=x and x<j and j<y:
            tmp=min(j-i,(x-i)+1+(y-j))
        elif x<i and i<y and y<=j:
            tmp=min(j-i,(i-x)+1+(j-y))

        ans[tmp-1] += 1

for i in ans:
    print(i)

Solution (Python):
N, X, Y = map(int, input().split())
X -= 1
Y -= 1
R = [0 for j in range(N)]
for i in range(N-1):
  for j in range(N):
    if j <= i:
      continue
    xd = abs(i - X)
    yd = abs(j - Y)
    dist = min(
      j - i,
      xd + yd + 1
    )
    R[dist] += 1
for r in R[1:]:
  print(r)

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

Solution (Python):
list = list(map(int, input().split()))
N=list[0]+1
X=list[1]
Y=list[2]
l=[0]*N
c=0

for i in range(1,N):
    for j in range(i+1, N):
        if i<=X and Y<=j:
            l[j-i-(Y-X)+1]+=1
        else:
            if j-i>abs(X-i)+1+abs(j-Y):
                l[abs(X-i)+1+abs(j-Y)]+=1
            else:
                l[j-i]+=1
for i in range(1,N-1):
    print(l[i])

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

dist = [[0 for i in range(N)] for j in range(N)]
for i in range(1,N):
    for j in range(i):
        dist[i][j]=i-j
dist[Y-1][X-1]=1

for i in range(N):
    y1 = min(Y-1+i,N-1)
    y2 = max(Y-1-i,0)
    for j in range(N):
        x1 = min(X-1+j,N-1)
        x2 = max(X-1-j,0)
        dist[min(y1+1,N-1)][x1] = min(dist[y1][x1]+1,dist[min(y1+1,N-1)][x1])
        dist[min(y1+1,N-1)][x2] = min(dist[y1][x2]+1,dist[min(y1+1,N-1)][x2])
        dist[max(y2-1,0)][x1] = min(dist[y2][x1]+1,dist[max(y2-1,0)][x1])
        dist[max(y2-1,0)][x2] = min(dist[y2][x2]+1,dist[max(y2-1,0)][x2])
        dist[y1][min(x1+1,N-1)] = min(dist[y1][x1]+1,dist[y1][min(x1+1,N-1)])
        dist[y2][min(x1+1,N-1)] = min(dist[y2][x1]+1,dist[y2][min(x1+1,N-1)])
        dist[y1][max(x2-1,0)] = min(dist[y1][x2]+1,dist[y1][max(x2-1,0)])
        dist[y2][max(x2-1,0)] = min(dist[y2][x2]+1,dist[y2][max(x2-1,0)])

ans = [0]*(N-1)

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

for i in ans:
    print(i)