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

# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N=int(input())
    P=list(map(int,input().split()))

    cnt=0
    for i in range(N):
        if all(j >=P[i] for j in P[:i]):
            cnt+=1
    print(cnt)


resolve()

### FIXED CODE ###

def resolve():

    N=int(input())
    P=list(map(int,input().split()))
    pmin=P[0]
    cnt=0
    for i in range(N):
        if P[i]<=pmin:
            cnt+=1
            pmin=P[i]
    print(cnt)

resolve()
### BUGGY CODE ###

n,t=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]


rieki=0
count=0
for ind,i in enumerate(A):
    lst=A[:ind+1]
    if(ind==len(A)-1):
        break
    elif(A[ind+1]-min(lst) == rieki):
        count+=1
    elif(A[ind+1]-min(lst) >= rieki):
        rieki=A[ind+1]-min(lst)
        count=1


print(count)


### FIXED CODE ###

n,t=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]

c=0
dif=0
m=a[0]
for i in range(1,n):
    if(m>a[i]):
        m=a[i]
    if(dif<a[i]-m):
        c=1
        dif=a[i]-m
    elif(dif==a[i]-m):
        c+=1
print(c)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10000000)

N, Q = [int(x) for x in input().split()]

V = [set() for _ in range(N)]
for _ in range(N - 1):
    a, b = [int(x) for x in input().split()]
    a -= 1
    b -= 1
    V[a].add(b)

C = [0] * N

for _ in range(Q):
    p, x = [int(x) for x in input().split()]
    p -= 1
    C[p] += x

ANS = [0] * N


def dfs(n, val):
    ANS[n] += (val + C[n])
    for next in V[n]:
        dfs(next, val + C[n])


def main():
    dfs(0, 0)
    print(" ".join([str(x) for x in ANS]))

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

sys.setrecursionlimit(10000000)

N, Q = [int(x) for x in input().split()]
# V = [set() for _ in range(N)]
V = [[] for _ in range(N)]
for _ in range(N - 1):
    a, b = [int(x) for x in input().split()]
    a -= 1
    b -= 1
    # V[a].add(b)
    V[a].append(b)

C = [0] * N

for _ in range(Q):
    p, x = [int(x) for x in input().split()]
    p -= 1
    C[p] += x

ANS = [0] * N


def dfs(n, val):
    ANS[n] += (val + C[n])
    for next in V[n]:
        dfs(next, val + C[n])


def main():
    dfs(0, 0)
    print(" ".join([str(x) for x in ANS]))


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

n,k = list(map(int, input().split()))
h = list(map(int, input().split()))

for _ in range(k):
    h.insert(0, float("inf"))

dp = [0 for _ in range(n+k)]

for i in range(k, n+k-1):
    s1 = []
    for j in range(k):
        s1.append(dp[i-j] + abs(h[i+1] - h[i-j]))
    dp[i+1] = min( s1 )

print(dp[-1])

### FIXED CODE ###

n,k = list(map(int, input().split()))
h = list(map(int, input().split()))

for _ in range(k):
    h.insert(0, float("inf"))

dp = [0 for _ in range(n+k)]

for i in range(k, n+k-1):
    s1 = []
    for j in range(k):
        s1.append(dp[i-j] + abs(h[i+1] - h[i-j]))
    dp[i+1] = min( s1 )

print(dp[-1])
### BUGGY CODE ###

import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


def is_ok(n, k, a):
    res = []
    # O(n - k)
    for i in range(k - 1, n):
        mul = 1
        # O(k)
        for j in range(i - k+1, i + 1):
            mul *= a[j]
        res.append(mul)
    return res


n, k = LI()
a = LI()
base = 1
for elem in a[:k]:
    base *= elem
# print(base)
for i in range(k, n):
    # print(f'{i=}')
    # print(f'{i-k=}, {a[i-k]=}')
    # print(base, (base//a[i - k]) * a[i])
    if base < (base//a[i - k]) * a[i]:
        ans = 'Yes'
    else:
        ans = 'No'
    base = (base//a[i - k]) * a[i]
    print(ans)


### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n, k = LI()
a = LI()
base = 1
for i in range(k, n):
    rate = a[i] / a[i-k]
    if rate > 1:
        ans = 'Yes'
    else:
        ans = 'No'
    print(ans)
### BUGGY CODE ###

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

n = int(input())
l = [int(i) for i in input().split()]
l.sort()

count = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        m = l[i] + l[j]
        # j+1~n-1まで二分探索
        low = j+1
        high = n-1
        index = j
        while low <= high:
            mid = (low + high) // 2
            if m > l[mid]:
                low = mid + 1
                index = mid
            else:
                high = mid - 1
        if index != j:
            count += index - (j+1) + 1

print(count)


### FIXED CODE ###

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

import bisect

n = int(input())
l = [int(i) for i in input().split()]
l.sort() # 二分探索するために整列

# l[i]+l[j]>l[x]を満たすxは
# 昇順に整列した配列を使うと
# 固定した2本の次のインデックスから必ず連続している
# そのため条件を満たす最大のxを二分探索で求めれば良い

count = 0
# 2本を固定して
for i in range(n-2):
    for j in range(i+1, n-1):
        # 3本目を探索
        index = bisect.bisect_left(l, l[i]+l[j])
        count += index - (j+1)

print(count)
### BUGGY CODE ###

N, Q = list(map(int, input().split()))
s = input()
golem = [1] * N
for _ in range(Q):
    t, d = input().split()
    if d == 'L':
        for i, c in enumerate(s):
            if c == t:
                if i > 0:
                    golem[i-1] += golem[i]
                    golem[i] = 0
                else:
                    golem[i] = 0
    else:
        for i, c in enumerate(s):
            if c == t:
                if i < N-1:
                    golem[i+1] += golem[i]
                    golem[i] = 0
                else:
                    golem[i] = 0
print(sum(golem))


### FIXED CODE ###

def can_reach_to_0(s, comm, pos):
    for t, d in comm:
        if s[pos] == t:
            if d == 'L':
                pos -= 1
            else:
                pos += 1
        if pos < 0:
            return True
        if pos >= N:
            return False
    return False

def can_reach_to_N(s, comm, pos):
    N = len(s)
    for t, d in comm:
        if s[pos] == t:
            if d == 'L':
                pos -= 1
            else:
                pos += 1
        if pos >= N:
            return True
        if pos < 0:
            return False
    return False

N, Q = list(map(int, input().split()))
s = input()
comm = [input().split() for _ in range(Q)]

l = 0
r = N-1
while l <= r:
    mid = int((l+r)/2)
    if can_reach_to_0(s, comm, mid):
        l = mid + 1
    else:
        r = mid - 1
left = r # いける右端index

l = 0
r = N-1
while l <= r:
    mid = int((l+r)/2)
    if can_reach_to_N(s, comm, mid):
        r = mid - 1
    else:
        l = mid + 1
right = l # いける左端index
print(right-left-1)
### BUGGY CODE ###

import sys

def main():

    # sys.stdin = open('input148d.txt')

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

    ni = n
    comp = True
    while comp:
        comp = False
        for j in range(n):
            if a[j] != j + 1:
                a.pop(j)
                n -= 1
                comp = True
                break

   
    if n == 0:
        print(-1)
    else:
        print(ni - n)
            
if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def main():

    # sys.stdin = open('input148d.txt')

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

    i = 1
    r = 0
    for j in range(n):
        if a[j] == i:
            i += 1
        else:
            r += 1

   
    if r == n:
        print(-1)
    else:
        print(r)
            
if __name__ == '__main__':
    main()
### BUGGY CODE ###

N, M = map(int, input().split())
A = [int(i) for i in input().split()]
B = [0] * M
C = [0] * M

X = []
for i in range(M):
    B[i], C[i] = map(int, input().split())
    for k in range(B[i]):
        X.append(C[i])


Z = A + X
Z.sort(reverse=True)
print(sum(Z[:N]))

### FIXED CODE ###

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
CB = []
for i in range(M):
    B, C = list(map(int, input().split()))
    CB.append([C, B])
 
A.sort()
A.reverse()
CB.sort()
CB.reverse()
 
ans = 0
a_index = 0
cb_index = 0
f = 0
 
while True:
    if f == 1 or A[a_index] >= CB[cb_index][0]:
        ans += A[a_index]
        a_index += 1
        N -= 1
        if N == 0:
            break
    else:
        if N <= CB[cb_index][1]:
            ans += CB[cb_index][0] * N
            break
        else:
            ans += CB[cb_index][0] * CB[cb_index][1]
            N -= CB[cb_index][1]
            cb_index += 1
            if len(CB) == cb_index:
              f = 1
 
print(ans)
### BUGGY CODE ###

n=int(input())
c=list(map(int,input().split()))
c.sort(reverse=1)
d=2**(n-2)
m=10**9+7
ans=0
k=1
for x in c:
  ans+=x*(k+1)*d
  ans%=m
  k+=1
ans=(int(ans)%m*(2**n))%m

print(int(ans))

### FIXED CODE ###

n=int(input())
c=list(map(int,input().split()))
c.sort(reverse=1)
m=10**9+7
d=(2**(n-2))%m
ans=0
k=2
for x in c:
  x=int(x%m)
  ans+=(x*k*d)%m
  k+=1
ans=(int(ans)%m*d*4)%m

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

N = int(input())
A = list(map(int, input().split()))
for j in range(len(A)):
    a = A[:j] + A[j+1:]
    total = abs(a[0])
    for i in range(0, len(a)-1):
        total += abs(a[i+1] - a[i])
    total += abs(a[-1])
    print(total)
    

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
total = abs(A[0]) + abs(A[1]-A[0])
lst = [abs(A[0]) + abs(A[1]-A[0]) - abs(A[1])]
for i in range(1, len(A)-1):
    total += abs(A[i+1] - A[i])
    lst += [abs(A[i+1] - A[i]) + abs(A[i] - A[i-1]) - abs(A[i+1] - A[i-1])]
total += abs(A[-1]) 
lst += [abs(A[-1]) + abs(A[-2]-A[-1])-abs(A[-2])]
for j in lst:
    print(total - j)
### BUGGY CODE ###

# seishin.py
from collections import deque
N, M = map(int, input().split())
r_min = [0]*(N+1); r_max = [N+1]*(N+1)
g_min = [0]*(N+1); g_max = [N+1]*(N+1)
free = [1]*(N+1)
C = [[] for i in range(N+1)]
for i in range(M):
    l, r, x = map(int, input().split())

    # 仮定: R < G < B を元に各r,gの値の範囲を絞り込む(B = rになるため計算しない)
    if x == 1:
        # x = 1の時、あるrに紐づく全てのl_iについて G < l_i を満たす必要がある
        # => G < min(l_i) を満たせばよい
        g_max[r] = min(g_max[r], l-1)
    elif x == 2:
        # x = 2の時、あるrに紐づく全てのl_iについて R < l_i, l_i <= G を満たす必要がある
        # => R < min(l_i), max(l_i) <= G を満たせばよい
        g_min[r] = max(g_min[r], l)
        r_max[r] = min(r_max[r], l-1)
    elif x == 3:
        # x = 3の時、あるrに紐づく全てのl_iについて l_i <= R を満たす必要がある
        # =>  max(l_i) <= R を満たせばよい
        r_min[r] = max(r_min[r], l)
    for j in range(l, r+1):
        free[j] = 0

def check(k, r, g, b):
    return (r_min[k] <= r <= r_max[k] and g_min[k] <= g <= g_max[k])

MOD = 10**9 + 7

# 左からk個置いた時、各色の最右の位置を持ってメモ化dfs
# r < g < b を維持して計算していく
memo = {}
def dfs(k, r, g, b):
    key = r, g, b
    if key in memo:
        return memo[key]
    if not check(k, r, g, b):
        # 制約を満たさない場合 => 0通り
        memo[key] = 0
        return 0
    if k == N:
        memo[key] = 1
        return 1
    if free[k]:
        # N = 300, M = 0の場合等だと制約が少なすぎて定数が落ちない
        # => 制約が疎である場合は、制約がかかってない部分で切って高速化
        res = memo[key] = (3 * dfs(k+1, k, k, b+1)) % MOD
    else:
        # r < g < b < k+1 なので、この関係を元に次のdfs()を計算
        res = memo[key] = (dfs(k+1, g, b, k+1) + dfs(k+1, r, b, k+1) + dfs(k+1, r, g, k+1)) % MOD
    return res
print(dfs(0, 0, 0, 0))


### FIXED CODE ###

MOD = 10**9 + 7
N, M = map(int, input().split())
S = [[N]*(N+1) for i in [0,1,2]]
T = [[0]*(N+1) for i in [0,1,2]]

C = [0]*(N+1)
for i in range(M):
    l, r, x = map(int, input().split())
    S[x-1][r] = min(S[x-1][r], l)
    T[x-1][r] = max(T[x-1][r], l)
    C[r] = 1

S0, S1, S2 = S
T0, T1, T2 = T

ok = 1
for i in range(N+1):
    if not T2[i] < S1[i] or not T1[i] < S0[i]:
        ok = 0
        break

if not ok:
    print(0)
    exit(0)


X = {(0, 0): 3}
for b in range(1, N):
    t2 = T2[b+1]; s1 = S1[b+1]; t1 = T1[b+1]; s0 = S0[b+1]
    check = lambda r, g: t2 <= r < s1 and t1 <= g < s0

    Z = [0]*(N+1)
    if C[b+1]:
        if t1 <= b < s0:
            for (r, g), v in X.items():
                if t2 <= g < s1:
                    # r <- b+1
                    Z[g] += v
                if t2 <= r < s1:
                    # g <- b+1
                    Z[r] += v
        X = {(r, g): v for (r, g), v in X.items() if t2 <= r < s1 and t1 <= g < s0}
    else:
        Z = [0]*(N+1)
        for (r, g), v in X.items():
            # r <- b+1
            Z[g] += v
            # g <- b+1
            Z[r] += v;
    for z, v in enumerate(Z):
        if v:
            X[z, b] = v % MOD
print(sum(X.values()) % MOD)
### BUGGY CODE ###

N = int(input())
A = map(int, input().split())
MOD = 10 ** 9 + 7

counts = [0] * 60
for a in A:
    for i in range(60):
        counts[i] += (a >> i) % 2

power2 = [1]
for _ in range(59):
    power2.append((power2[-1] * 2) % MOD)


ans = sum(c * (N - c) * power2[i] for i, c in enumerate(counts))

print(ans % MOD)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7

counts = [sum((a >> i) & 1 for a in A) for i in range(60)]

power2 = [1]
for _ in range(59):
    power2.append((power2[-1] * 2) % MOD)

ans = sum(c * (N - c) * power2[i] for i, c in enumerate(counts))

print(ans % MOD)
### BUGGY CODE ###

def main():
    
    N,W = map(int,input().split())
    w,v = [],[]
    for i in range(N):
        a,b = map(int,input().split())
        w.append(a)
        v.append(b)
    dp = [[0]*(W+1) for i in range(N+1)]

    for i in range(N):
        for j in range(W+1):
            if j-w[i] >= 0:
                dp[i+1][j] = max(dp[i][j-w[i]] + v[i], dp[i][j])
            else:
                dp[i+1][j] = max(dp[i+1][j], dp[i][j])
    #print(dp)
    print(dp[N][W])

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    
    N,W = map(int,input().split())
    w,v = [],[]
    for i in range(N):
        a,b = map(int,input().split())
        w.append(a)
        v.append(b)
    dp = [[0]*(W+1) for i in range(N+1)]

    for i in range(N):
        for j in range(W+1):
            if j-w[i] >= 0:
                dp[i+1][j] = max(dp[i][j-w[i]] + v[i], dp[i][j])
            else:
                dp[i+1][j] = max(dp[i+1][j], dp[i][j])
    #print(dp)
    print(dp[N][W])

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

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

while remain > 0:
  i = A.index(max(A))
  A[i] = A[i]//2
  remain -= 1
print(sum(A))


### FIXED CODE ###

import heapq
N,M=map(int,input().split())
A=list(map(int,input().split()))
A=[-i for i in A]

heapq.heapify(A)
for i in range(M):
    a=-heapq.heappop(A)
    heapq.heappush(A,-(a//2))
print(-sum(A))
### BUGGY CODE ###

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

point = 1
point_ = 1
for i in range(K):
	point *= A[i]

for i in range(N - K):
	for x in range(K):
		point_ *= A[i + x + 1]
	if point < point_:
		print("Yes")
	else:
		print("No")
	point = point_
	point_ = 1

### FIXED CODE ###

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


for i in range(N - K):
	point = A[i]
	point_ = A[i + K]
	if point < point_:
		print("Yes")
	else:
		print("No")
### BUGGY CODE ###

N = int(input())
L = sorted(list(map(int,input().split())))
ans = 0

for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if L[k]<L[i]+L[j]:
        ans+=1

print(ans)

### FIXED CODE ###

from bisect import *
N = int(input())
L = sorted(map(int,input().split()))
a = 0

for i in range(N):
  for j in range(i+1,N):
    a+=bisect_left(L,L[i]+L[j])-(j+1)
    
print(a)
### BUGGY CODE ###

n = int(input())
An = list(map(int, input().split()))
ans = 1

for i in An:
  ans = ans * i

if ans > 10 ** 18:
    print(-1)
else:
  print(ans)

### FIXED CODE ###

n = int(input())
An = list(map(int, input().split()))
ans = 1

if 0 in An:
  print(0)
  exit(0)

for i in An:
  ans = ans * i
  if ans > 10 ** 18:
    print(-1)
    exit(0)

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

import sys
input = sys.stdin.readline

N,M,V,P = map(int, input().split())
a = list(map(int, input().split()))
A = sorted(a)[::-1]
            
ans =P
first =1

for i in range(P,N):
    b = (V-((P-1)+(N-i)))
    target = A[i]+M
        
    if b<=0:
        if A[P-1]<=target:
            ans+=1
    else:
        if target<A[P-1]:
            break
        if first==1:
            Q_sum=sum(A[P-1:i])
            len_Q =i-(P-1)
        else:
            Q_sum+=A[i-1]
            len_Q+=1
        if target*len_Q-Q_sum>=b*M:
            ans+=1
        else:
            break
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N,M,V,P = map(int, input().split())
a = list(map(int, input().split()))
A = sorted(a)[::-1]
           
right = P-1
left = N

while left - right !=1:
    
    i = (left+right)//2
    b = (V-((P-1)+(N-i)))
    target = A[i]+M

        
    if b<0:
        if A[P-1]<=target:
            right = i
        else:
            left = i
    else:
        if target<A[P-1]:
            left = i
        else:
            Q_sum=sum(A[P-1:i])
            len_Q =i-(P-1)
            if target*len_Q-Q_sum>=b*M:
                right = i
            else:
                left =i


print(right+1)
### BUGGY CODE ###

from collections import Counter


def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    counter = Counter(A)
    A.sort()
    nums = list()
    for a in A:
        is_target = True
        for n in nums:
            if a % n == 0:
                is_target = False
                break
            if a // 2 < n:
                break
        if is_target:
            nums.append(a)
    print(len(list(filter(lambda n: counter[n] == 1, nums))))


if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import Counter


def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    counter = Counter(A)
    searched = [0 for _ in range(10 ** 6 + 1)]
    ans = 0
    for i in range(1, 10 ** 6 + 1):
        if counter[i] == 0:
            continue
        if searched[i] == 0 and counter[i] == 1:
            ans += 1
        for j in range(1, ((10 ** 6) // i) + 1):
            searched[i * j] = 1
    print(ans)


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

import sys
sys.setrecursionlimit(100001)

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

dp = [0] * N
parent = [[] for _ in range(N)]

def func(node):
    for i in parent[node]:
        if dp[i] <= dp[node]:
            dp[i] = dp[node] + 1
            func(i)


for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    parent[y].append(x)
    if dp[x] <= dp[y]:
        dp[x] = dp[y] + 1
        func(x)

print(max(dp))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100001)

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

dp = [0] * N
g = [[] for _ in range(N)]

for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    g[x].append(y)

def dfs(node):
    if dp[node] > 0:
        return dp[node]
    mx = 0
    for i in g[node]:
        a = dfs(i) + 1
        if mx < a:
            mx = a
    dp[node] = mx
    return mx

ans = 0
for i in range(N):
    if dp[i] == 0:
        ans = max(ans, dfs(i))

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

N,W = map(int,input().split())
wv = []
for i in range(N):
    wv.append(list(map(int,input().split())))
    
#- dp[i][j] i番目より後ろの品物から、重さjまで許して荷物を入れた時の価値の最大
dp = [[0]*(W+1) for i in range(N+1)]

for i in range(N-1,-1,-1):#N番目以降は品物がもうないので0。→N-1からやる
    for j in range(W,-1,-1): #重いほうから見ていく
        if j<wv[i][0]:#i番目の荷物の重さがそもそも許容値よりも大きい→いれられない
            dp[i][j] = dp[i+1][j]
        else:
            dp[i][j] = max(dp[i+1][j],dp[i+1][j-wv[i][0]]+wv[i][1])#いれない or いれる　の大きいほう
#最後の出力は、0番目以降の品物(つまり、全部)から、重さWまで許したときの価値の最大
print(dp[0][W])


### FIXED CODE ###

N,W = map(int,input().split())
wv = []
for i in range(N):
    wv.append(list(map(int,input().split())))
    
#- dp[i][j] i番目より後ろの品物から、重さjまで許して荷物を入れた時の価値の最大
dp = [[0]*(W+1) for i in range(N+1)]

for i in range(N-1,-1,-1):#N番目以降は品物がもうないので0。→N-1からやる
    for j in range(W,-1,-1): #重いほうから見ていく
        if j<wv[i][0]:#i番目の荷物の重さがそもそも許容値よりも大きい→いれられない
            dp[i][j] = dp[i+1][j]
        else:
            dp[i][j] = max(dp[i+1][j],dp[i+1][j-wv[i][0]]+wv[i][1])#いれない or いれる　の大きいほう
#最後の出力は、0番目以降の品物(つまり、全部)から、重さWまで許したときの価値の最大
print(dp[0][W])
### BUGGY CODE ###

INF = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
test = []
for i in range(N - 1):
    tmp = 0
    for j in range(i + 1, N):
        tmp += A[i] * A[j]
        tmp %= INF
    test.append(tmp)

print(sum(test) % INF)

### FIXED CODE ###

INF = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
rui = [0] * (N + 1)
for i in range(N):
    rui[i + 1] = A[i] + rui[i]

ans = 0
for i in range(N - 1):
    ans += (rui[N] - rui[i + 1]) * A[i]
    ans %= INF
print(ans % INF)
### BUGGY CODE ###


n = int(raw_input())
a = raw_input().split()

cnt = 0
for i in a:
    a[cnt] = int(i)
    cnt += 1

chk = {}
def make_divisors(k):
    divisors = []
    for i in range(1, int(k**0.5)+1):
        if k % i == 0:
            if i in chk:
                chk[i] += 1
            else:
                chk[i] = 1
            if i != k // i:
                key = int(k//i)
                if key in chk:
                    chk[key] += 1
                else:
                    chk[key] = 1

    return divisors

if n == 2:
    print max(a[0],a[1])
else:
    for i in range(2):
        make_divisors(a[i])
    cnt = 1
    for i in range(2,len(a)):
        k = a[i]
        del_list = []
        for j in chk:
            if k % j == 0:
                chk[j] += 1
            if chk[j] < cnt+1:
                del_list.append(j)
#        for j in del_list:
#            del chk[j]
        cnt += 1

#    answer = max(chk.keys())
    answer = 0
    for i in chk:
        if int(chk[i]) >= n - 1 and i > answer:
            answer = i
    print answer

### FIXED CODE ###

n = int(raw_input())
a = raw_input().split()

cnt = 0
for i in a:
    a[cnt] = int(i)
    cnt += 1

chk = {}
chk2 = {}
def make_divisors(k):
    divisors = []
    for i in range(1, int(k**0.5)+1):
        if k % i == 0:
            if i in chk:
                chk[i] += 1
            else:
                chk[i] = 1
            if i != k // i:
                key = int(k//i)
                if key in chk:
                    chk[key] += 1
                else:
                    chk[key] = 1
    return divisors

for i in range(2):
    make_divisors(a[i])
cnt = 1
for i in range(2,len(a)):
    k = a[i]
    if k not in chk2:
        chk2[k] = 1
    else:
        if chk2[k] == 1:
            chk2[k] += 1
        elif chk2[k] > 1:
            continue
    del_list = []
    for j in chk:
        if k % j == 0:
            chk[j] += 1
        if chk[j] < cnt+1:
            del_list.append(j)
    for j in del_list:
        del chk[j]
    cnt += 1

answer = 0
for i in chk:
    if int(chk[i]) >= chk[1] - 1 and i > answer:
        answer = i
print answer
### BUGGY CODE ###

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

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

for i in range(N):
    for j in range(i+1, N):
        tmp1 = abs(i - X + 1) + abs(j - Y + 1) + 1
        tmp2 = abs(i - Y + 1) + abs(j - X + 1) + 1
        min_dist = min(abs(i - j), tmp1, tmp2)

        ans[min_dist - 1] += 1

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

### FIXED CODE ###

from collections import deque

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

dist = [[0 for _ in range(N)] for _ in range(N)]
ans = [0 for _ in range(N)]

for i in range(N):
    for j in range(N):
        tmp1 = abs(i - X + 1) + abs(j - Y + 1) + 1
        tmp2 = abs(i - Y + 1) + abs(j - X + 1) + 1

        dist[i][j] = min(abs(i - j), tmp1, tmp2)
        dist[j][i] = min(abs(i - j), tmp1, tmp2)

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

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