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

n=int(input())
a=list(map(int,input().split()))
s=[a[0]]
for i in range(1,n):
    s.append(s[-1]+a[i])

def f(c,i):
    global n,a,s
    return abs(s[c]-(s[i]-s[c]))

def g(c,i):
    global n,a,s
    return abs((s[c]-s[i])-(s[n-1]-s[c]))

ans=[]
for i in range(1,n-2):
    ans_=[]
    #左側決める
    l,r=0,i
    while l+2<r:
        c1=(l*2+r)//3
        c2=(l+2*r)//3
        if f(c1,i)>f(c2,i):
            l=c1
        else:
            r=c2
    x=sorted([(f(j,i),j) for j in range(l,r+1)])[0][1]
    ans_.append(s[x])
    ans_.append(s[i]-s[x])

    #右側決める
    l,r=i+1,n-1
    while l+2<r:
        c1=(l*2+r)//3
        c2=(l+2*r)//3
        if g(c1,i)>g(c2,i):
            l=c1
        else:
            r=c2
    x=sorted([(g(j,i),j) for j in range(l,r+1)])[0][1]
    ans_.append(s[x]-s[i])
    ans_.append(s[n-1]-s[x])

    ans.append(max(ans_)-min(ans_))
print(min(ans))

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
s=[a[0]]
for i in range(1,n):
    s.append(s[-1]+a[i])

def f(c,i):
    global n,a,s
    return abs(s[c]-(s[i]-s[c]))

def g(c,i):
    global n,a,s
    return abs((s[c]-s[i])-(s[n-1]-s[c]))

ans=[]
for i in range(1,n-2):
    ans_=[]
    #左側決める
    l,r=0,i
    while l+2<r:
        c1=(l*2+r)//3
        c2=(l+2*r)//3
        if f(c1,i)>f(c2,i):
            l=c1
        else:
            r=c2
    x=sorted([(f(j,i),j) for j in range(l,r+1)])[0][1]
    ans_.append(s[x])
    ans_.append(s[i]-s[x])

    #右側決める
    l,r=i+1,n-1
    while l+2<r:
        c1=(l*2+r)//3
        c2=(l+2*r)//3
        if g(c1,i)>g(c2,i):
            l=c1
        else:
            r=c2
    x=sorted([(g(j,i),j) for j in range(l,r+1)])[0][1]
    ans_.append(s[x]-s[i])
    ans_.append(s[n-1]-s[x])

    ans.append(max(ans_)-min(ans_))
print(min(ans))
### BUGGY CODE ###

n=int(input())
a=[-1]
for _ in range(n):
    x=int(input())
    if a[-1]>=x:
        a.append(x)
    else:
        for i in range(len(a)):
            if a[i]<x:
                a[i]=x
                break
print(len(a))

### FIXED CODE ###

import bisect
n=int(input())
h=[]
for i in range(n):
  a=int(input())
  if len(h)==0:
    h.append(-1*a)
  elif (-1)*a>=h[-1]:
    h.append(-1*a)
  else:
    index=bisect.bisect_right(h,-1*a)
    h[index]=-1*a
print(len(h))
### BUGGY CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W, M = LI()
    hw = [tuple(LI()) for _ in range(M)]

    cnt_h = collections.Counter([h for h, w in hw])
    cnt_w = collections.Counter([w for h, w in hw])

    max_h = max(cnt_h.values())
    max_w = max(cnt_w.values())
    max_h_k = [k for k, v in cnt_h.items() if v == max_h]
    max_w_k = [k for k, v in cnt_w.items() if v == max_w]

    # 縦横のターゲット数最大の座標に置く
    # そのような座標がターゲット上ならば、縦横ターゲット数から1を引く
    is_on_target = True
    for i, j in itertools.product(max_h_k, max_w_k):
        if (i, j) not in hw:
            is_on_target = False
            break

    if is_on_target:
        ans = max_h + max_w - 1
    else:
        ans = max_h + max_w
    print(ans)

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W, M = LI()
    hw = [LI() for _ in range(M)]
    hw_set = set([(h, w) for h, w in hw])

    cnt_h = collections.Counter([h for h, w in hw])
    cnt_w = collections.Counter([w for h, w in hw])

    # i行目にはどの列にあります
    # print(cnt_h)
    # print(cnt_w)
    max_h = max(cnt_h.values())
    max_w = max(cnt_w.values())
    max_h_k = [k for k, v in cnt_h.items() if v == max_h]
    max_w_k = [k for k, v in cnt_w.items() if v == max_w]
    is_on_target = True
    for i, j in itertools.product(max_h_k, max_w_k):
        if (i, j) not in hw_set:
            is_on_target = False
            break

    if is_on_target:
        ans = max_h + max_w - 1
    else:
        ans = max_h + max_w
    print(ans)

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

import copy
H, W = map(int, input("").split(" "))

whites = []
grid = []
for i in range(H):
    row = list(input(""))
    grid.append(row)

    for idx, r in enumerate(row):
        if r == ".":
            whites.append([i,idx])

c = 0
next_state = copy.deepcopy(grid)
while len(whites) > 0:
    c += 1

    next_whites = []
    while len(whites) > 0:
        w = whites.pop()

        top = w[0]-1
        bottom = w[0]+1
        left = w[1]-1
        right = w[1]+1

        flag = False
        if top >= 0:
            if grid[top][w[1]] == "#":
                next_state[w[0]][w[1]] = "#"
                flag = True
        if bottom < H:
            if grid[bottom][w[1]] == "#":
                next_state[w[0]][w[1]] = "#"
                flag = True
        if left >= 0:
            if grid[w[0]][left] == "#":
                next_state[w[0]][w[1]] = "#"
                flag = True
        if right < W:
            if grid[w[0]][right] == "#":
                next_state[w[0]][w[1]] = "#"
                flag = True

        if not flag:
            next_whites.append(w)

    whites = next_whites.copy()
    grid = copy.deepcopy(next_state)

print(c)

### FIXED CODE ###

H, W = map(int, input("").split(" "))

grid = []
blacks = []
for i in range(H):
    row = list(input(""))
    grid.append(row)

    for idx, r in enumerate(row):
        if r == "#":
            blacks.append((i, idx))

c = 0
while len(blacks) > 0:
    c += 1

    new_blacks = []
    for b in blacks:
        top = b[0] - 1
        bottom = b[0] + 1
        left = b[1] - 1
        right = b[1] + 1

        if top >= 0:
            if grid[top][b[1]] == ".":
                grid[top][b[1]] = "#"
                new_blacks.append((top, b[1]))
        if bottom < H:
            if grid[bottom][b[1]] == ".":
                grid[bottom][b[1]] = "#"
                new_blacks.append((bottom, b[1]))
        if left >= 0:
            if grid[b[0]][left] == ".":
                grid[b[0]][left] = "#"
                new_blacks.append((b[0], left))
        if right < W:
            if grid[b[0]][right] == ".":
                grid[b[0]][right] = "#"
                new_blacks.append((b[0], right))

    blacks = new_blacks

print(c - 1)
### BUGGY CODE ###

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

n,t = map(int, raw_input().split())
a = map(int, raw_input().split()) 

l,r = 0,0
diff = 0
num = 0
lp = 0
for l in range(n):
    if(a[lp]<a[l]):
        pass
    else:
        for r in range(l+1,n):
            #print(l,r)
            if(a[r]-a[l]>diff):
                lp = l
                diff = a[r]-a[l]
                num = 1
            elif(a[r]-a[l]==diff):
                num += 1
print(num)
            
 


### FIXED CODE ###

# -*- coding: utf-8 -*-
 
n,t = map(int, raw_input().split())
a = map(int, raw_input().split()) 
 
m = 10**9+1
num = 0
diff = 0
for i in range(n):
    if(a[i]<m):
        m = a[i]
    if(a[i]-m > diff):
        diff = a[i]-m
        num = 1
    elif(a[i]-m == diff):
        num += 1
print(num)
### BUGGY CODE ###


def bscount(nums):
    """count the number of inversions (ai > aj and i < j)
    in a sequence of ints num.

    Count number of inversions using sorted list of 0..k

    >>> bscount([3, 5, 2, 1, 4])
    6
    >>> bscount([10, 2, 9, 4, 6, 5, 7, 8, 3, 1])
    29
    """
    def binsearch(li, n, e):
        i, j = 0, n-1
        while i <= j:
            mid = (i + j) // 2
            if li[mid] > e:
                j = mid - 1
            elif li[mid] < e:
                i = mid + 1
            else:
                i = mid
                break
        return i

    snums = []
    length = 0
    invs = 0

    for n in nums:
        i = binsearch(snums, length, n)
        invs += length - i
        snums.insert(i, n)
        length += 1

    return invs


def run():
    _ = int(input())  # flake8: noqa
    nums = [int(i) for i in input().split()]

    print(bscount(nums))


if __name__ == '__main__':
    run()



### FIXED CODE ###

def count(nums):
    """count the number of inversions (ai > aj and i < j)
    in a sequence of ints num.

    >>> count([3, 5, 2, 1, 4])
    6
    >>> count([10, 2, 9, 4, 6, 5, 7, 8, 3, 1])
    29
    """
    def _count(i, j):
        if i < j:
            mid = (i + j) // 2
            i1, li1 = _count(i, mid)
            i2, li2 = _count(mid+1, j)

            return _merge(li1, li2, i1 + i2)
        else:
            return (0, nums[i:i+1])

    def _merge(li1, li2, invs):
        i = j = 0
        result = []
        sums = inv = 0
        while i < len(li1) and j < len(li2):
            if li1[i] > li2[j]:
                result.append(li2[j])
                inv += 1
                j += 1
            else:
                result.append(li1[i])
                invs += sums + inv
                sums += inv
                inv = 0
                i += 1

        while i < len(li1):
            result.append(li1[i])
            invs += sums + inv
            sums += inv
            inv = 0
            i += 1
        if j < len(li2):
            result.extend(li2[j:])

        return (invs, result)

    invs, _ = _count(0, len(nums))
    return invs

def run():
    _ = int(input())  # flake8: noqa
    nums = [int(i) for i in input().split()]

    print(count(nums))


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

li = list(map(int,input().split()))
k = li[0]
s = li[1]
cnt =0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s:
                cnt+=1
print(cnt)

### FIXED CODE ###

# ABC 051 B - Sum of Three Integers　
k, s = map(int, input().split())
cnt =0
for x in range(k+1):
    for y in range(k+1):
        z = s-x-y
        if 0<= z <= k: 
            cnt+=1
print(cnt)
### BUGGY CODE ###

N = int(input())
A = [int(i) for i in input().split()]

def attack(A):
  A = list(set(A))
  if min(A) ==0:
    A.pop(A.index(min(A)))
  attack_mons = min(A)
  attack_mons_index = A.index(min(A))
  new_A = []
  for i in range(len(A)):
    if i != attack_mons_index:
      new_A.append(A[i]%min(A))
    else:
      new_A.append(A[i])
  return new_A

new_A = attack(A)
while A!=new_A:
  A = new_A
  new_A = attack(new_A)

print(min(new_A))


### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]

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

ans = A[0]

for a in A:
  ans = gcd(ans,a)

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

def resolve():
    S = list(input())
    MOD = 10**9+7
    dp = [[0 for _ in range(13)] for __ in range(len(S)+1)]
    dp[0][0] = 1
    for i in range(len(S)):
        for j in range(13):
            if S[i] == "?":
                for k in range(10):
                    dp[i+1][(j*10+k)%13] += dp[i][j]
                    if dp[i+1][(j*10+k)%13] > MOD:
                        dp[i+1][(j*10+k)%13] -= MOD
            else:
                k = int(S[i])
                dp[i+1][(j*10+k)%13] += dp[i][j]
                if dp[i+1][(j*10+k)%13] > MOD:
                    dp[i+1][(j*10+k)%13] -= MOD
    print(dp[len(S)][5])

if '__main__' == __name__:
    resolve()

### FIXED CODE ###

def resolve():
    S = list(input())
    MOD = 10**9+7
    dp = [[0 for _ in range(13)] for __ in range(len(S)+1)]
    dp[0][0] = 1
    for i in range(len(S)):
        for j in range(13):
            if S[i] == "?":
                for k in range(10):
                    dp[i+1][(j*10+k)%13] += dp[i][j]
                    if dp[i+1][(j*10+k)%13] > MOD:
                        dp[i+1][(j*10+k)%13] -= MOD
            else:
                k = int(S[i])
                dp[i+1][(j*10+k)%13] += dp[i][j]
                if dp[i+1][(j*10+k)%13] > MOD:
                    dp[i+1][(j*10+k)%13] -= MOD
    print(dp[len(S)][5])

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

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m = list(map(int, input().split()))
from collections import defaultdict
ns = defaultdict(set)
for _ in range(m):
    u,v = map(int, input().split())
    u -= 1
    v -= 1
    ns[u].add(v)
    ns[v].add(u)
dp = [[(-1,0)]*n for _ in range(11)]
q = int(input())
qs = [None]*q
for i in range(q):
    v,d,c = tuple(map(int, input().split()))
    v -= 1
    qs[i] = (i,v,d,c)
from itertools import product
for i0,i,u in product(range(10,-1,-1), range(0,11), range(n)):
# for i0 in range(10, -1, -1):
    if i==0:
        for i,v,d,_ in qs:
            if i0<=d:
                dp[0][v] = (i,d)
    else:
#     for i in range(1,11):
#         for u in range(n):
        if dp[i-1][u][0]>dp[i][u][0]:
            ind0, d0 = dp[i-1][u]
        else:
            ind0, d0 = dp[i][u]
        for v in ns[u]:
            ind,d = dp[i-1][v]
            if ind>ind0 and d>0:# and i0<=i+d:
                ind0, d0 = ind, d-1
        dp[i][u] = (ind0, d0)
#     print(dp[10])
write("\n".join(map(str, ((qs[dp[10][u][0]][3] if dp[10][u][0]>=0 else 0) for u in range(n)))))

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

n,m = list(map(int, input().split()))
from collections import defaultdict
ns = defaultdict(list)
for _ in range(m):
    u,v = map(int, input().split())
    u -= 1
    v -= 1
    ns[u].append(v)
    ns[v].append(u)
    
dp = [[-1]*n for _ in range(11)]
q = int(input())
qs = [None]*q
for i in range(q):
    v,d,c = tuple(map(int, input().split()))
    v -= 1
    qs[i] = (i,v,d,c)
    dp[d][v] = i
from itertools import product
for i,u in product(range(10,0,-1), range(n)):
    if dp[i][u]>=0:
        dp[i-1][u] = max(dp[i-1][u], dp[i][u])
        for v in ns[u]:
            dp[i-1][v] = max(dp[i-1][v], dp[i][u])

write("\n".join(map(str, ((qs[dp[0][u]][3] if dp[0][u]>=0 else 0) for u in range(n)))))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
dp = [False]*(k+1)

for i in range(1,k+1):
  for j in range(n):
    if i-a_list[j] >= 0:
      dp[i] |= not(dp[i-a_list[j]])


if dp[k]:
  print('First')
else:
  print('Second')

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
  n, k = map(int, input().split())
  a_list = list(map(int, input().split()))
  dp = [False]*(k+1)

  for i in range(1,k+1):
    for j in range(n):
      if i-a_list[j] >= 0:
        dp[i] |= not(dp[i-a_list[j]])


  if dp[k]:
    print('First')
  else:
    print('Second')
main()
### BUGGY CODE ###

from collections import deque

def solve():
  h,w=map(int,input().split())
  cy,cx=map(int,input().split())
  dy,dx=map(int,input().split())

  M=[]
  for i in range(2):
    M.append("#"*(w+4))
  for i in range(h):
    M.append("##"+input()+"##")
  for i in range(2):
    M.append("#"*(w+4))

  INF=10**6
  C=[[INF for _ in range(w+4)] for _ in range(h+4)]
  C[-~cy][-~cx]=0
  QA,QB=deque(),deque()
  QA.append((-~cy,-~cx,0))
  W=[[i,j] for i in range(-2,3) for j in range(-2,3) if abs(i)+abs(j)>1]

  while QA:
    h,w,c=QA.popleft()
    for i,j in [[1,0],[0,1],[-1,0],[0,-1]]:
      if M[h+i][w+j]=='#':
        QB.append((h,w,c))
        break

    for i,j in [[1,0],[0,1],[-1,0],[0,-1]]:
      dh,dw=h+i,w+j
      if M[dh][dw]=="." and c<C[dh][dw]:
        C[dh][dw]=c
        QA.appendleft((dh,dw,c))

    if QA:
      continue

    while QB:
      h,w,c=QB.popleft()
      for i,j in W:
        dh,dw=h+i,w+j
        if M[dh][dw]=="." and -~c<C[dh][dw]:
          C[dh][dw]=-~c
          QA.append((dh,dw,-~c))

  print(C[-~dy][-~dx] if C[-~dy][-~dx]!=INF else -1)

if __name__ == "__main__":
  solve()


### FIXED CODE ###

from collections import deque

def main():
  h,w=map(int,input().split())
  cy,cx=map(int,input().split())
  dy,dx=map(int,input().split())

  M=["##"+input()+"##" for x in range(h)]
  for i in range(2):
    M.insert(0,"#"*(w+4))
    M.append("#"*(w+4))

  C=[[-1 if M[j][i]=="." else -2 for i in range(w+4)] for j in range(h+4)]
  C[-~cy][-~cx]=0
  QA,QB=deque(),deque()
  QA.append((-~cy,-~cx,0))
  W=[[i,j] for i in range(-2,3) for j in range(-2,3) if abs(i)+abs(j)>1]

  while QA:
    h,w,c=QA.popleft()
    QB.append((h,w,c))

    for i,j in [[1,0],[0,1],[-1,0],[0,-1]]:
      dh,dw=h+i,w+j
      if C[dh][dw]==-1:
        C[dh][dw]=c
        QA.appendleft((dh,dw,c))

    if QA:
      continue

    while QB:
      h,w,c=QB.popleft()
      for i,j in W:
        dh,dw=h+i,w+j
        if C[dh][dw]==-1:
          C[dh][dw]=-~c
          QA.append((dh,dw,-~c))

  print(C[-~dy][-~dx])

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

#n,a,b
n,a,b=(int(x) for x in input().split())

ans = 0
count = 0
while(n>0):
    n -= a
    if n >= 0:
        ans += a
    else:
        ans += a + n
    n -= b
    count += 1
print(ans)

### FIXED CODE ###

import math

#n,a,b
n,a,b=(int(x) for x in input().split())

allcount = math.floor(n/(a+b))
if a < n - allcount * (a+b):
    nokori = a
else:
    nokori = n - allcount * (a+b)
ans = allcount * a + nokori
print(ans)

"""
ans = 0
count = 0
while(n>0 and count<=10000):
    n -= a
    if n >= 0:
        ans += a
    else:
        ans += a + n
    n -= b
    count += 1
print(ans)
"""
### BUGGY CODE ###

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

#print(N,A)

d = {}
for a in A:
  d[a] = d.get(a, 0) + 1

for i in range(N):
  tmp_d = d.copy()
  tmp_d[A[i]] -= 1
  sum = 0
  for v in tmp_d.values():
    sum += int(v*(v-1)/2)
  print(sum)


### FIXED CODE ###

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

d = {}
for a in A:
  d[a] = d.get(a, 0) + 1
sum = sum([v*(v-1)/2 for v in d.values()]) 

for i in range(N):
  print(int(sum-d[A[i]]+1))
### BUGGY CODE ###

N,K,Q = map(int,input().split())
A = list(map(int,input().split()))
B = sorted(A) # A をソート
L = [[i,B[i+Q-1] - B[i]] for i in range(N-Q+1)] # BからX-Yの最小パターンを出す
sL = sorted(L,key=lambda x:x[1]) # Lをソート

if Q == 1:
    # 一つしか選ばない -> max == min -> 0
    print(0)
    exit()

if Q == N - K + 1:
    # 全部の要素が選ばれる = 必ず最小値が選ばれる
    print(L[0][1])
    exit()

if K == 1:
    # 一つずつ選べる -> 必ず最小のパターンに出来る
    print(sL[0][1])
    exit()

if sL[0][0] == 0:
    # minが最小の時 最小のパターンになる時
    print(sL[0][1])
    exit()

if sL[0][1] == sL[len(sL)-1][1]:
    print(sL[0][1])
    exit()


for key,value in sL:
    max_value = B[key + Q - 1]
    min_value = B[key]
    C = [(i if i >= min_value else None) for i in A]
    i = 0
    j = 0
    count = 0
    min_OK = max_OK = False
    while i < N:
        if not C[i]:
            i += 1
            continue
        j = i + 1
        while j < N:
            if not C[j]:
                break
            j += 1
        tmp = (j-i) - K + 1
        if  tmp < 1:
            # 要素を取得できないパターン
            continue
        sC = sorted(C[i:j])
        if not min_OK and (sC[0] == min_value):
            min_OK = True
        if not max_OK and max_value in sC[0:tmp]:
            max_OK = True
        count += tmp - len([i for i in sC[:tmp] if i > max_value])
        i = j +1
    if min_OK and max_OK and (count >= Q):
        print(value)
        exit()

print(L[0][1])



### FIXED CODE ###

N,K,Q = map(int,input().split())
A = list(map(int,input().split()))
B = sorted(A) # A をソート
L = [[i,B[i+Q-1] - B[i]] for i in range(N-Q+1)] # BからX-Yの最小パターンを出す
sL = sorted(L,key=lambda x:x[1]) # Lをソート

if Q == 1:
    # 一つしか選ばない -> max == min -> 0
    print(0)
    exit()

if Q == N - K + 1:
    # 全部の要素が選ばれる = 必ず最小値が選ばれる
    print(L[0][1])
    exit()

if K == 1:
    # 一つずつ選べる -> 必ず最小のパターンに出来る
    print(sL[0][1])
    exit()

if sL[0][0] == 0:
    # minが最小の時 最小のパターンになる時
    print(sL[0][1])
    exit()

if sL[0][1] == sL[len(sL)-1][1]:
    print(sL[0][1])
    exit()

now_max_value = -1
now_min_value = -1
now_min_XY = int(1e10)

for key,value in sL:
    max_value = B[key + Q - 1]
    min_value = B[key]
    C = [(i if i >= min_value else None) for i in A]
    i = 0
    j = 0
    count = 0
    min_OK = max_OK = False
    while i < N:
        if not C[i]:
            i += 1
            continue
        j = i + 1
        while j < N:
            if not C[j]:
                break
            j += 1
        tmp = (j-i) - K + 1
        if  tmp < 1:
            # 要素を取得できないパターン
            #if min(C[i:j]) < max_value:
            #    count = 0
            #    break
            i = j + 1
            continue
        sC = sorted(C[i:j])
        if not min_OK and (sC[0] == min_value):
            min_OK = True
        if not max_OK and max_value in sC[0:tmp]:
            max_OK = True
        #if sC[tmp] < max_value:
        #    count = 0
        #    break
        count += tmp - len([i for i in sC[:tmp] if i > max_value])
        i = j +1
    if min_OK and max_OK and (count >= Q):
        print(value)
        exit()
    now_min_XY = min(now_min_XY,now_max_value - now_min_value)
    now_max_value = -1
    now_min_value = -1

print(L[0][1])
### BUGGY CODE ###

def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    a=[]
    b=[]
    for i in range(m):
        al,bl=map(int,input().split())
        a=appen(a,al)
        b=appen(b,bl)
    res=0
    for i in range(1,n+1):
        xx=[]
        for j in range(m):
            if i==a[j]:
                xx=appen(xx,h[b[j]-1])
            if i==b[j]:
                xx=appen(xx,h[a[j]-1])
        if len(xx)==0:
            res+=1
        elif ma(xx)<h[i-1]:
            res+=1
        else:
            continue
    print(res)
    

if __name__ == '__main__':
    main()

### FIXED CODE ###

def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    res=0
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    
    a=[list(map(int,input().split())) for i in range(m)]
    f=[]
    for i in range(n):
        f.append([0])
    for i in a:
        f[i[0]-1].append(h[i[1]-1])
        f[i[1]-1].append(h[i[0]-1])
    p=-1
    for i in f:
        p+=1
        if len(i)==1:
            res+=1
        elif ma(i)<h[p]:
            res+=1
        else:
            continue

    print(res)

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

import copy

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

for i in range(n):
    b = copy.deepcopy(a)
    b.pop(i)
    print(max(b))

### FIXED CODE ###

import copy

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

m_1 = sorted(a)[-1]
m_2 = sorted(a)[-2]

for i in range(n):
    if a[i] == m_1:
        print(m_2)
    else:
        print(m_1)
### BUGGY CODE ###

n,x,y=map(int,input().split())
x-=1
y-=1
ans=[0 for i in range(n)]
for ni in range(n):
    d=[100000 for i in range(n)]
    q=[]
    q.append(ni)
    d[ni]=0
    while q:
        p=q.pop()
        if(p>0 and d[p-1]>d[p]+1):
            q.append(p-1)
            d[p-1]=d[p]+1
        if(p<n-1 and d[p+1]>d[p]+1):
            q.append(p+1)
            d[p+1]=d[p]+1

        if(p==x and d[y]>d[x]+1):
            q.append(y)
            d[y]=d[x]+1
        if(p==y and d[x]>d[y]+1):
            q.append(x)
            d[x]=d[y]+1

    for i in range(n):ans[d[i]]+=1
for i in range(1,n):print(ans[i]//2)

### FIXED CODE ###

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

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