Harryxun/stf_run huggingface dataset:
# D
import numpy as np
N, X, Y = map(int, input().split())

X = X - 1
Y = Y - 1

x = np.zeros((N,N))
for i in range(N):
    x[i,i:] = np.array(range(N-i))
y = np.zeros((N,N))
for i in range(0, N):
    for j in range(i+1, N):
        y[i, j] = abs(i-X) + abs(j-Y) + 1

ans = np.minimum(x, y)

a, b = np.unique(ans, return_counts=True)
count = 1
for i in range(1,N):
    if count>=len(a):
        print(0)
        continue
    if a[count] == i:
        print(b[count])
        count += 1
    else:
        print(0)

### FIXED CODE ###

# D
import numpy as np
N, X, Y = map(int, input().split())

D = [0]*N
for i in range(1, N+1):
    for j in range(i+1, N+1):
        d = min(j-i, abs(j-Y) + abs(i-X) + 1) 
        D[d] += 1
for i in range(1, N):
    print(D[i])
import numpy as np
N = int(input())
a = []
for i in range(N):
  S, P = input().split()
  a.append((S, 100-P, i+1))
a.sort()
for i in a:
  print(i[2])

  

### FIXED CODE ###

import numpy as np
N = int(input())
a = []
for i in range(N):
  S, P = input().split()
  a.append((S, 100-int(P), i+1))
a.sort()
for i in a:
  print(i[2])
n, l = map(int, input().split())
a = sorted([l + i for i in range(n)], key=abs)
print(sum(s[1:]))



### FIXED CODE ###

n, l = map(int, input().split())
a = sorted([l + i for i in range(n)], key=abs)
print(sum(a[1:]))
import bisect

N = int(input())
S = list(input())
Q = int(input())
K = []
for i in range(Q):
    a = list(input().split())
    K.append([int(a[0]),int(a[1]),a[2]])

C = {}
for i in range(97,97+26):
    C[chr(i)] = []

for i in C.values():
    i.append(-1)

for i in range(N):
    C[S[i]].append(i)

for i in C.values():
    i.append(10**8)

for i in range(Q):
    if K[i][0] == 1:
        t = K[i][1]-1
        C[S[t]].remove(t)
        C[K[i][2]].append(t)
        C[K[i][2]].sort()
    else:
        s = K[i][1] - 1
        t = int(K[i][2]) - 1
        ans = 0
        for v in C.values():
            a = bisect.bisect_left(v,s)
            b = bisect.bisect_right(v,t)
            if a != b:
                ans += 1
        print(ans)

### FIXED CODE ###

class segtree:

    def __init__(self, n, identity):
        # identityは初期値
        nb = bin(n)[2:]
        bc = sum([int(digit) for digit in nb])
        if bc == 1:
            self.num_end_leaves = 2 ** (len(nb) - 1)
        else:
            self.num_end_leaves = 2 ** (len(nb))

        self.array = [identity for i in range(self.num_end_leaves * 2)]
        self.identity = identity

    def update(self, x, val):
        actual_x = x + self.num_end_leaves
        self.array[actual_x] = val
        while actual_x > 0:
            actual_x = actual_x // 2
            self.array[actual_x] = self.array[actual_x * 2] | self.array[actual_x * 2 + 1]

    def get(self, q_left, q_right, arr_ind=1, leaf_left=0, depth=0):
        width_of_floor = self.num_end_leaves // (2 ** depth)
        leaf_right = leaf_left + width_of_floor - 1

        if leaf_left > q_right or leaf_right < q_left:
            return self.identity

        elif leaf_left >= q_left and leaf_right <= q_right:
            return self.array[arr_ind]

        else:
            val_l = self.get(q_left, q_right, 2 * arr_ind, leaf_left, depth + 1)
            val_r = self.get(q_left, q_right, 2 * arr_ind + 1, leaf_left + width_of_floor // 2, depth + 1)
            return val_l | val_r

N = int(input())
S = list(input())
Q = int(input())
T = {}
j = 1
for i in range(97, 97+26):
    T[chr(i)] = j
    j *= 2

s_tree = segtree(N+1, 0)

for i in range(N):
    s_tree.update(i+1, T[S[i]])

for i in range(Q):
    A = list(input().split())
    a, b, c = A
    if a == "2":
        K = bin(s_tree.get(int(b), int(c)))[2:]
        d = 0
        for i in K:
            if i == "1":
                d += 1
        print(d)
    else:
        s_tree.update(int(b), T[c])
import sys
readline = sys.stdin.readline

def main():
  N = int(readline())
  a = list(map(int, readline().split()))
  b = list(map(int, readline().split()))
  buf = []
  
  for k in range(N):
    c = []
    last = None
    for i in range(N):
      r = c.append(a[(i+k)%N] ^ b[i])
      if last != r:
      	break
      last = r
    else:
      buf.append((k, c[0]))
  for d in buf:
    print(d[0], d[1])

if __name__ == '__main__':
    main()
 

### FIXED CODE ###

K, X = map(int, input().split())

if K * 500 >= X:
  print('Yes')
else:
  print('No')
n,x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list = sorted(x_list)
a = []
for i in range(n):
    a.append(x_list[i+1]-x_list[i])
import math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(a))

### FIXED CODE ###

n,x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list = sorted(x_list)
a = []
for i in range(n):
    b = x_list[i+1]-x_list[i]
    a.append(b)
import math
from functools import reduce
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
ans = reduce(gcd, a)
print(int(ans))
def visit(u):
    global color, d, f, t
    color[u] = GRAY
    d[u] += t
    t += 1
    for v in range(n):
        if (M[u][v] == 0):
            continue
        if (color[v] == WHITE):
            visit(v)
    color[u] = BLACK
    f[u] = t
    t += 1

n = int(input())
M = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
    temp = list(map(int, input().split()))
    for i in range(temp[1]):
        M[temp[0]-1][temp[i+2]-1] = 1

WHITE = 0
GRAY = 1
BLACK = 2
color, d, f = [WHITE for i in range(n)]
t = 1
for u in range(n):
    if (color[u] == WHITE):
        visit(u)
for u in range(n):
    print(str(u+1), str(d[u]), str(f[u]), sep = " ")

### FIXED CODE ###

def dfs(u):
    global dfs_color, d, f, t
    color[u] = GRAY
    d[u] += t
    t += 1
    for v in range(n):
        if (M[u][v] == 0):
            continue
        else:
            if (color[v] == WHITE):
               dfs(v)
    color[u] = BLACK
    f[u] = t
    t += 1

n = int(input())
M = [[False for i in range(n)] for j in range(n)]
for i in range(n):
    tmp = list(map(int, input().split()))
    for j in range(tmp[1]):
        M[tmp[0]-1][tmp[j+2]-1] = True

WHITE = 0
GRAY = 1
BLACK = 2
color = [WHITE for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
t = 1

for u in range(n):
    if (color[u] == WHITE):
        dfs(u)
for u in range(n):
    print(str(u+1), str(d[u]), str(f[u]), sep = " ")
def common():
????X = raw_input()
  Y = raw_input()
????a = len(X)
????b = len(Y)
????k1 = [0 for i in range(b+1)]

????for i in range(a):
????????k2 = k1 + []
????????for j in range(b):
????    if X[i] == Y[j]:
?????????????? k1[j+1] = k2[j] + 1
      elif k1[j+1] < k1[j]:
????????????????k1[j+1] = k1[j]

  return k1[-1]

n = input()
for l in range(n):
????print common()

### FIXED CODE ###

def common():
  X = raw_input()
  Y = raw_input()
  a = len(X)
  b = len(Y)
  k1 = [0 for i in range(b+1)]
 
  for i in range(a):
     k2 = k1 + []
     for j in range(b):
       if X[i] == Y[j]:
          k1[j+1] = k2[j] + 1
       elif k1[j+1] < k1[j]:
          k1[j+1] = k1[j]
 
  return k1[-1]
 
n = input()
for l in range(n):
  print common()
while True:
    m=input().split()
    h=int(m[0])
    w=int(m[1])
    if (a==0)(b==0):
      break
    for i in range(a):
       print("#"*b)
print()
    


### FIXED CODE ###

while True:
    v=input().split()
    a=int(v[0])
    b=int(v[1])
    if a==0 and b==0:
       break
    for i in range (a):
        print('#'*b)
    print()
N,X = map(int,input().split())
Alist = list(map(int,input().split()))
for i in range(len(Alist)):
    Alist[i] = abs(Alist[i]-X)
Alist.sort()
p = []
q = 1
for i in range(1,len(Alist)):
    if Alist[i] % Alist[0] != 0:
        p.appnd(Alist[i] % Alist[0])
        q = q*0
p.sort()
r = 1
if p != []:
    for i in range(0,len(Alist)):
        if Alist[i] % p[0] != 0:
            r = r*0
if len(Alist) > 1:
    if q == 0 and r == 1:
        print(p[0])
    if q == 0 and r == 0:
        print(1)
    if q == 1:
        print(Alist[0])
else:
    print(Alist[0])

### FIXED CODE ###

N,X = map(int,input().split())
Alist = list(map(int,input().split()))
for i in range(len(Alist)):
    Alist[i] = abs(Alist[i]-X)
Alist.sort()
p = []
q = 1
for i in range(1,len(Alist)):
    if Alist[i] % Alist[0] != 0:
        p.append(Alist[i] % Alist[0])
        q = q*0
p.sort()
r = 1
s = []
if p != []:
    for i in range(0,len(Alist)):
        s.append(Alist[i] % p[0])
        if Alist[i] % p[0] != 0:
            p[0] = Alist[i] % p[0]
if len(Alist) > 1:
    if q == 0 and r == 1:
        print(p[0])
    if q == 0 and r == 0:
        print(1)
    if q == 1:
        print(Alist[0])
else:
    print(Alist[0])
N,M=map(int,input().split())
C=[0]*M
for i in range(N):
    A=list(map(int,input().split()))
    for j in range(1,A[0]+1):
        C[A[j]]+=1
print(C.count(N))

### FIXED CODE ###

N,M=map(int,input().split())
A=[]
for i in range(N):
    B=list(input().split())
    for j in range(1,int(B[0])+1):
        A.append(B[j])
count=0
for k in range(M+1):
    if A.count(str(k))==N:
        count+=1
print(count)
a, b, c = list(input().split())
print('YES' if b - a == c - b else 'NO')


### FIXED CODE ###

a, b, c = list(map(int, input().split()))
print('YES' if b - a == c - b else 'NO')
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
b, c = map(int, input().split())
# 文字列の入力
#s = input()
#連結
#aaa = str(b) + str(c)
#print(aaa)
aaa = ''
bbb = ''
for num in range(c):
	aaa += str(b)
	
for num in range(b):
	bbb += str(c)
#一桁目取得
testa = aaa[1]
testb = bbb[1]

# 出力
if(testa < testb):
	print(aaa)
else:
	print(bbb)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
#while True:
b, c = map(int, input().split())
#	if(b < 10 and c < 10):
#		break
# 文字列の入力
#s = input()
#連結
#aaa = str(b) + str(c)
#print(aaa)
aaa = ''
bbb = ''
for num in range(c):
	aaa += str(b)
	
for num in range(b):
	bbb += str(c)


#一桁取得
testa = aaa[0]
testb = bbb[0]

# 出力
if(testa < testb):
	print(aaa)
else:
	print(bbb)
def main():
    n,k = map(int,input().split())
    X = list(map(int,input().split()))

    import bisect

    i = bisect.bisect_left(X,0)
    if X[i] == 0:
        k -= 1

    ans = 10**9
    for j in range(-k,1):
        # print(j)
        if i + j < 0 or i+j+k-1 >len(X)-1:
            continue
        l = X[i+j]
        r = X[i+j+k-1]

        l = min(0,l)
        r = max(r,0)

        a = min(abs(l),abs(r))
        b = max(abs(l),abs(r))

        t = 2*a + b
        ans = min(t,ans)

    print(ans)



main()

### FIXED CODE ###

import bisect

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

s = bisect.bisect_left(X,0)
if 0 in X:
    K -= 1
else:
    bisect.insort_left(X,0)
    N += 1

MIN = 2 * 10**9
for i in range(K+1):
    if s - K + i >= 0 and s + i <N:
        f = X[s -K+i]
        l = X[s+i]
        if abs(f) < abs(l):
            ans = abs(f) * 2 + abs(l)
        else:
            ans = abs(l) * 2 + abs(f)
        MIN =min(MIN,ans)

print(MIN)
n, x = map(int, input().split())


def p(level):
    if level == 0:
        return 1
    return 2*p(level-1)+1


def a(level):
    if level == 0:
        return 1
    return 2*a(level-1)+3


def f(level, x):
    if x <= 1:
        return 0
    else:
        ai_1 = a(level-1)
        if 1 < x <= 1 + ai_1:
            return f(level-1, x-1)
        else:
            pi_1 = p(level-1)
            return 1 + pi_1+f(level-1, x-2-ai_1)


print(f(n, x))

### FIXED CODE ###

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


def p(level):
    if level == 0:
        return 1
    return 2*p(level-1)+1


def a(level):
    if level == 0:
        return 1
    return 2*a(level-1)+3


def f(N, X):
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a(N-1):
        return f(N-1, X-1)
    else:
        return p(N-1) + 1 + f(N-1, X-2-a(N-1))



print(f(n, x))
import numpy as np
n,W=map(int,input().split()
wv=[list(map(int,input().split())) for i in range(n)]
wv=np.array(wv)
dp=[0]*(W+1)
dp=np.array(dp)
for w,v in wv:
  dp[w:]=np.maximum(dp[w:],dp[:-w]+v)
print(dp[W])

### FIXED CODE ###

import numpy as np
n,W=map(int,input().split())
wv=[list(map(int,input().split())) for i in range(n)]
wv=np.array(wv)
dp=[0]*(W+1)
dp=np.array(dp)
for w,v in wv:
  dp[w:]=np.maximum(dp[w:],dp[:-w]+v)
print(dp[W])
def most_frequent(List):
    counter = 0
    num = List[0]

    for i in List:
        curr_frequency = List.count(i)
        if(curr_frequency> counter):
            counter = curr_frequency
            num = i

    return num

n = int(input())
c = []
for i in range(n):
    x,y = map(int,input().split())
    c.append([x,y])
c = sorted(c)
l = []
for i in range(len(c)-1):
    l.append([c[i+1][0]-c[i][0],c[i+1][1]-c[i][1]])
z = most_frequent(l)
l = 1
for i in range(1,len(c)):
    if(c[i][0]-c[i-1][0]!=z[0] or c[i][1]-c[i-1][1]!=z[1]):
        l+=1
print(l)


### FIXED CODE ###

def most_frequent(List):
    counter = 0
    num = List[0]

    for i in List:
        curr_frequency = List.count(i)
        if(curr_frequency> counter):
            counter = curr_frequency
            num = i

    return num

n = int(input())
c = []
for i in range(n):
    x,y = map(int,input().split())
    c.append([x,y])
c = sorted(c)
l = []
for i in range(len(c)-1):
    for j in range(i+1,len(c)):
        l.append([c[j][0]-c[i][0],c[j][1]-c[i][1]])
if(n==1):
    z = most_frequent(c)
else:
    z = most_frequent(l)
l = 1
for i in range(1,len(c)):
    if([c[i][0]-z[0],c[i][1]-z[1]] not in c):
        l+=1
print(l)
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]

for j in range(n):
  if ct[j][1] <= t:
    c = ct[j][0]
    k = j
    break

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)

### FIXED CODE ###

n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
T = []

for h in range(n):
  T.append(ct[h][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
      c = ct[j][0]
      k = j
      break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)
x = int(input())
print(str(x)+"????????????"+str(x*x*x))

 print(eval(input())**3)

### FIXED CODE ###

x = int(input())
print(x*x*x)
from math import *
from fractions import *
a,b,c,d=map(int,raw_input().split())
lcm=lambda x,y: x*y//gcd(x,y)

print(b-a+1 - ((b-a+1)//c + (b-a+1)//d - (b-a+1)//lcm(c,d)))

### FIXED CODE ###

from math import *
from fractions import *
a,b,c,d=map(int,input().split())

def lcm(a,b):
    return a * b // gcd(a, b)

def f(a,b,c):
    return (b - a + 1) // c + (1 if b % c <= a % c else 0)

if c != 1 and d != 1:
    print ((b-a+1) - (b // c - ceil(a / c) + 1) - (b // d - ceil(a / d) + 1) + (b // lcm(c, d) - ceil(a / lcm(c, d)) + 1))
else:
    print (0)
n = int(input())
li = list(n)
if sum(li)%n==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = input()
li = list(n)
li = [int(i) for i in li]

if int(n)%sum(li)==0:
  print('Yes')
else:
  print('No')
n, k = map(int, input().split())
s = list(map(lambda x: x == "1", list(input())))

change_flg = False
cnt = 0
ilands = []


def cumsum(array):
    value = array[0]
    results = [value] * len(array)
    for index, elm in enumerate(array[1:], 1):
        value += elm
        results[index] = value
    return results


def change():
    global cnt, change_flg
    ilands.append(cnt)
    cnt = 0
    change_flg = not change_flg

for value in s:
    if value: # case 1 cnt
        if change_flg:
            change()
    else: # case 0 cnt : plus
        if not change_flg:
            change()
    cnt += 1

ilands.append(cnt)

if len(ilands) <= k:
    print(n)
    exit()

if not len(ilands) % 2:
    ilands.append(0)

merged = list(cumsum(ilands))
section = 2 * k + 1

results = [0] * (len(ilands) // 2 - (k - 1))

merged.append(0)
for i in range(len(results)):
    start = i * 2 - 1
    results[i] = merged[start + section] - merged[start]

print(max(results))


### FIXED CODE ###

n, k = map(int, input().split())
s = list(map(lambda x: x == "1", list(input())))

change_flg = False
cnt = 0
ilands = []


def cumsum(array):
    value = array[0]
    results = [value] * len(array)
    for index, elm in enumerate(array[1:], 1):
        value += elm
        results[index] = value
    return results


def change():
    global cnt, change_flg
    ilands.append(cnt)
    cnt = 0
    change_flg = not change_flg

for value in s:
    if value: # case 1 cnt
        if change_flg:
            change()
    else: # case 0 cnt : plus
        if not change_flg:
            change()
    cnt += 1

ilands.append(cnt)

if not len(ilands) % 2:
    ilands.append(0)

merged = list(cumsum(ilands))
section = 2 * k + 1

results = [0] * (len(ilands) // 2 - (k - 1))
if len(results) < 1 or len(merged) < section:
    print(n)
    exit()

merged.append(0)
for i in range(len(results)):
    start = i * 2 - 1
    results[i] = merged[start + section] - merged[start]

print(max(results))
N, K = map(int, input().split())
h = sorted([int(input()) for i in range(N)])
print(min([h[i+K] - h[i] for i in range(N-K+1)]))

### FIXED CODE ###

N, K = map(int, input().split())
h = sorted([int(input()) for i in range(N)])
print(min([h[i+K-1] - h[i] for i in range(N-K+1)]))
N, R = map(int, input().split())
ans = 0

if(N>=10):
  ans = R
else:
  ans = R + 100×(10−K)

print(ans)


### FIXED CODE ###

N, R = map(int, input().split())
ans = 0

if(N>=10):
  ans = R
else:
  ans = R + 100*(10 - N)

print(ans)
import math

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

def is_ok(mid):
    cnt = 0
    for i in range(N):  cnt += (math.ceil(A[i] / mid) - 1)
    return cnt <= K

def binary_search(left, right):
    while (abs(right - left) > 1):
        mid = (left + right) // 2
        if is_ok(mid):  right = mid
        else:  left = mid
    return right

if K == 0:  print(max(A))
else:
    left = max(A)
    right = -1
    ret = binary_search(right, left)
    print(ret)

### FIXED CODE ###

import math

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

def is_ok(mid):
    cnt = 0
    for i in range(N):  cnt += (math.ceil(A[i] / mid) - 1)
    return cnt <= K

def binary_search(left, right):
    while (abs(right - left) > 1):
        mid = (left + right) // 2
        if is_ok(mid):  right = mid
        else:  left = mid
    return right

if K == 0:  print(max(A))
else:
    left = max(A)
    right = 0
    ret = binary_search(right, left)
    print(ret)
import sys

N = int(input())

if N == 1:
    print('aaa')
    sys.exit(0)
    

infos = []
first_info = []
second_info = []
for _ in range(N):
    x, y, h = map(int, input().split())
    if h > 0 and len(first_info) == 0:
        first_info = [x, y, h]
    elif h > 0 and len(second_info) == 0:
        second_info = [x, y, h]
    elif h > 0:
        infos.append([x, y, h])


# cxとcyを1つに絞り込む
x1, y1, h1 = first_info
x2, y2, h2 = second_info
kouhos = []
for cx in range(101):
    for cy in range(101):
        if h1-h2 == abs(x2-cx) + abs(y2-cy) - abs(x1-cx) - abs(y1-cy):
            kouhos.append([cx, cy])

#print(kouhos)
kouho_isvalid = [True for _ in range(len(kouhos))]

for info in infos:
    x2, y2, h2 = info
    for i in range(len(kouhos)):
        cx, cy = kouhos[i]
        if h1-h2 != abs(x2-cx) + abs(y2-cy) - abs(x1-cx) - abs(y1-cy):
            kouho_isvalid[i] = False


for i in range(len(kouhos)):
    if kouho_isvalid[i]:
        cx, cy = kouhos[i]

H = h1 + abs(x1-cx) + abs(y1-cy)
print(cx, cy, H)


### FIXED CODE ###

N = int(input())

infos = []
first_info = []
for _ in range(N):
    x, y, h = map(int, input().split())
    if h > 0 and len(first_info) == 0:
        first_info = [x, y, h]
    else:
        infos.append([x, y, h])


# cxとcyを1つに絞り込む
x1, y1, h1 = first_info
for cx in range(101):
    for cy in range(101):
        isValid = True
        H = h1 + abs(x1-cx) + abs(y1-cy)
        for x2, y2, h2 in infos:
            if h2 != max(H - abs(x2-cx) - abs(y2-cy), 0):
                isValid = False

        if isValid:
            ans = [cx, cy]

cx, cy = ans
H = h1 + abs(x1-cx) + abs(y1-cy)
print(cx, cy, H)
A, B = map(int, input().split())

if A > B:
    ans = 'GREATER'
elif A == B:
    ans = 'EQUAL'
else:
    ans = 'LESS'

### FIXED CODE ###

A = int(input())
B = int(input())
if A > B:
    ans = 'GREATER'
elif A == B:
    ans = 'EQUAL'
else:
    ans = 'LESS'

print(ans)
N,K = map(int,input().split())
h = list(map(int,input().split()))
dp=[0for i in range(N)]
dp[0]= 0
for j in range(1,K+1):
    dp[j]= abs(h[0]-h[j])

for i in range(K,N):
    list1 =[]
    for k in range(1,K+1):
        cost = dp[i-k]+abs(h[i-k]-h[i])
        list1.append(cost)
    dp[i]= min(list1)
        
print(dp[N-1])

### FIXED CODE ###

import numpy as np
N,K = map(int,input().split())
h = np.array(list(map(int,input().split())))
dp=np.array([0 for i in range(N)])
dp[0]= 0
dp[1]=abs(h[1]-h[0])
if N<=K:
    dp[N-1]=abs(h[0]-h[N-1])
else:  
    for i in range(2,N):
      j=max(0,i-K)
      dp[i]=np.min(dp[j:i]+np.abs(h[i]-h[j:i]))
      #dp[i]=min([dp[i-j]+abs(h[i]-h[i-j]) for j in range(1,min(k+1,i+1))])
print(int(dp[-1]))
s = list(input())
pos = 0
str_len = len(s)
count = 0
state = 0

while pos < str_len:
    if state == 0:
        if s[pos] == "A":
            state = 1
        pos += 1
    elif state == 1:
        if s[pos] == "B":
            state = 2
        elif s[pos] == "A":
            state = 1
        else:
            state = 0
        pos += 1
    elif state == 2:
        if s[pos] == "C":
            s[pos-2:pos+1] = "BCA"
            # pos -= 3
            # if pos < 0:
            #     pos = 0
            pos = 0
            count += 1
            print(s)
        else:
            pos += 1
        state = 0

print(count)


### FIXED CODE ###

s = input()
pos = 0
str_len = len(s)
count = 0
seq_a = 0
seq_bc = 0

while pos < str_len:
    if s[pos] == "A":
        while pos < str_len and s[pos] == "A":
            seq_a += 1
            pos += 1
        if pos + 1 < str_len and s[pos] == "B" and s[pos+1] == "C":
            while pos < str_len and s[pos] == "B" and pos + 1 < str_len and s[pos+1] == "C":
                seq_bc += 1
                pos += 2
            count += seq_a * seq_bc
            if pos < str_len and s[pos] != "A":
                seq_a = 0
            seq_bc = 0
        else:
            pos += 1
            seq_a = 0
    else:
        pos += 1
        seq_a = 0

print(count)
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
S = []
c = 0
s = sum(A)
table = [0] * 100000
 
for i in A:
    table[i] += 1
 
for i in range(Q):
    B, C = map(int,input().split())
    c = table[B]
    s += (C - B) * c
    table[C] += table[B]
    table[B] = 0
    S.append(s)

for s in S:
    print(s)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
S = []
c = 0
s = sum(A)
table = [0] * 100001
 
for i in A:
    table[i] += 1
 
for i in range(Q):
    B, C = map(int,input().split())
    c = table[B]
    s += (C - B) * c
    table[C] += table[B]
    table[B] = 0
    S.append(s)

for s in S:
    print(s)
n,d = map(int,input().split())
d *= d
p = 0
for i in range(n):
    if(d <= x**2 + y**2):
        p += 1
print(p)

### FIXED CODE ###

n,d = map(int,input().split())
d *= d
p = 0
for i in range(n):
    x,y = map(int,input().split())
    if(d >= x**2 + y**2):
        p += 1
print(p)