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):
N,X,Y=map(int,input().split())
X-=1
Y-=1
E=[[] for _ in range(N)]
for i in range(N-1):
  E[i].append(i+1)
  E[i+1].append(i)
  if i==X:
    E[i].append(Y)
    E[Y].append(X)

cnt=[0]*N
for i in range(N):
  dist=[-1]*N
  dist[i]=0
  stack=[i]
  while stack:
    u=stack.pop(0)
    for v in E[u]:
      if dist[v]==-1:
        dist[v]=dist[u]+1
        cnt[dist[v]-1]+=1
        stack.append(v)
for i in range(N-1):
  print(cnt[i]//2)

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

D = Y-X
L = list(itertools.combinations(range(1,N+1), 2))

ans = [0] * N
for l in L:
    x, y = l[0], l[1]
    index = 0
    if x > Y or y < X:
        index = y-x
    elif x > X or y < Y:
        org = y-x
        oth = abs(X-x) + abs(Y-y) + 1
        if org > oth:
            index = oth
        else:
            index = org
    else:
        index = y-x - D+1
    
    ans[index] += 1

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

Solution (Python):
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') 
def gcd(a,b):return fractions.gcd(a,b) 
def lcm(a,b):return (a*b) // fractions.gcd(a,b) 
def iin(): return int(sys.stdin.readline()) 
def ifn(): return float(sys.stdin.readline()) 
def isn(): return sys.stdin.readline().split() 
def imn(): return map(int, sys.stdin.readline().split()) 
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) 
def fmn(): return map(float, sys.stdin.readline().split()) 
def iln(): return list(map(int, sys.stdin.readline().split())) 
def iln_s(): return sorted(iln()) 
def iln_r(): return sorted(iln(), reverse=True) 
def fln(): return list(map(float, sys.stdin.readline().split())) 
def join(l, s=''): return s.join(l) 
def perm(l, n): return itertools.permutations(l, n) 
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) 
def comb(l, n): return itertools.combinations(l, n) 
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) 
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

N,X,Y = imn()

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

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

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

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

Solution (Python):
def resolve():
    N, X, Y = map(int, input().split())
    from collections import defaultdict
    dist = defaultdict(int)
    for i in range(1, N):
        for j in range(i+1, N+1):
            _dist = min(j-i, abs(X-i) + 1 + abs(j-Y), abs(Y-i) + 1 + abs(j-X))
            dist[_dist] += 1
    for i in range(1, N):
        print(dist[i])

resolve()

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

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

    def count():
        for i in range(1, n+1):
            for j in range(i+1, n+1):
                yield min(abs(j-i), abs(x-i)+1+abs(j-y))

    c = Counter(count())
    for i in range(1, n):
        print(c[i] if i in c else 0)


main()

Solution (Python):
def d_line():
    N, X, Y = [int(i) for i in input().split()]
    ans = [0] * N
    for i in range(1, N + 1):
        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))
            ans[dist] += 1
    return '\n'.join(map(str, ans[1:]))

print(d_line())

Solution (Python):
from collections import defaultdict
import math
N, X, Y = list(map(int, input().split()))
res = defaultdict(int)
x = []
for i in range(1, N + 1):
    for j in range(1, N + 1):
        if i >= j:
            continue
        if i == X and Y == j:
            key = 1
        else:
            key = int(min(j - i, math.fabs(X - i) + math.fabs(Y - j) + 1))
        res[key] += 1


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

Solution (Python):

import sys
def p(*_a):
  _s=" ".join(map(str,_a))
  
  sys.stderr.write(_s+"\n")


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

ans=[0]*(n)

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



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

Solution (Python):
import sys
 
n, x, y = map(int, sys.stdin.readline().split())
x, y = x-1, y-1
cnt = [0] * (n - 1)
 
for i in range(n):
    for j in range(i+1, n):
        a = abs(j-i)
        b = abs(x-i) + abs(y-j) + 1
        c = abs(y-i) + abs(x-j) + 1
        cnt[min(a,b,c) - 1] += 1
 
for i in range(n-1):
    print(cnt[i])

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

array = [[-1 for i in range(n)] for j in range(n)]

for i in range(n):
  for j in range(n):
    array[i][j] = abs(j-i)
    
for i in range(n):
  if array[i][x] == array[i][y]:
    pass
  
  elif array[i][x] > array[i][y]:
    array[i][x] = array[i][y] + 1
    
    index = x - 1
    while True:
      if index < 0 or array[i][index] <= array[i][index+1]:
        break
        
      array[i][index] = array[i][index+1] + 1
      index -= 1
      
    index = x + 1
    while True:
      if index >= n or array[i][index] <= array[i][index-1]:
        break
        
      array[i][index] = array[i][index-1] + 1
      index += 1
      
  else:
    array[i][y] = array[i][x] + 1
    
    index = y - 1
    while True:
      if index < 0 or array[i][index] <= array[i][index+1]:
        break
        
      array[i][index] = array[i][index+1] + 1
      index -= 1
      
    index = y + 1
    while True:
      if index >= n or array[i][index] <= array[i][index-1]:
        break
        
      array[i][index] = array[i][index-1] + 1
      index += 1
      
ans = [0] * (n+1)
for i in range(n):
  for j in range(i, n):
    tmp = array[i][j]
    ans[tmp] += 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+1):
    for j in range(i+1, n+1):
        d=min(j-i, abs(x-i)+1+abs(j-y), abs(y-i)+1+abs(j-x))
        
        ans[d-1]+=1

for a in ans:
    print(a)

Solution (Python):
N, X, Y = [int(i) for i in input().split()]

X = X - 1
Y = Y - 1
ans = [0]*N 

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

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

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect




from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
input = sys.stdin.readline

sys.setrecursionlimit(2147483647)

def main():
  n, x, y = map(int, input().split())
  m = [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, abs(x-j)+abs(y-i)+1)
      m[d] +=1
  for i in range(1,n):
    print(m[i])

if __name__ == '__main__':
  main()

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

anss = [0] * N
for a in range(1, N+1):
    for b in range(a+1, N+1):
        d1 = b-a
        d2 = abs(X-a) + 1 + abs(Y-b)
        d = d1 if d1 <= d2 else d2
        anss[d] += 1

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

Solution (Python):
import sys
import os
from io import BytesIO, IOBase






'''def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r'''


'''def divs(n, start=1):
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors'''


'''def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
    return divs_number'''


'''def flin(d, x, default=-1):
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return (default, default)
    else:
        return (left, right)'''


'''def modpow(b,p,m):
    res=1
    b=b%m
    while(p):
        if p&1:
            res=(res*b)%m
        b=(b*b)%m
        p>>=1
    return res'''


'''def mod_inv(a,m):
    return modpow(a,m-2,m)'''


'''def ncr(n,r,m):
    res=1
    if r==0:
        return 1
    if n-r<r:
        r=n-r
    p,k=1,1
    while(r):
        res=((res%m)*(((n%m)*mod_inv(r,m))%m))%m
        n-=1
        r-=1
    return res'''


'''def ncrlis(n,r,m,fact):
    return (fact[n]*(mod_inv(fact[r],m)*mod_inv(fact[n-r],m))%m)%m'''


def xor1_n(n):
    d={0:n,1:1,2:n+1,3:0}
    return d[n&3]

def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return collections.defaultdict(int)
def ddl(): return collections.defaultdict(list)
def ddd(): return collections.defaultdict(collections.defaultdict(int))
 


 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
	newlines = 0
 
	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = "x" in file.mode or "r" not in file.mode
		self.write = self.buffer.write if self.writable else None
 
	def read(self):
			while True:
					b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
					if not b:
							break
					ptr = self.buffer.tell()
					self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
			self.newlines = 0
			return self.buffer.read()
 
	def readline(self):
			while self.newlines == 0:
					b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
					self.newlines = b.count(b"\n") + (not b)
					ptr = self.buffer.tell()
					self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
			self.newlines -= 1
			return self.buffer.readline()
 
	def flush(self):
			if self.writable:
					os.write(self._fd, self.buffer.getvalue())
					self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
	def __init__(self, file):
			self.buffer = FastIO(file)
			self.flush = self.buffer.flush
			self.writable = self.buffer.writable
			self.write = lambda s: self.buffer.write(s.encode("ascii"))
			self.read = lambda: self.buffer.read().decode("ascii")
			self.readline = lambda: self.buffer.readline().decode("ascii")
 

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

import collections











for _ in range(1):
    n,x,y=mi()
    d=dd()
    for i in range(1,n):
        for j in range(i,n+1):
            dst=min(abs(j-i),abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x))
            d[dst]+=1
    for i in range(1,n):
        print(d[i])

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

l = [0]*n

x -= 1
y -= 1

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

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

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

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

for p in range(1,N) :
    
    for q in range(p+1,N+1) :
        
        if (p < X) :
            if (q <= X) :
                result[(q-p)-1] += 1
            elif (X < q <= Y) :
                result[min(q-p,1+(Y-q)+(X-p)) - 1] += 1
            elif (Y < q) :
                result[((X-p)+1+(q-Y))-1] += 1
            else :
                print("error1")
        elif (X <= p <= Y) :
            if Y < q :
                result[min(q-p,(p-X)+1+(q-Y))-1] += 1
            elif (q <= Y) :
                result[min(q-p,(p-X)+1+(Y-q))-1]+=1
            else :
                print("error2")
        elif (Y < p) :
            result[q-p-1] += 1
        else :
            print("error3")
        


for k in range(N-1) :
    print(result[k])

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

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

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

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

def f(i, j, X, Y):
  return min(j-i, abs(j - Y) + 1 + abs(i-X))
  
cnts = [0] * N
for i in range(1, N+1):
  for j in range(i+1, N+1):
    k = f(i, j, X, Y)
    cnts[k] += 1
for k in range(1, N):
  print(cnts[k])

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

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

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

def calc_goal(start,goal):
    if goal <= X:
        return goal-start
    if goal <= Y:
        if X >= start:
            return min(goal-start,X-start+Y-goal+1)
        else:
            return min(start-X+Y-goal+1,goal-start)
    else:
        if X >= start:
            return X-start+goal-Y+1
        else:
            return min(start-X+goal-Y+1,goal-start)

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

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

Solution (Python):

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

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

Solution (Python):
def main():
    n,x,y = tuple([int(t)for t in input().split()])

    dmin = [[n]*n for _ in [0]*n]

    nlist = list(range(n))

    for i in range(n):
        for j in range(i,n):
            dmin[i][j] = j-i
            dmin[j][i] = j-i

    for i in range(x):
        for j in range(y-1,n):
            dmin[i][j] -= y-x-1
            dmin[j][i] -= y-x-1


    for i in range(n):
        for j in range(x,(x+y)//2):
            t = dmin[j][x-1]+dmin[x-1][i]
            if dmin[i][j]>t:
                dmin[i][j] = t
                dmin[j][i] = t

        for j in range((x+y)//2,y):
            t = dmin[j][y-1]+dmin[y-1][i]
            if dmin[i][j]>t:
                dmin[i][j] = t
                dmin[j][i] = t

    res = [0]*(n+1)
    for dmin_ in dmin:
        for d in dmin_:
            res[d] += 1

    for r in res[1:n]:
        print(r//2)

if __name__ == "__main__":
    main()

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

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

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

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

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

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) + abs(y-j) + 1)
        ans[d-1] += 1

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

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

Solution (Python):
N, X, Y = list(map(int, input().split()))
res = [0] * N
for j in range(1, N + 1):
    for i in range(1, j):
        if i == X and Y == j:
            key = 1
        else:
            key = int(min(j - i, abs(X - i) + abs(Y - j) + 1))
        res[key] += 1

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

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

    print(N)
    dist = [0] * (N + 1)

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

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


main()

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) + abs(y-j) + 1)
        ans[d-1] += 1

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

Solution (Python):
import itertools

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

combi = list(itertools.combinations(range(1,N+1), 2))
dist = [[i+1, 0] for i in range(0, N-1)]

c = [min([kyori[1] - kyori[0], int(abs((kyori[1] - Y))) + 1 + int(abs((X - kyori[0])))]) for kyori in combi]

for i in range(len(c)):
    dist[c[i]-1][1] += 1
for i in range(0, N-1):
    print(dist[i][1])

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

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

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

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

X,Y = X-1,Y-1

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

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

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

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

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


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

Solution (Python):

from collections import deque
from collections import Counter
from collections import defaultdict
INF = int(1e9)
def main():
    n, x, y = map(int, input().split())
    x-=1
    y-=1
    g = [[] for _ in range(n)]
    for i in range(n-1):
        g[i].append(i+1)
        g[i+1].append(i)
    g[x].append(y)
    g[y].append(x)
    ans = defaultdict(int)
    q = deque()
    pns = []
    for i in range(n):
        dist = [INF for _ in range(n)]
        q.append(i)
        dist[i] = 0
        while len(q):
            node_s = q.popleft() 
            for j in range(len(g[node_s])):
                if dist[g[node_s][j]] != INF:
                    continue
                q.append(g[node_s][j])
                dist[g[node_s][j]] = dist[node_s] + 1
        for k in range(n): 
            pns.append(dist[k])
    
    ans = Counter(pns) 
    for k in range(1, n):
        print(ans[k]//2)
main()

Solution (Python):
def II():return int(input())
def MI():return map(int,input().split())
def LI():return list(MI())
def ok():print("Yes")
def ng():print("No");exit()

n,x,y=MI()

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

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

Solution (Python):
N, X, Y = list(map(int, input().split()))
res = [0] * N
for i in range(1, N + 1):
    for j in range(1, N + 1):
        if i >= j:
            continue
        if i == X and Y == j:
            key = 1
        else:
            key = int(min(j - i, abs(X - i) + abs(Y - j) + 1))
        res[key] += 1

for i in range(1, N):
    print(res[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):
        dist1 = j - i
        dist2 = min(abs(x - i) + abs(y - j), abs(x - j) + abs(y - i)) + 1
        dist = min(dist1, dist2)
        cnt[dist] += 1

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

Solution (Python):


import sys
import pprint

sys.setrecursionlimit(10 ** 6)

class Logger:
	def __init__(self, debug):
		self.debug = debug
	def print(self, *args):
		if self.debug:
			pprint.pprint(args)


def main():
	log = Logger(0)
	n, x, y = map(int, sys.stdin.readline().split())
	x -= 1
	y -= 1
	ans = [0]*(n-1)
	for i in range(n):
		for j in range(i+1, n):
			log.print(i, j, ans)
			if i == j:
				continue
			if (i <= x and j <= x) or (y <= i and y <= j):
				ans[abs(i-j)-1] += 1
			elif (i <= x and y <= j):
				ans[x-i + j-y + 1 - 1] += 1
			elif (x < i < y and x < j < y):
				ans[min(abs(i-j), i-x + 1 + y-j)-1] += 1
			elif (i <= x and x < j < y):
				ans[min(abs(i-j), x-i + 1 + y-j)-1] += 1
			elif (x < i < y and y <= j):
				ans[min(abs(i-j), j-y + 1 + i-x)-1] += 1
	for i in range(len(ans)):
		print(ans[i])







main()

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

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

ans = [0] * (N - 1)
ans[0] = 1

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

for a in ans:
    print(a)

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

result = [0]*N
for i, j in combinations(range(1, N+1), 2):
    mins = min([j-i, abs(Y-j)+abs(X-i)+1])
    result[mins] += 1
    
for i in range(1, N):
    print(result[i])

Solution (Python):
N, X, Y = map(int, input().split())
S = [list(reversed(list(range(1, i+1)))) + list(range(N-i)) for i in range(N)]

S[X-1][Y-1] = 1
S[Y-1][X-1] = 1

for i in range(N):
    for j in range(N):
        x, y = X-1, Y-1
        S[i][j] = min(S[i][j], S[i][x]+1+S[y][j])



dist = [0]*N

from itertools import (
    accumulate,  
    groupby,  
    permutations,  
    combinations,  
    product,  
)

for i, j in combinations(list(range(N)), 2):
    d = S[i][j]
    dist[d] += 1



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

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):
n, x, y = map(int, input().split())

cnt = [0] *n
for ind1 in range(1,n+1):
    for ind2 in range(ind1+1,n+1):
        cur_dist = min(ind2-ind1, abs(x-ind1)+abs(y-ind2)+1)
        
        cnt[cur_dist] += 1

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

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

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

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

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

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

Solution (Python):
def II():return int(input())
def MI():return map(int,input().split())
def LI():return list(MI())
def ok():print("Yes")
def ng():print("No");exit()

n,x,y=MI()

ans=[0]*n

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

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

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

ans = [0] * (n-1)

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

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

Solution (Python):

import collections
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
c=[0]*N
for i in range(N):
    for j in range(i+1,N):
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1
        if MyDist<j-i:
            Dist[i][j]=MyDist
            c[MyDist-1]+=1
        else:
            Dist[i][j] = j-i
            c[j-i-1]+=1
for i in range(N-1):
    print(c[i])

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

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

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

Solution (Python):
from collections import defaultdict, deque
def solve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    cnter = defaultdict(int)

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


if __name__ == '__main__':
    solve()

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):
N,X,Y = [int(i.strip()) for i in input().split(' ')]
X = X-1
Y = Y - 1
diff = (Y-X-1)//2
result = [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)
        result[dist-1] += 1

L = len(result) - 1
for i,j in enumerate(result):
    if not i == L:
        print(j)

Solution (Python):
from collections import deque
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n,x,y=MI()
    to=[[] for _ in range(n)]
    for i in range(n-1):
        to[i].append(i+1)
        to[i+1].append(i)
    to[x-1].append(y-1)
    to[y-1].append(x-1)
    ans=[0]*n
    for i in range(n):
        q=deque()
        q.append(i)
        dist=[-1]*n
        dist[i]=0
        while q:
            u=q.popleft()
            for v in to[u]:
                if dist[v]!=-1:continue
                dist[v]=dist[u]+1
                ans[dist[v]]+=1
                q.append(v)
    for a in ans[1:]:
        print(a//2)

main()

Solution (Python):
from scipy.sparse.csgraph import dijkstra

def main():
    n,x,y=map(int,input().split())
    cost = [[0 for i in range(n)] for i in range(n)]
    
    for i in range(1,n):
        cost[i-1][i] = 1

    cost[x-1][y-1]=1
    cost[y-1][x-1]=1
    res=tuple(dijkstra(tuple(cost), directed=False))
    ans = [0 for i in range(n)]
    for i in range(n):
        for j in range(i,n):
            ans[int(res[i][j])] += 1
 
    for i in range(1,n):
        print(ans[i])
    
if __name__ == '__main__':
    main()