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

import sys

for i in sys.stdin.readlines():
    n=int(i)
    list = [p for p in range(2,n) if 0 not in [p%d for d in range(2,p)]]

    print len(list)

### FIXED CODE ###

import sys

list = [1]*1000000
list[0]=0
list[1]=0
for i in range(1,1000000):
    if list[i]==1:
        for j in range(i**2, 1000000, i):
            list[j]=0
for i in range(2, 1000000):
    list[i]+=list[i-1]
for l in sys.stdin:
    print list[int(l)]
### BUGGY CODE ###

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

dp = [0] * n
for i in range(n):
  dp[i] = p[i] / 2 + 0.5
  
max = 0
for i in range(0,n-k + 1):
  if sum(dp[i:i+k]) > max:
    max = sum(dp[i:i+k])
print(max)

### FIXED CODE ###

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

dp = [0] * n
for i in range(n):
  dp[i] = p[i] / 2 + 0.5
  
m = sum(dp[0:k])
max = m
for i in range(1,n-k + 1):
  m = m - dp[i-1] + dp[i+k-1]
  if m > max:
    max = m
print(max)
### BUGGY CODE ###

N,P = map(int,input().split())
S = str(input())

if P == 2 or P == 5:
    S = list(map(int,list(S)))
    ans = 0
    for i in range(N):
        if S[i] % P == 0:
            ans += i + 1

else:
    data = [0] * P
    for i in range(N):
        data[int(S[i:])%P] += 1
    #print(data)
    ans = data[0]
    for i in range(P):
        ans += (data[i]*(data[i]-1))//2

print(ans)

### FIXED CODE ###

N,P = map(int,input().split())
S = str(input())

if P == 2 or P == 5:
    S = list(map(int,list(S)))
    ans = 0
    for i in range(N):
        if S[i] % P == 0:
            ans += i + 1

else:
    data = [0] * P
    s = int(S)
    x = 1 ##10**iをPで割った数
    y = 0 ##S[i:N]をPで割った数
    for i in range(N):
        y += int(S[N-i-1]) * x
        y %= P
        data[y] += 1
        x *= 10
        x %= P
    #print(data)
    ans = data[0]
    for i in range(P):
        ans += (data[i]*(data[i]-1))//2

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

n, m = map(int, input().split())
t = [1] * n
for _ in range(m):
  l, r = map(int, input().split())
  for i in range(0, l - 1):
    t[i] = 0
  for i in range(r, n):
    t[i] = 0
print(sum(t))


### FIXED CODE ###

n, m = map(int, input().split())
x = 0
y = n - 1
for _ in range(m):
  l, r = map(int, input().split())
  x = max(x, l - 1)
  y = min(y, r - 1)
print(max(y - x + 1, 0))
### BUGGY CODE ###

import collections

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

c = collections.Counter(s)
x = c.most_common()[0][1]

for item in s:
  if c[item] == x and item not in  l:
  	l.append(item)

for item in l:
  print(item)

### FIXED CODE ###

import collections

n = int(input())
s = [input() for i in range(n)]
c = collections.Counter(s)
x = c.most_common()[0][1]

s = list(set(s))
s.sort()

for item in s:
  if c[item] == x:
  	print(item)
### BUGGY CODE ###

import bisect
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
for i in range(M):
  B = A.pop()
  bisect.insort_right(A,B//2)
print(sum(A))


### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(lambda x: int(x)*(-1),input().split()))
import heapq
heapq.heapify(A)
for i in range(M):
  B = heapq.heappop(A)
  heapq.heappush(A,-1*((-B)//2))
print(-sum(A))
### BUGGY CODE ###

def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 
  
def lcm(a,b): 
    return (a*b) // gcd(a,b) 
  
n = int(input())
arr = input()   # takes the whole line of n numbers
a = list(map(int,arr.split(' ')))
l = a[0]
ans = 0
for i in range(n):
    l = lcm(l, a[i])
for i in range(n):
    ans = ans + l//a[i]
print(ans%1000000007)


### FIXED CODE ###

mod=10**9+7
n=int(input())
a=list(map(int,input().split()))
def gcd(a,b):
  while b:a,b=b,a%b
  return a
def lcm(a,b):return a*b//gcd(a,b)
l=a[0]
for i in range(1,n):
  l=lcm(l,a[i])
ans=0
l%=mod
for i in range(n):
  ans+=l*pow(a[i],mod-2,mod)
  ans%=mod
print(ans)
### BUGGY CODE ###

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

s=list(set(l))

x=0
for i in s:
    if i <= l.count(i):
        x += l.count(i) - i
    else:
        x += l.count(i)

print(x)

### FIXED CODE ###

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

s=set(l)

import collections
c = collections.Counter(l)

x=0
for i in s:
    y = c[i]
    if i <= y:
        x += y - i
    else:
        x += y

print(x)
### BUGGY CODE ###

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

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

a.sort()

for i in range(m):
        a[-1] = int(max(a)/2)
        a.sort()

print(sum(a))


### FIXED CODE ###

import heapq
n,m = map(int,input().split())

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


for i in range(n):
    a[i] = (-1) * a[i]

heapq.heapify(a)

for i in range(m):
    d = heapq.heappop(a)
    heapq.heappush(a,d/2)

ans = 0
for i in range(n):
    ans += int(-a[i])

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

l=int(input())
 
list=[]
for i in range(l):
    a=input()
    if a in list:
        list.remove(a)
    else:
        list.append(a)
 
print(len(list))

### FIXED CODE ###

l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)
### BUGGY CODE ###

# 初期入力
import numpy as np
N,K,Q = (int(x) for x in input().split())
A = [int(input()) for i in range(Q)] 


#
point_i =np.full(N,K) #要素数、N   初期値,K

for i in A:
    point_i = point_i -1
    point_i[i-1] +=1

for i in point_i:
    if 0 < i:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

# 初期入力
import numpy as np
N,K,Q = (int(x) for x in input().split())
A = [int(input()) for i in range(Q)] 


#
point_i =np.full(N,K) #参加者ごとのポイント　要素数、N   初期値,K

for i in A: #正解した人のポイント加算する
    #point_i = point_i -1
    point_i[i-1] +=1
#print(point_i)

point_i -= Q #全員、全問題数分のポイント減算

for i in point_i:
    if 0 < i:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

n,k,q=map(int, input().split())

A = []
for i in range(q):
    A.append(int(input()))

score = [k]*n

for i in A:
    score = list(map(lambda x:x-1,score) )
    score[i-1]+=1

for i in score:
    if i <= 0:
        print('No') 
    else:
        print('Yes')

### FIXED CODE ###

n,k,q=map(int, input().split())

A = []
for i in range(q):
    A.append(int(input()))

score = [k]*n
score = list(map(lambda x:x-q,score) )
for i in A:
     
    score[i-1]+=1

for i in score:
    if i <= 0:
        print('No') 
    else:
        print('Yes')
### BUGGY CODE ###

N,Q = map(int,input().split())
S = (input())
lr = []
for i in range(Q):
    lr.append(list(map(int,input().split())))

for i in range(Q):
    l,r = lr[i][0],lr[i][1]
    S_tmp = S[l-1:r]
    print(S_tmp.count("AC"))

### FIXED CODE ###

N,Q = map(int,input().split())
S = (input())

lr = []

for i in range(Q):
    lr.append(list(map(int,input().split())))

acs = [0]*(N+1)
tmp = 0
for i in range(N-1):
    if S[i] =="A" and S[i+1] =="C":
        tmp = 1
    else:
        tmp = 0
    acs[i+1] = acs[i] + tmp
    

for i in range(Q):
    print(acs[lr[i][1]-1]-acs[lr[i][0]-1])
### BUGGY CODE ###

import sys

H, W, M = map(int, sys.stdin.readline().strip().split())

h = [0] * H
w = [0] * W

g = [[False] * W for _ in range(H)]

for _ in range(M):
    Th, Tw = map(int, sys.stdin.readline().strip().split())

    h[Th - 1] += 1
    w[Tw - 1] += 1

    g[Th - 1][Tw - 1] = True

ans = max(h) + max(w)

index_h = [n for n, v in enumerate(h) if v == max(h)]
index_w = [n for n ,v in enumerate(w) if v == max(w)]

ans1 = 1
for ih in index_h:
    for iv in index_w:
        if g[ih][iv] is False:
            ans1 = 0
            break
    else:
        break

ans -= ans1


print(ans)



### FIXED CODE ###

import sys

H, W, M = map(int, sys.stdin.readline().strip().split())

h = [0] * H
w = [0] * W

# g = [[False] * W for _ in range(H)]
S = set()
for _ in range(M):
    Th, Tw = map(int, sys.stdin.readline().strip().split())

    h[Th - 1] += 1
    w[Tw - 1] += 1

    # g[Th - 1][Tw - 1] = True
    S.add((Th - 1, Tw - 1))

max_h = max(h)
max_w = max(w)
ans = max_h + max_w

index_h = [n for n, v in enumerate(h) if v == max_h]
index_w = [n for n, v in enumerate(w) if v == max_w]

sub = 1
# for ih in index_h:
#     for iv in index_w:
#         if g[ih][iv] is False:
#             sub = 0
#             break
#     else:
#         continue
#     break
# ans -= sub
# print(ans)


for ih in index_h:
    for iv in index_w:
        if not (ih, iv) in S:
            print(ans)
            exit()
print(ans - 1)
### BUGGY CODE ###

import math


# 最大公约数
def zuidagongyueshu(x, y):
    if y % x == 0:
        return x

    if x % y == 0:
        return y

    if x < y:
        return zuidagongyueshu(y % x, x)
    else:
        return zuidagongyueshu(x % y, y)


# 分解质因数
# 30 = 2*3*5
# 60 = (2,2)*3*5
# 420 = (2,2)*3*5*7
# 1260 = (2,2)*(3,2)*5*7
# 6300 = (2,2)*(3,2)*(5,2)*7

container = []
def fenjiezhiyinshu(x):
    for i in range(1, x + 1):
        if i == 1:
            continue
        else:
            flag = False
            while x % i == 0:
                x = int(x / i)
                flag = True

            if flag:
                container.append(i)
                return fenjiezhiyinshu(x)

S = input().split(' ')
arr = list(map(int, list(S)))
fenjiezhiyinshu(zuidagongyueshu(arr[0],arr[1]))
print(len(container)+1)




### FIXED CODE ###

A, B = map(int,input().split())

def yinshufenjie(m):
    pf = {}
    for i in range(2, int(m ** 0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1: pf[m] = 1
    return pf


def calculate(a,b):
    s1 = yinshufenjie(a)
    s2 = yinshufenjie(b)

    set1 = set()
    set2 = set()
    for key in s1.keys():
        set1.add(key)

    for key in s2.keys():
        set2.add(key)

    a = set1 & set2
    print(len(a)+1)


calculate(A,B)
### BUGGY CODE ###

n,q = map(int, input().split())
s = list(input())
lr_list = [list(map(int,input().split())) for _ in range(q)]

for l,r in lr_list:
    count = 0
    tmp_str = ''.join(s[l-1:r])
    v = [tmp_str[i: i+2] for i in range(0, len(tmp_str)) if len(tmp_str[i: i+2])==2]
    for p in v:
        if 'AC' == p:
            count += 1
    print(count)

### FIXED CODE ###

n,q = map(int, input().split())
s = list(input())
lr_list = [list(map(int,input().split())) for _ in range(q)]
tmp_list = [0]*(n+1)

for i in range(1,n):
    if s[i-1]=='A' and s[i]=='C':
        tmp_list[i] = tmp_list[i-1]+1
    else:
        tmp_list[i] = tmp_list[i-1]

for l,r in lr_list:
    print(tmp_list[r-1]-tmp_list[l-1])
### BUGGY CODE ###

import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = list(input())
N = len(S)
masu= [1] * N

old = [1] * N
loop = 0
while True:
    new = [0] * N
    for i, children in enumerate(masu):
        if S[i] == "L":
            next_i = i - 1
        else:
            next_i = i + 1
        new[next_i] += children
    if new == old:
        if loop % 2 == 0:
            last = masu 
        else:
            last = new
        break
    loop += 1
    old = masu
    masu = new

# これ知らなかった
print(*last)

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = list(input())
N = len(S)

masu = []
char = ""
for i, s in enumerate(S):
    if char == "":
        char += s
        continue
    if char[-1] == s:
        char += s
        continue
    if char[-1] != s:
        masu.append(len(char))
        char = s
        continue
if char:
    masu.append(len(char))

import math

ans = []
for l, r in zip(*[iter(masu)]*2):
    n = len(ans)
    pos_l = n + l
    pos_r = pos_l + 1
    l_num = math.ceil(l / 2) + r // 2
    r_num = l // 2 + math.ceil(r / 2)
    for _ in range(l-1):
        ans.append(0)
    ans.append(l_num)
    ans.append(r_num)
    for _ in range(r-1):
        ans.append(0)

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

from collections import defaultdict, deque
N,M = map(int,input().split())
abc = []
for i in range(N):
    a,b = map(int,input().split())
    c = b/a
    abc.append((a,b,c))

abc.sort(key=lambda x:x[2],reverse=True)

d = defaultdict(deque)
for a,b,c in abc:
    d[a].append(b)
# print(abc)
# print(d)
ans = 0
for i in range(M-1,-1,-1):
    if not d: break
    tmpk = -1
    tmpv = -1
    dif = M - i
    for k in sorted(d.keys()):
        if k > dif: break
        if d[k][0] > tmpv:
            tmpv = d[k][0]
            tmpk = k
    if tmpk != -1:
        ans += tmpv
        d[tmpk].popleft()
        if not d[tmpk]:
            d.pop(tmpk)
print(ans)

### FIXED CODE ###

from heapq import heappop, heappush
from collections import defaultdict
N,M = map(int,input().split())
jobs = defaultdict(list)
for i in range(N):
    a,b = map(int,input().split())
    if a <= M: jobs[a-1].append(b)
h = []
ans = 0
for i in range(M):
    if jobs[i]:
        for j in jobs[i]:
            heappush(h, -j)
    if len(h) > 0:
        ans += -heappop(h)
print(ans)
### BUGGY CODE ###

k = int(input())
import math
from functools import reduce
total = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            total += reduce(math.gcd,(i,j,l))

print(total)


### FIXED CODE ###

k = int(input())
import math
from functools import reduce
total = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            total += reduce(math.gcd,(i,j,l))

print(total)
### BUGGY CODE ###

N=int(input())
listN=[]
i=0
k=0
while N!=0:
  k+=N%10
  N=N//10
  
if k%9==0:
  print ('Yes')
else:
  print ('No')

### FIXED CODE ###

N=int(input())
if N%9==0:
  print ('Yes')
else:
  print ('No')
### BUGGY CODE ###

from fractions import gcd

MOD = 1000000000 + 7

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

def lcm(x, y):
    return (x * y) // gcd(x, y)

l = 1
for i in A:
    l = lcm(l, i)

ans = 0
for i in A:
    ans += (l // i) % MOD
print(int(ans % MOD))

### FIXED CODE ###

from fractions import gcd

MOD = 1000000000 + 7

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

l = 1
ans = 0
for a in A:
    g = gcd(a, l)
    l = (l // g) * a
    ans = (ans * (a // g)) % MOD
    ans = (ans + (l // a)) % MOD
print(int(ans))
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
jud = []
a.sort()
ans = "YES"
for i in range(n):
  if(a[i] in jud):
    ans = "NO"
    break
  else:
    jud.append(a[i])
print(ans)


### FIXED CODE ###

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

if len(set(a)) == len(a):
    print("YES")
else:
    print("NO")
### BUGGY CODE ###

n=int(input())
A=list(map(int,input().split()))
mod = 10**9+7;ans=0
for i in range(60):
  cnt=sum([a>>i&1for a in A]) 
  cnt=cnt*(n-cnt)%mod
  cnt=2**i*cnt%mod
  ans+=cnt
print(ans%mod)

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
mod = 10**9+7;ans=0
for i in range(60):
  cnt=sum([1 for a in A if a>>i&1]) 
  cnt=cnt*(n-cnt)%mod
  cnt=2**i*cnt%mod
  ans+=cnt
print(ans%mod)
### BUGGY CODE ###

n = int(input())
s = []
for i in range(n):
    a = list(input())
    a.sort()
    s.append(''.join(a))

ans = 0
for i in range(n-1):
    for j in range(i+1, n):
        if s[i] == s[j]:
            ans += 1

print(ans)


### FIXED CODE ###

n = int(input())
s = [input() for _ in range(n)]

for i in range(n):
    s[i] = ''.join(sorted(s[i]))
# print(s)
t = {}
for i in range(n):
    if s[i] in t:
        t[s[i]] += 1
    else:
        t[s[i]] = 1
# print(t)
print(sum(t[k]*(t[k]-1)//2 for k in t))
### BUGGY CODE ###

H, W = map(int, input().split())
maze = [input() for _ in range(H)]

left = [[0] * W for _ in range(H)]
right = [[0] * W for _ in range(H)]
up = [[0] * W for _ in range(H)]
down = [[0] * W for _ in range(H)]

for h in range(H):
    cnt = 0
    for w in range(W):
        if maze[h][w] == "#":
            cnt = 0
        else:
            cnt += 1
            left[h][w] = cnt

for h in range(H):
    cnt = 0
    for w in range(W - 1, -1, -1):
        if maze[h][w] == "#":
            cnt = 0
        else:
            cnt += 1
            right[h][w] = cnt

for w in range(W):
    cnt = 0
    for h in range(H):
        if maze[h][w] == "#":
            cnt = 0
        else:
            cnt += 1
            up[h][w] = cnt

for w in range(W):
    cnt = 0
    for h in range(H - 1, -1, -1):
        if maze[h][w] == "#":
            cnt = 0
        else:
            cnt += 1
            down[h][w] = cnt

ans = 0
for h in range(H):
    for w in range(W):
        tmp = up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3
        if tmp > ans:
            ans = tmp

print(ans)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    H, W = map(int, input().split())
    maze = [input() for _ in range(H)]

    left = [[0] * W for _ in range(H)]
    right = [[0] * W for _ in range(H)]
    up = [[0] * W for _ in range(H)]
    down = [[0] * W for _ in range(H)]

    for h in range(H):
        cnt = 0
        for w in range(W):
            if maze[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                left[h][w] = cnt

    for h in range(H):
        cnt = 0
        for w in range(W - 1, -1, -1):
            if maze[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                right[h][w] = cnt

    for w in range(W):
        cnt = 0
        for h in range(H):
            if maze[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                up[h][w] = cnt

    for w in range(W):
        cnt = 0
        for h in range(H - 1, -1, -1):
            if maze[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                down[h][w] = cnt

    ans = 0
    for h in range(H):
        for w in range(W):
            tmp = up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3
            if tmp > ans:
                ans = tmp

    print(ans)


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


def is_prime(x):
    if x == 2:
        return True
    else:
        if 2 ** (x-1) % x == 1:
            return True
        else:
            return False

def main():
    n = int(input())
    cnt = 0
    for _ in range(n):
        if is_prime(int(input())):
            cnt += 1

    print(cnt)

main()


### FIXED CODE ###

import math
def is_prime(x):
    if x == 1 or x == 2:
        return True

    for idx in range(2, int(math.sqrt(x))+1):
        if x % idx == 0:
            return False

    return True

def main():
    n = int(input())
    cnt = 0
    for _ in range(n):
        if is_prime(int(input())):
            cnt += 1

    print(cnt)

main()
### BUGGY CODE ###

N = int(input())

dp = [0] * (N + 1)
for i in range(1, N + 1):
    cursor = i
    while cursor <= N:
        dp[cursor] += 1
        cursor += i

ans = 0
for i in range(1, N + 1):
    ans += i * dp[i]

print(ans)


### FIXED CODE ###

N = int(input())

ans = 0
for i in range(1, N + 1):
    start = i
    n = N // i
    end = i * n
    ans += n * (start + end) // 2


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

s=list(input())
S=[]
for i in range(len(s)):
    S.append(int(s[i]))
from collections import defaultdict
D = defaultdict(int)
ans=0
for i in range(len(S)):
    d=defaultdict(int)
    d[S[i]]=1
    for k,v in D.items():
        d[(k*10+S[i])%2019]+=v
    ans+=d[0]
    D=d
print(ans)

### FIXED CODE ###

S=input()

mod=2019
D={}
S=S[::-1]
now=0

for i in range(len(S)):
    if (int(S[i])*pow(10,i,mod)+now)%mod not in D:
        D[(int(S[i])*pow(10,i,mod)+now)%mod]=1
    else:
        D[(int(S[i])*pow(10,i,mod)+now)%mod]+=1
    now=(int(S[i])*pow(10,i,mod)+now)%mod
#print(D)
ans=0
for k,v in D.items():
    if k==0:
        v+=1
    ans+=v*(v-1)//2
print(ans)
### BUGGY CODE ###

import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))

B = np.sort(A)[::-1]
B_index = np.argsort(A)[::-1]
dp = [[0]*(N+1) for _ in range(N+1)]
ans = 0

for x in range(0,N+1):
    for y in range(0,N+1-x):
        ind = B_index[x+y-1]
        if x==0 and y==0:
            dp[x][y] = 0
        elif x==0:
            dp[x][y] = dp[x][y-1] + B[x+y-1]*abs(ind-((N-1)-(y-1)))
        elif y==0:
            dp[x][y] = dp[x-1][y]+B[x+y-1]*abs(ind-(x-1))
        else:
            dp[x][y] = max(dp[x-1][y]+B[x+y-1]*abs(ind-(x-1)),dp[x][y-1] + B[x+y-1]*abs(ind-((N-1)-(y-1))))
        ans = max(ans,dp[x][y])

print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A = [[a,i] for a,i in zip(A,range(N))]
A = sorted(A,reverse=True)

dp = [[0]*(N+1) for _ in range(N+1)]
ans = 0

for n in range(0,N+1):
    for y in range(0,n+1):
        x = n-y
        a = A[n-1]
        ind = a[1]
        if x==0 and y==0:
            dp[x][y] = 0
        elif x==0:
            dp[x][y] = dp[x][y-1] + a[0]*abs(ind-((N-1)-(y-1)))
        elif y==0:
            dp[x][y] = dp[x-1][y]+a[0]*abs(ind-(x-1))
        else:
            dp[x][y] = max(dp[x-1][y]+a[0]*abs(ind-(x-1)),dp[x][y-1] + a[0]*abs(ind-((N-1)-(y-1))))
        ans = max(ans,dp[x][y])

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

n,q = map(int,input().split())
S = input()
question_list = []
for _ in range(q):
    l, r = map(int,input().split())
    question_list.append([l,r])
for l,r in question_list:
    print(S[l-1:r].count("AC"))

### FIXED CODE ###

n,q = map(int,input().split())
S = input()
ac_list = [0,0]
question_list = []
for i in range(len(S)-1):
    if S[i:i+2] == "AC":
        ac_sum = ac_list[i+1] + 1
        ac_list.append(ac_sum)
    else:
        ac_list.append(ac_list[-1])
for _ in range(q):
    l, r = map(int,input().split())
    question_list.append([l,r])
for l,r in question_list:
    print(ac_list[r]-ac_list[l])
### BUGGY CODE ###

s = list(input())
q = int(input())

for i in range(q):
    x = list(input().split())
    if len(x) == 3:
        if x[1] == '1':
            s.insert(0, x[2])
        else:
            s.append(x[2])
    else:
        s = s[::-1]
print(*s, sep='')

### FIXED CODE ###

from collections import deque

s = deque(input())
q = int(input())
cnt = 0

for _ in range(q):
    qs = input().split()
    if qs[0] == '1':
        cnt += 1
    else:
        if qs[1] == '1':
            if cnt%2 == 0:
                s.appendleft(qs[2])
            else:
                s.append(qs[2])
        else:
            if cnt%2 == 0:
                s.append(qs[2])
            else:
                s.appendleft(qs[2])
ans = ''.join(s)
print(ans if cnt%2 == 0 else ans[::-1])
### BUGGY CODE ###

import sys
from collections import deque
input = sys.stdin.buffer.readline


def bfs(v):
    dist = [f_inf for _ in range(n)]
    dist[v] = 0
    q = deque()
    q.append(v)
    while q:
        u = q.popleft()
        for nv in tree[u]:
            if dist[nv] == f_inf:
                dist[nv] = dist[u] + 1
                q.append(nv)
    for d in dist:
        res[d] += 1


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

tree = [[] for _ in range(n)]
for i in range(n - 1):
    tree[i].append(i + 1)
    tree[i + 1].append(i)
tree[x - 1].append(y - 1)
tree[y - 1].append(x - 1)

f_inf = float("inf")
res = [0 for _ in range(n)]
for i in range(n):
    bfs(i)

for i in range(1, n):
    print(res[i] // 2)


### FIXED CODE ###

def main():
    import sys
    from collections import deque
    input = sys.stdin.buffer.readline


    def bfs(v):
        dist = [f_inf for _ in range(n)]
        dist[v] = 0
        q = deque()
        q.append(v)
        while q:
            u = q.popleft()
            for nv in tree[u]:
                if dist[nv] == f_inf:
                    dist[nv] = dist[u] + 1
                    q.append(nv)
        for d in dist:
            res[d] += 1


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

    tree = [[] for _ in range(n)]
    for i in range(n - 1):
        tree[i].append(i + 1)
        tree[i + 1].append(i)
    tree[x - 1].append(y - 1)
    tree[y - 1].append(x - 1)

    f_inf = float("inf")
    res = [0 for _ in range(n)]
    for i in range(n):
        bfs(i)

    for i in range(1, n):
        print(res[i] // 2)

if __name__ == '__main__':
    main()