Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys

ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nms = lambda: map(str, sys.stdin.readline().split())
nl = lambda: list(nm())

n, k = nm()
h = nl()
h.insert(0, h[0])
INF = 10 ** 9
dp = [INF for _ in range(n + 1)]
dp[0] = 0

for i in range(1, n + 1):
    dp[i] = min([dp[i - j] + abs(h[i] - h[i - j]) for j in range(1, k + 1) if i - j >= 0])
print(dp[-1])


### FIXED CODE ###

import sys

ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nms = lambda: map(str, sys.stdin.readline().split())
nl = lambda: list(nm())

n, k = nm()
h = nl()
h.insert(0, h[0])
INF = 10 ** 9
dp = [INF for _ in range(n + 1)]
dp[1] = 0

for i in range(2, n + 1):
    x = max(i - k, 1)
    dp[i] = min([d + abs(h[i] - hd) for d, hd in zip(dp[x:i], h[x:i])])
print(dp[-1])
### BUGGY CODE ###

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for a in range(N):
    for b in range(a):
        for c in range(b):
            if L[a] < L[b] + L[c] and L[b] < L[c] + L[a] and L[c] < L[a] + L[b]:
                ans += b - c
                break
print(ans)

### FIXED CODE ###

# -*- coding:utf-8 -*-
import bisect

def solve():
    N = int(input())
    Ls = list(map(int, input().split()))
    Ls.sort()

    # O(N^2 * logN)の全探索で解く
    ans = 0
    for a_i in range(N):
        for b_i in range(a_i+1, N):
            c_i = bisect.bisect_left(Ls, Ls[a_i]+Ls[b_i])
            if c_i > b_i:
                ans += c_i - b_i - 1
            else:
                pass

    print(ans)

if __name__ == "__main__":
    solve()
### BUGGY CODE ###

import sys
sys.setrecursionlimit(100010)

def main():
    def input():
        return sys.stdin.readline()[:-1]

    N, M = map(int,input().split())

    p = list(map(int,input().split()))
    p = [p[k]-1 for k in range(N)]
    parent = [k for k in range(N)]

    def find(x):
        if parent[x] == x:
            return x
        else:
            return find(parent[x])

    def unite(x,y):
        if find(x) != find(y):
            parent[find(x)] = find(y)

    for k in range(M):
        x, y = map(int,input().split())
        unite(x-1,y-1)

    ans = 0
    for k in range(N):
        if find(k) == find(p[k]):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(100010)

def main():
    def input():
        return sys.stdin.readline()[:-1]

    N, M = map(int,input().split())

    p = list(map(lambda x: int(x)-1, input().split()))
    parent = [k for k in range(N)]

    def find(x):
        if parent[x] == x:
            return x
        else:
            parent[x] = find(parent[x])
            return find(parent[x])

    def unite(x,y):
        parent[find(x)] = find(y)

    for k in range(M):
        x, y = map(int,input().split())
        unite(x-1,y-1)

    ans = 0
    for k in range(N):
        if find(k) == find(p[k]):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))

inf = 10**18
ans = 1

sorted(a, reverse=True)
if 0 in a:
    ans = 0
else:
    for i in a:
        ans *= i

print(ans if ans <= inf else -1)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

inf = 10**18
ans = 1

sorted(a, reverse=True)
if 0 in a:
    print(0)
    exit()
else:
    for i in a:
        ans *= i
        if ans > inf:
            print(-1)
            exit()

print(ans)
### BUGGY CODE ###

import numpy as np
n,k,q = map(int,input().split())
A = []
for i in range(q):
    A.append(int(input()))

for i in range(1,n+1):
    if A.count(i) > q-k:
        print('Yes')
    else:
        print('No')



### FIXED CODE ###

import sys
input = sys.stdin.readline
n,k,q = map(int,input().split())
A = [0]*n
for i in range(q):
    A[int(input())-1] +=1

for i in range(n):
    if A[i] > q-k:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

N, K = map(int, input().split())
steps = list(map(int, input().split()))
costs = [0]*(N+1)
for i in range(1, N):
  if i<=K:
    k = i
  choices = [costs[i-j] + abs(steps[i]-steps[i-j]) for j in range(1, k+1)]
  costs[i] = min(choices)
print(costs[N-1])

### FIXED CODE ###

N, K = map(int, input().split())
steps = list(map(int, input().split()))
costs = [0]*(N+1)
for i in range(1, N):
  if i<=K:
    k = i
  choices = [costs[i-j] + abs(steps[i]-steps[i-j]) for j in range(1, k+1)]
  costs[i] = min(choices)
print(costs[N-1])
### BUGGY CODE ###

n = int(input())
s = input()

t = '000'
lst = []

for i in range(n-2):
	for j in range(i+1, n-1):
		for k in range(j+1, n):
			t = str(s[i]) + str(s[j]) + str(s[k])
			if not t in lst:
				lst.append(t)

print(len(lst))

### FIXED CODE ###

n = int(input())
s = input()
cnt = 0

for x in range(10):
	for y in range(10):
		for z in range(10):
			i = s.find(str(x))
			if i != -1:
				i = s.find(str(y), i+1)
				if i != -1:
					i = s.find(str(z), i+1)
					if i != -1:
						cnt += 1
				
print(cnt)
### BUGGY CODE ###

h, n = map( int, input().split() )
a = []
b = []
for _ in range( n ):
    a_i, b_i = map( int, input().split() )
    a.append( a_i )
    b.append( b_i )

dp = [ float( "Inf" ) ] * ( h + 1 )
# dp[ d ] = dを与える最小マナ
dp[ 0 ] = 0
for i in range( h ):
    for j in range( n ):
        update_index = min( i + a[ j ], h )
        dp[ update_index ] = min( dp[ update_index ], dp[ i ] + b[ j ] )

print( dp[ h ] )

### FIXED CODE ###

h, n = map( int, input().split() )
a = []
b = []
for _ in range( n ):
    a_i, b_i = map( int, input().split() )
    a.append( a_i )
    b.append( b_i )

dp = [ float( "Inf" ) ] * ( h + 1 )
# dp[ d ] = dを与える最小マナ
dp[ 0 ] = 0
for i in range( h ):
    for j in range( n ):
        update_index = min( i + a[ j ], h )
        dp[ update_index ] = min( dp[ update_index ], dp[ i ] + b[ j ] )

print( dp[ h ] )
### BUGGY CODE ###

N=int(input())
listA=list(map(int,input().split()))
ans=0
for i in range(N-1):
  if listA[i]<N:
    for k in range(i+1,N):
      if abs(k-i)==listA[i]+listA[k]:
        ans+=1
print(ans)        

### FIXED CODE ###

N=int(input())
listA=list(map(int,input().split()))
ans=0
L=[]
R=[]
L1=[0]*N
R1=[0]*N
for i in range(N):
  L+=[i+listA[i]]
  R+=[i-listA[i]]
  try:
    L1[i+1+listA[i]]+=1
  except:
    pass
  try:
    if i-listA[i]>0:
      R1[i+1-listA[i]]+=1
  except:
    pass
for i in range(N):
  ans+=L1[i]*R1[i]
print(ans)
### BUGGY CODE ###

import sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(input())
    for i in range(1, n):
        ans += i%(i+1)
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

input = sys.stdin.readline

def main():
    n = int(input())-1
    ans = (1+n)*(n//2)
    if n%2 != 0:
        ans += n//2+1
    print(ans)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
MOD = 10**9 + 7

dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1 if 1 not in a else 0

for i in range(2, N+1):
    if i in a:
        continue
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[N] % MOD)

### FIXED CODE ###

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
MOD = 10**9 + 7
 
dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1 if 1 not in a else 0
 
a = set(list(range(2,N+1))) - set(a)
for i in a:
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[N] % MOD)
### BUGGY CODE ###

S = input()

#print('01' in S)
#print('10' in S)

count = 0

while '01' in S or '10' in S:
    #print(S)
    #print('01' in S or '10' in S)
    if '01' in S:
        count += S.count('01')
        S = S.replace('01', '')
    if '10' in S:
        count += S.count('10')
        S = S.replace('10', '')

print(count * 2)




### FIXED CODE ###

S = input()

count_0 = S.count('0')
count_1 = S.count('1')

print(min(count_0, count_1) * 2)
### BUGGY CODE ###

import sys


def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    n = len(a)
    dp = [[None for x in range(n)] for y in range(n)]
    recursive_call(dp, a, len(a), 0, n - 1)
    return dp[0][n - 1]


def recursive_call(dp, a, n, l, r):
    if dp[l][r] is not None:
        return dp[l][r]
    if l == r:
        dp[l][r] = a[l]
        return dp[l][r]
    dp[l][r] = max(a[l] - recursive_call(dp, a, n, l + 1, r), a[r] - recursive_call(dp, a, n, l, r - 1))
    return dp[l][r]


def write(result):
    print(result)


if __name__ == '__main__':
    sys.setrecursionlimit(10000)
    solve()

### FIXED CODE ###

def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(int, read_line().split(' ')))[:n]


def read_float(n):
    return list(map(float, read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    n = len(a)
    dp = [[None for x in range(n)] for y in range(n)]
    for i in range(len(dp)):
        dp[i][i] = a[i]
    for l in range(n - 2, -1, -1):
        for r in range(l + 1, n):
            dp[l][r] = max(a[l] - dp[l + 1][r], a[r] - dp[l][r - 1])
    return dp[0][n - 1]


def write(result):
    print(result)


if __name__ == '__main__':
    solve()
### BUGGY CODE ###

import math
n = int(input())
X = list(map(int,input().split()))
x = sorted(X)

left = x[math.floor((n-1)/2)]
right = x[math.ceil((n-1)/2)]

for a in X:
    i = x.index(a)
    if i < (n-1)/2:
        print(right)
    else:
        print(left)

### FIXED CODE ###

import math
n = int(input())
X = list(map(int,input().split()))
x = sorted(X)

left = x[math.floor((n-1)/2)]
right = x[math.ceil((n-1)/2)]

for a in X:
    if a < right:
        print(right)
    else:
        print(left)
### BUGGY CODE ###

import sys
import math
import itertools

N=int(input())
for h,n in itertools.product(range(1,3501),range(1,3501)):
    x=N*h*n
    y=4*n*h-N*n-N*h
    if(y>0 and x%y==0):
        print(h,n,x//y)
        break

### FIXED CODE ###

import sys
import math
import itertools

N=int(input())
if(N%4==0):
    x=3*N//4
    print(x,x,x)
    exit()
for x in range(3501):
    if(4*x-2*N>0 and (N*x)%(4*x-2*N)==0):
        h=(N*x)//(4*x-2*N)
        print(h,x,x)
        exit()
if(N>2000):st=-1
else:st=1
for h,n in itertools.product(range(1,3501)[::st],range(1,3501)[::st]):
    x=N*h*n
    y=4*n*h-N*n-N*h
    if(y>0 and x%y==0):
        print(h,n,x//y)
        break
"""
4/N=1/h+1/n+1/w
4/N=(nw+hw+hn)/nhw
4nhw/N=nw+hw+hn
4nhw=Nnw+Nhw+Nhn
(4nh-Nn-Nh)w=Nhn
w=Nhn/(4nh-Nn-Nh)

4/N=3/x
4x/N=3
4x=3N
h,n,w=3N/4  (N%4==0)

4/N=1/h+2/x
4/N-2/x=1/h
(4x-2N)/Nx=1/h
h=Nx/(4x-2N)
"""
### BUGGY CODE ###

n, m = map(int,input().split())
height = list(map(int,input().split()))

a = []
b = []
for i in range(m):
  tmp = list(map(int,input().split()))
  a.append(tmp[0])
  b.append(tmp[1])
  
atta = 0
for j in range(n):
  flag = 0
  for k in range(m):
    if a[k] == j+1:
      if height[j] <= height[b[k]-1]:
        flag = 1
    elif b[k] == j+1:
      if height[j] <= height[a[k]-1]:
        flag = 1
  if flag == 0:
    atta += 1

print(atta)


### FIXED CODE ###

n, m = map(int,input().split())
height = list(map(int,input().split()))

a = []
b = []
for i in range(m):
  tmp = list(map(int,input().split()))
  a.append(tmp[0])
  b.append(tmp[1])
  
atta = [1]*n
for j in range(m):
  if height[a[j]-1] == height[b[j]-1]:
    atta[a[j]-1] = 0
    atta[b[j]-1] = 0
  elif height[a[j]-1] < height[b[j]-1]:
    atta[a[j]-1] = 0
  elif height[a[j]-1] > height[b[j]-1]:
    atta[b[j]-1] = 0
  #print(j,atta)

print(atta.count(1))
### BUGGY CODE ###

N = int(input())
H = list(map(int, input().split()))

answer = 0

for i in range(N):
    move = 0
    j = i
    while True:
        if j >= N-1:
            break
        if H[j+1] <= H[j]:
            move += 1
            j += 1
        else:
            break
        answer = max(move, answer)

print(answer)


### FIXED CODE ###

import numpy as np


N = int(input())
H = np.array(list(map(int, input().split())))

answer = 0

L1 = (H[:-1] >= H[1:])
#print(L1)

answer = 0
count = 0
for l in L1:
    if l:
        count += 1
    else:
        answer = max(answer, count)
        count = 0

print(max(answer, count))
### BUGGY CODE ###

N, Q = map(int, input().split())
S = input()
arr = []
for i in range(N-1):
  if S[i:i+2] == "AC":
    arr.append(i)
for i in range(Q):
  l, r = map(int, input().split())
  count = 0
  for j in arr:
    if j >= l-1 and j < r-1:
      count += 1
  print(count)
               

### FIXED CODE ###

import bisect
N, Q = map(int, input().split())
S = input()
arr = []
for i in range(N-1):
  if S[i:i+2] == "AC":
    arr.append(i)
#print(arr)
for i in range(Q):
  l, r = map(int, input().split())
  print(bisect.bisect_right(arr, r-2) - bisect.bisect_left(arr, l-1))
### BUGGY CODE ###

N, K = map(int, input().split())
MOD = 998244353

nums = []

for i in range(K):
    l, r = map(int, input().split())
    nums.append([l, r])
# nums.sort()
# print(nums)


dp = [0] * (N + 1)
dp[1] = 1
cumsum = [0, 1]

for i in range(2, N + 1):
    for l, r in nums:
        if i - l > 0:
            # print(i, l, r)
            # r = min(r, N)
            dp[i] += cumsum[i - l] - cumsum[max(i - r - 1, 0)]
    cumsum.append(cumsum[-1] + dp[i])

print(dp[-1] % MOD)
# print(dp)
# print(cumsum)


### FIXED CODE ###

N, K = map(int, input().split())
MOD = 998244353

nums = []

for i in range(K):
    l, r = map(int, input().split())
    nums.append([l, r])
# nums.sort()
# print(nums)


dp = [0] * (N + 1)
dp[1] = 1
cumsum = [0, 1]

for i in range(2, N + 1):
    for l, r in nums:
        # print(l,r)
        if i - l > 0:
            # print(i, l, r)
            # r = min(r, N)
            dp[i] += (cumsum[i - l] - cumsum[max(i - r - 1, 0)]) % MOD
    cumsum.append(cumsum[-1] + dp[i])

print(dp[-1] % MOD)
# print(dp)
# print(cumsum)
### BUGGY CODE ###

import copy

n = int(input())
lst = []
for _ in range(n):
    lst.append(int(input()))
clean_lst = copy.deepcopy(lst)

for i in clean_lst:
    lst.remove(i)
    print(max(lst))
    lst.append(i)


### FIXED CODE ###

import copy

n = int(input())
lst = []
for _ in range(n):
    lst.append(int(input()))
clean_lst = copy.deepcopy(lst)

m1 = max(lst)
lst.remove(m1)
m2 = max(lst)

for i in clean_lst:
    print(m1 if i!=m1 else m2)
### BUGGY CODE ###

k=int(input())
if k%2==0:
    print(-1)
    exit()
count=1
a=0
while True:
    a=(a*10+7)%k
    if a==0:
        print(count)
        exit()
    count+=1

### FIXED CODE ###

k=int(input())
if k%2==0 or k%5==0:
    print(-1)
    exit()
a=0
for i in range(k):
    a=(a*10+7)%k
    if a==0:
        print(i+1)
        exit()
### BUGGY CODE ###

import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    h, w = list(map(int, readline().split()))
    a = [[True] * w for _ in range(h)]
    ql = []
    ql = collections.deque(ql)
    fq = collections.defaultdict(list)
    for i in range(h):
        s = str(readline().rstrip().decode('utf-8'))
        for j in range(w):
            if s[j] == "#":
                a[i][j] = False
                ql.append([0, i, j])
                fq[i, j]

    mt = 0
    while True:
        if len(ql) != 0:
            cost, x, y = ql.popleft()
            mt = max(mt, cost)
            for xv, yv in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]:
                if 0 <= xv < h and 0 <= yv < w:
                    if (xv, yv) not in fq and a[xv][yv]:
                        ql.append([cost + 1, xv, yv])
                        fq[xv, yv]
        else:
            break
    print(mt)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    h, w = list(map(int, readline().split()))
    a = [[True] * w for _ in range(h)]
    ql = collections.deque()
    for i in range(h):
        s = list(str(readline().rstrip().decode('utf-8')))
        for j in range(w):
            if s[j] == "#":
                ql.append([0, i, j])
                a[i][j] = False
    while ql:
        cost, x, y = ql.popleft()
        for xv, yv in ((x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)):
            if 0 <= xv < h and 0 <= yv < w:
                if a[xv][yv]:
                    ql.append([cost + 1, xv, yv])
                    a[xv][yv] = False
    print(cost)


if __name__ == '__main__':
    solve()
### BUGGY CODE ###

from bisect import bisect_left
from heapq import heappop, heappush

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

BC = []

for i in range(M):
  b, c = map(int, input().split())
  heappush(BC, (-c, b))

for i in range(M):
  mc, b = heappop(BC)
  c = -mc
  index = bisect_left(A, c)

  if index == 0:
    continue
  
  if index <= b:
    A = [c for _ in range(index) ] + A[index:]
  else:
    A = [c for _ in range(b)] + A[b:]
  
  A.sort()

print(sum(A))

### FIXED CODE ###

from heapq import heappop, heappush, heapify

N, M = map(int, input().split())
A = list(map(int, input().split()))
heapify(A)
BC = []

for i in range(M):
  b, c = map(int, input().split())
  heappush(BC, (-c, b))

for i in range(M):
  mc, b = heappop(BC)
  c = -mc
  end = False

  for j in range(b):
    min = heappop(A)
    if c <= min:
      heappush(A, min)
      end = True
      break
    else:
      heappush(A, c)

  if end:
    break

print(sum(A))
### BUGGY CODE ###

import sys
import math
pos=input()
pos=pos.split()
N=int(pos[0])
M=int(pos[1])

item=input()
item=item.split()
item=[float(d) for d in item]
for i in range(1,M+1):
    item[item.index(max(item))]=math.floor(max(item)/(2.0))
    
print(int(sum(item)))

### FIXED CODE ###

import sys
import math
import numpy as np
from heapq import heappush, heappop
pos=input()
pos=pos.split()
N=int(pos[0])
M=int(pos[1])
sum=0

item=input()
item=item.split()
item=list(map(float,item))

hq=[]
for i in item:
  heappush(hq,-i)
  
for j in range(1,M+1):
  temp=heappop(hq)
  heappush(hq,math.ceil(temp/2.0))
  
for k in range(0,N):
  sum-=heappop(hq)
print(int(sum))
### BUGGY CODE ###

from bisect import bisect_left, bisect_right
import sys
input = sys.stdin.buffer.readline

N, K = map(int, input().split())
As = sorted(map(int, input().split()))

def check(t):
    "if the number of the pairs (i, j) that satisfies Ai * Aj <= t is < K, return True"
    count = 0
    for i, A in enumerate(As):
        if A > 0:
            index = bisect_right(As, t//A, lo = i+1) - (i+1)
        elif A < 0:
            index = N - bisect_left(As, -((-t)//A), lo = i+1)
        else:
            if t < 0:
                index = 0
            else:
                index = N - i - 1
        count += index
        if count > K:
            return False
    return (count < K)
        

l = - (10 ** 18 + 10)
r = 10 ** 18 + 10
while r - l > 1:
    mid = (l + r) // 2
    if check(mid):
        l = mid
    else:
        r = mid

print(r)

### FIXED CODE ###

from bisect import bisect_left, bisect_right

N, K = map(int, input().split())
As = sorted(map(int, input().split()))
        
l = - (10 ** 18 + 10)
r = 10 ** 18 + 10
while True:
    mid = (l + r) // 2
    count = 0
    for i, A in enumerate(As):
        if A > 0:
            count += bisect_right(As, mid//A, lo = i+1) - (i+1)
        elif A < 0:
            count += N - bisect_left(As, -((-mid)//A), lo = i+1)
        else:
            if mid >= 0:
                count += N - i - 1
    if count < K:
        l = mid
    else:
        r = mid
    if r - l == 1:
        break

print(r)
### BUGGY CODE ###

import math

N=int(input())

a=math.ceil(math.sqrt(N))

for i in range(a,((N+1)//2+1)):
  if N%i==0:
    r=N//i
    print(max(len(str(i)),len(str(r))))
    exit()
print(len(str(N)))

### FIXED CODE ###

import math
 
N=int(input())
 
a=math.floor(math.sqrt(N))
 
for i in range(a,0,-1):
  if N%i==0:
    r=N//i
    print(max(len(str(i)),len(str(r))))
    exit()

print(len(str(N)))
### BUGGY CODE ###

# -*- coding:utf-8 -*-

result = list()

def operation(command):
    if command[0] == "insert":
        result.insert(0, int(command[1]))
    elif command[0] == "delete":
        if int(command[1]) in result:
            result.remove(int(command[1]))
    elif command[0] == "deleteFirst":
        del result[0]
    elif command[0] == "deleteLast":
        result.pop()

n = int(input())
for i in range(n):
    command = input().split()
    operation(command)
print(*result)

### FIXED CODE ###

# -*- coding:utf-8 -*-

from collections import deque

result = deque()

def operation(command):
    if command[0] == "insert":
        result.appendleft(command[1])
    elif command[0] == "delete":
        if command[1] in result:
            result.remove(command[1])
    elif command[0] == "deleteFirst":
        result.popleft()
    elif command[0] == "deleteLast":
        result.pop()

n = int(input())
for i in range(n):
    command = input().split()
    operation(command)
print(*result)
### BUGGY CODE ###

N, M = map(int, input().split())

G1 = []
GN =[]

for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        G1.append(b)
    elif b == 1:
        G1.append(a)
    elif a == N:
        GN.append(b)
    elif b == N:
        GN.append(a)

res = False

for obj in G1:
    if obj in GN:
        res = True
        break


if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

N, M = map(int, input().split())

G = {i: [] for i in range(1, N + 1)}

for i in range(M):
    a, b = map(int, input().split())
    if a == 1 or a == N or b == 1 or b == N:
        G[a].append(b)
        G[b].append(a)

res = False

for i in range(2, N):
    if 1 in G[i] and N in G[i]:
        res = True
        break


if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
v = 1
for i in range(n):
  v *= a[i]
if v > 1000000000000000000:
  print(-1)
else:
  print(v)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
if 0 in a:
  print(0)
  exit()
v = 1
for i in range(n):
  v *= a[i]
  if v>1000000000000000000:
    print(-1)
    exit()
if v > 1000000000000000000:
  print(-1)
else:
  print(v)
### BUGGY CODE ###

n ,x, y = map(int, input().split())
degree_all = []
for i in range(n):
    degree_all.append([float('inf')]*n)
for i in range(n):
    degree_all[i][i] = 0
    if i != n-1:
        degree_all[i][i+1] = 1
        degree_all[i+1][i] = 1

for i in range(n):
    for j in range(i+1, n):
        degree_all[i][j] = min(abs(j-i), abs(x-1-i)+1+abs(j-y+1), abs(y-1-i)+1+abs(j-x+1))
sub_degree = [0]*n
for i in range(n-1):
    for j in range(i+1, n):
        sub_degree[degree_all[i][j]-1] +=1
        #print(degree_all[i][j])
#print("aaaa")
for i in range(n-1):
    print(sub_degree[i])


### FIXED CODE ###

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

ans = [0]*N

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

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