Harryxun/stf_run huggingface dataset:
n = int(input())
v = list(map(int, input().split()))

vv = [[], []]
for i in range(n):
    vv[i % 2].append(v[i])

import collections
items0 = sorted(collections.Counter(vv[0]).items(), key=lambda x: -x[1])
items1 = sorted(collections.Counter(vv[1]).items(), key=lambda x: -x[1])
key0 = [x[0] for x in items0]
key1 = [x[0] for x in items1]
val0 = [x[1] for x in items0]
val1 = [x[1] for x in items1]

if key0[0] = ! key1[0]:
    if len(items0) == 1:
        print(n//2)
    else:
        print(min(n - val0[0] - val1[1], min(n - val0[1] - val1[0])))
else key0[0] != key1[0]:
    print(n - val0[0] - val1[0])


### FIXED CODE ###

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

vv = [[], []]
for i in range(n):
    vv[i % 2].append(v[i])

import collections
items0 = sorted(collections.Counter(vv[0]).items(), key=lambda x: -x[1])
items1 = sorted(collections.Counter(vv[1]).items(), key=lambda x: -x[1])
key0 = [x[0] for x in items0]
key1 = [x[0] for x in items1]
val0 = [x[1] for x in items0]
val1 = [x[1] for x in items1]

ans = n - val0[0] - val1[0]

if key0[0] == key1[0]:
    tmp0=tmp1=1000000000000000
    if len(items0) > 1:
        tmp0 = n - val0[1] - val1[0]
    if len(items1) > 1:
        tmp1 = n - val0[0] - val1[1]
    ans = min(tmp0, tmp1)
    if len(items0) == 1 and len(items1) == 1:
        ans=n//2
print(ans)
n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, n
while g >= 1:
    g //= 2
    gap.append(g)
m = len(gap)
for i in gap:
    for idx in range(i, n):
        j = idx - i
        while j >= 0 and data[j] > data[j+i]:
            data[j+i], data[j] = data[j], data[j+i]
            j -= i
            cnt += 1
print(m)
print(" ".join(map(str, gap)))
print(cnt)
for i in range(n):
    print(data[i])



### FIXED CODE ###

import sys

def shellSort(data, cnt, g, n):
    for idx in range(g, n):
        j = idx - g
        v = data[idx]
        while j >= 0 and data[j] > v:
            data[j+g] = data[j]
            j -= g
            cnt += 1
        data[j+g] = v
    return data, cnt

n, gap = int(input()), []
a = ([int(i) for i in sys.stdin.readlines()], 0)
g = 0
while g <= n//9:
    g = 3 * g + 1
    gap.append(g)
m = len(gap)
for i in gap[::-1]:
    a = shellSort(a[0], a[1], i, n)
print(m)
print(" ".join(map(str, gap[::-1])))
print(a[1])
for i in range(n):
    print(a[0][i])
xN, X = map(int, input().split())
l = list(map(int, input().split()))
m=[]
from functools import reduce
from fractions import gcd
for i in l:
    m.append(abs(i-N))
print(reduce(gcd,m))

### FIXED CODE ###

from functools import reduce
from fractions import gcd
N,X=map(int,input().split())
x=[abs(X-int(i)) for i in input().split()]
print(reduce(gcd,x))
D=input()
c=list(map(int, list(input())))
for i in range(365):
    s=list(map(int, list(input())))
for i in range(365):
    print(s.index(max(s)) + 1)

### FIXED CODE ###

D=int(input())
c=list(map(int, (input().split(' '))))
s=[]
for i in range(D):
    s.append(list(map(int, (input().split(' ')))))
for i in range(D):
    print(s[i].index(max(s[i])) + 1)
import re

str = input()
k = int(input())

strl = list(set([c for c in str]))
strl.sort()

substring = []
for h in strl:
	compiled = re.compile(h)

	i = 0
	while i >= 0:
		m = compiled.search(str, i)
		if m:
			sub = m.start()
			for i in range(sub, len(str)):
				t = str[sub:i+1]
				if(not (t in substring)):
					substring.append(t)
			substring.sort()
			if(len(substring)-len(strl) >= k-1):
				break
			i = sub + 1
		else:
			break
	else:
		continue
	break


substring.sort()
print(substring[k-1])

### FIXED CODE ###

import re

str = input()
k = int(input())

strl = list(set([c for c in str]))
strl.sort()

substring = []
for h in strl:
	compiled = re.compile(h)
	st = 0
	m = compiled.search(str, st)
	while m:
		sub = m.start()
		for i in range(sub, min(len(str), sub+5)):
			t = str[sub:i+1]
			if(not (t in substring)):
				substring.append(t)
		st = sub + 1
		m = compiled.search(str, st)
	
	if(len(substring)-len(strl) >= k-1):
		break


substring.sort()
print(substring[k-1])
input()
p = [int(x) for x in input().split()]

p_sorted = p.sorted()

diff = 0
for p_elem, p_sorted_elem in zip(p, p_sorted):
  	if p_elem !+ p_sorted_elem:
      	diff += 1

if diff == 0 or diff == 2:
  	print('YES')
else:
  	print('NO')

### FIXED CODE ###

input()
p = [int(x) for x in input().split()]
    
p_sorted = sorted(p)
    
diff = 0
for p_elem, p_sorted_elem in zip(p, p_sorted):
    if p_elem != p_sorted_elem:
        diff += 1
    
if diff == 0 or diff == 2:
    print('YES')
else:
    print('NO')
a,b,c=input().split()
time=int(int(c)/int(a))
print(int(time*b))

### FIXED CODE ###

a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
time=int(c/a)

p=time*b
print(p)
S = input()
T = input()

L = len(S)

bl = False
bl = [True for i in range(L) if S[i:] == T[:L-i] and S[:i] == T[L-i:]:]

answer = 'Yes' if bl else 'No'
print(answer)

### FIXED CODE ###

S = input()
T = input()

L = len(S)

bl = False
for i in range(L):
  if S[i:] == T[:L-i] and S[:i] == T[L-i:]:
    bl = True

answer = 'Yes' if bl else 'No'
print(answer)
N,M = map(int,input().split())

a = [int(input()) for i in range(M)]

wa = (10**9) + 7

import sympy as sym #sympyのインポート
def Fib(n):
    x = sym.symbols('x',nonnegative=True,integer=True) #変数xの宣言(非負の整数)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1)) #一般項の式
    result=Fib.subs(x,n) #xにnを代入
    result=result.evalf() #式を浮動小数点数として評価
    return int(result)





ans = 1



if M!= 1:
    length = a[0]
    ans += Fib(length+1)
    for i in range(0,M-1):
        length = a[i+1]-a[i]-1
        ans *= Fib(length+1)


    
if M==1:
    length = a[0]
    ans *= Fib(length+1)

# print(ans)

length = N-a[-1]
# print(length)

ans *= Fib(length+1)

print(ans%wa)



### FIXED CODE ###

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

a = [int(input()) for i in range(M)]

wa = (10**9) + 7

#dpを使う

dp = [0]*(N+1)
dp[0]=1
now_a = 0
if len(a)==0:
    now_a = -1
if len(a)!=0:
    a.reverse()
    now_a = a.pop()

for i in range(1,N+1):
    # print(now_a)
    if i==1:
        dp[i]=dp[i-1]
    else:
        dp[i]=dp[i-1] + dp[i-2]
    if i == now_a:
        dp[i]=0
        if len(a)!=0:
            now_a = a.pop()
        else:
            now_a = -1

# print(dp)

print(dp[N]%wa)
n = int(input())
k = int(input())
ans = 0
if k == 1:
    if n < 10:
        ans = n
    else:
        l = len(str(n))
        ans += 9 * (l - 1)
        ans += int(str(n)[0])
elif k == 2:
    if n < 11:
        ans = 0
    else:
        l = len(str(n))
        for i in range(2, l):
            ans += 9 * 9 * (i - 1)
        print(ans)
        f = int(str(n)[0])
        ans += (f - 1) * 9 * (l - 1)
        for i in range(1, l):
            if int(str(n)[i]) != 0:
                f = int(str(n)[i])
                num = i
                break
        ans += f
        ans += 9 * (l - num - 1)
else:
    if n < 111:
        ans = 0
    else:
        l = len(str(n))
        for i in range(3, l):
            ans += 9 * 9 * 9 * (i - 1) * (i - 2) // 2
        f = int(str(n)[0])
        ans += (f - 1) * 9 * 9 * (l - 1) * (l - 2) // 2
        for i in range(1, l):
            if int(str(n)[i]) != 0:
                f = int(str(n)[i])
                num = i
                break
        ans += (f - 1) * (l - num - 1) * 9
        ans += 9 * 9 * (l - num - 1) * (l - num - 2) // 2
        for i in range(num + 1, l):
            if int(str(n)[i]) != 0:
                f = int(str(n)[i])
                num = i
                break
        ans += (l - num - 1) * 9
        ans += f
print(ans)

### FIXED CODE ###

n = int(input())
k = int(input())
ans = 0
if k == 1:
    if n < 10:
        ans = n
    else:
        l = len(str(n))
        ans += 9 * (l - 1)
        ans += int(str(n)[0])
elif k == 2:
    if n < 11:
        ans = 0
    else:
        l = len(str(n))
        for i in range(2, l):
            ans += 9 * 9 * (i - 1)
        f = int(str(n)[0])
        ans += (f - 1) * 9 * (l - 1)
        for i in range(1, l):
            if int(str(n)[i]) != 0:
                f = int(str(n)[i])
                num = i
                break
        else:
            num = l - 1
            f = 0
        ans += f
        ans += 9 * (l - num - 1)
else:
    if n < 111:
        ans = 0
    else:
        l = len(str(n))
        # 54321
        # 1桁下まで 10000未満
        ans += 9 * 9 * 9 * (l - 1) * (l - 2) * (l - 3) // 6

        # 最高位の桁1小さいとこまで 50000未満
        f = int(str(n)[0])
        ans += (f - 1) * 9 * 9 * (l - 1) * (l - 2) // 2

        # 最高位の桁一致 54000未満
        for i in range(1, l):
            if int(str(n)[i]) != 0:
                f = int(str(n)[i])
                num = i
                break
        else:
            num = l - 1
        ans += (f - 1) * (l - num - 1) * 9  # その桁が0でない
        ans += 9 * 9 * (l - num - 1) * (l - num - 2) // 2  # その桁が0である

        # 54000台
        for i in range(num + 1, l):
            if int(str(n)[i]) != 0:
                f = int(str(n)[i])
                num = i
                break
        else:
            num = l - 1
            f = 0
        ans += (l - num - 1) * 9
        ans += f
print(ans)
num = int(imput())

print(num**3)


### FIXED CODE ###

cube = int(input())

print(cube**3)
def main():
    import math
    n = int(input())
    a = sorted(list(map(int,input().split())))
    d = [-1 for i in range(a[-1])]
    d[0] = 1
    for i in range(2,a[-1]):
        for j in range(1,a[-1]//i+1):
            if d[i*j-1] == -1:
                d[i*j-1] = i
    Dic = [0 for i in range(a[-1])]
    flg = 0
    for i in range(n):
        if Dic[d[a[i]-1]] != 0:
            flg = 1
            break
        else:
            Dic[d[a[i]-1]] += 1
    g=a[0]
    for i in range(1,n):
        g = math.gcd(g,a[i])
    if g > 1:
        print('not coprime')
        return
    if flg == 1:
        print('setwise coprime')
        return
    print('pairwise coprime')

if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import math
    n = int(input())
    a = sorted(list(map(int,input().split())))
    g=a[0]
    for i in range(1,n):
        g = math.gcd(g,a[i])
    if g > 1:
        print('not coprime')
        return
    d = [1 for i in range(a[-1])]
    for i in range(2,a[-1]+1):
        if d[i-1] == 1:
            for j in range(1,a[-1]//i+1):
                if d[i*j-1] == 1:
                    d[i*j-1] = i
    prm = {}
    for i in range(n):
        p = []
        while a[i] != 1:
            p.append(d[a[i]-1])
            a[i] = a[i] // d[a[i]-1]
        p = set(p)
        for p_ in p:
            if prm.get(p_)==None:
                prm[p_] = 1
            else:
                print('setwise coprime')
                return
    print('pairwise coprime')

if __name__ == "__main__":
    main()
n,x=map(int,input().split())
a=sorted(list(map(int,input().split())))
s=a[0]
i=0
while s<x:
  i+=1
  s+=a[i]
print(i)

### FIXED CODE ###

n,x=map(int,input().split())
a=sorted(list(map(int,input().split())))
for i in range(n):
  x=x-a[i]
  if x<0:
    break
if i==n-1 and x==0:
  i+=1
print(i)
a,b=map(int,input().split())
d=str(a//b)
r=str(a%b)
f=str(a/b)
print('{} {} {:f}'.format(d, r, f))

### FIXED CODE ###

a,b= map(int, input().split())
d=a//b
r=a%b
f=a/b
print(d,r,"{0:.5f}".format(f))
n = int(input())
a = list(map(int, input().split()))
a = list(set(a))
a.sort()
ans = 0
if len(a) == 1:
    print(0)
else:
    for _ in range(n):
        m = a.pop()
        ind = True
        for i in a:
            if m % i == 0:
                ind = False
                break
        if ind:
            ans += 1
    print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
m = max(a)
y = [0] * (m + 1)
for i in a:
    x = i
    while x <= m:
        y[x] += 1
        x += i
ans = 0
for j in a:
    if y[j] == 1:
        ans += 1

print(ans)
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    a, b = map(int, input().split())
    logging.info("Hello!")

    if a * b < 0:
        print(zero)
    elif a > 0:
        print("Positive")
    else:
        if (b - a + 1) % 2 == 1:
            print("Negative")
        else:
            print("Positive")
            

    
    
if __name__ == "__main__":
    main()


### FIXED CODE ###

import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    a, b = map(int, input().split())
    logging.info("Hello!")

    if a * b < 0:
        print("Zero")
    elif a > 0:
        print("Positive")
    else:
        if (b - a + 1) % 2 == 1:
            print("Negative")
        else:
            print("Positive")
            

    
    
if __name__ == "__main__":
    main()
from math import gcd
A, B = map(int, input().split())
print(int((A * B)/gcd(A, B)))

### FIXED CODE ###

from fractions import gcd
A, B = map(int, input().split())
print(int((A * B)/gcd(A, B)))
import collections

while True:
    N, Q = map(int, input().split())
    if N == 0 and Q == 0:
        break
    D = []
    for _ in range(N):
        i = list(map(int, input().split()))
        del i[0]
        [D.append(ii) for ii in i]
    c = collections.Counter(D)
    cc = c.most_common()
    if cc[0][1] >= Q:
        print(cc[0][0])
    else:
        print(0)


### FIXED CODE ###

import collections

while True:
    N, Q = map(int, input().split())
    if N == 0 and Q == 0:
        break
    D = []
    for _ in range(N):
        i = list(map(int, input().split()))
        del i[0]
        [D.append(ii) for ii in i]
    if not len(D) == 0:
        c = collections.Counter(D)
        cc = c.most_common()
        # print(cc)
        if cc[0][1] >= Q:
            ans = 1000000
            tmp = cc[0][1]
            for i in range(len(cc)):
                if cc[i][1] == tmp:
                    ans = min(cc[i][0], ans)
            print(ans)
        else:
            print(0)
    else:
        print(0)
N = int(input())
A_list = list(map(int, input().split()))

B = {}
for i in A_list:
  B.add(i)

if len(B) == N:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

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

B = set()
for i in A_list:
  B.add(i)

if len(B) == N:
  print("YES")
else:
  print("NO")
n,k,x,y=int(input())
if n>=k:
  l=n-k
  print(k＊x+l＊y)
else:
  print(n＊x)

### FIXED CODE ###

n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n>k:
  print(k * x + (n - k) * y)
else:
  print(n * x)
_ = input()
A = list(map(int, input().strip().split(' ')))

a_4,a_2,a_1 = 0,0
for a in A:
  if a%4 == 0:
    a_4 += 1
  elif a%2 == 0:
    a_2 = 1
  else:
    a_1 += 1

print('Yes' if a_4 >= a_1+a_2 else 'No')


### FIXED CODE ###

_ = input()
A = list(map(int, input().strip().split(' ')))

a_4,a_2,a_1 = 0,0,0
for a in A:
  if a%4 == 0:
    a_4 += 1
  elif a%2 == 0:
    a_2 = 1
  else:
    a_1 += 1
#print(a_4,a_2,a_1)
print('Yes' if (a_4+1) >= (a_1+a_2) else 'No')
def solve(k, n):
    if k & 1 == 0:
        return [k // 2] + [k] * (n - 1)
    xs = [((k ** i - 1) // (k - 1)) for i in range(1, -1)]
    xs = [((k ** i - 1) // (k - 1)) for i in range(n + 1, 1, -1)]
    tgt = xs[0] // 2 - 1
    mk1 = k // 2
    mk2 = mk1 + 1
    l = xs[1] * mk1
    ans = []
    for i in range(1, n - 1):
        if l == tgt:
            return ans
        nxt = l + xs[i + 1] * mk1 + 1
        if nxt > tgt:
            ans.append(mk1)
            l = nxt - xs[i + 1]
        else:
            ans.append(mk2)
            l = nxt
    if l == tgt:
        return ans
    return ans + [tgt - l]


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

print(*solve(k, n))


### FIXED CODE ###

def solve(k, n):
    if k & 1 == 0:
        return [k // 2] + [k] * (n - 1)
    ans = [k // 2 + 1] * n
    l = n
    for i in range((n - 2) // 2 + 1):
        if ans[-1] == 1:
            ans.pop()
            l -= 1
        else:
            ans[-1] -= 1
            if l < n:
                ans += [k] * (n - l)
                l = n
    return ans


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

print(*solve(k, n))
N = 3
c = []
i = 0


for i in range(N):
	c.append(list(map(str, input().strip().split(' '))))	#[A][B]

print(c[0][0] + c[1][1] + c[2][2])

### FIXED CODE ###

N = 3
c = []
i = 0

for i in range(N):
	c.append(input().strip())

out = ""

for i in range(N):
    out = out + c[i][i]
    
print(out)
# -*- coding: utf-8 -*-
import math
n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

if m == 0:
    dp = [0 for _ in range(n)] #i + 1段目に登る方法の数
    dp[0] = 1
    if n >= 2:
        dp[1] = 2
    for i in range(2, n):
        dp[i] = dp[i - 1] + dp[i - 2]
    print(dp[n - 1])
    exit()

tmp = 0
dp = [0 for _ in range(n)]
if 1 == a[tmp]:
    dp[0] = 0
    tmp += 1
else:
    dp[0] = 1
if n >= 2 and 2 == a[tmp]:
    dp[1] = 0
    tmp += 1
elif n >= 2 and 2 != a[tmp]:
    dp[1] = dp[0] + 1

for i in range(2, n):
    if tmp < m and i + 1 == a[tmp]:
        dp[i] = 0
        tmp += 1
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
#print(dp)
print(dp[n - 1] % (pow(10, 9) + 7))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

if m == 0:
    dp = [0 for _ in range(n)] #i + 1段目に登る方法の数
    dp[0] = 1
    if n >= 2:
        dp[1] = 2
    for i in range(2, n):
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
    print(dp[n - 1])
    exit()

tmp = 0
dp = [0 for _ in range(n)]
if 1 == a[tmp]:
    dp[0] = 0
    tmp += 1
else:
    dp[0] = 1
if n >= 2 and tmp < m and 2 == a[tmp]:
    dp[1] = 0
    tmp += 1
elif n >= 2 and (tmp >= m or 2 != a[tmp]):
    dp[1] = dp[0] + 1

for i in range(2, n):
    if tmp < m and i + 1 == a[tmp]:
        dp[i] = 0
        tmp += 1
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
#print(dp)
print(dp[n - 1] % (pow(10, 9) + 7))
sa = str(raw_input())
sb = str(raw_input())
sc = str(raw_input())

n = 'a'
h = ''
while True:
    if n = 'a':
        if len(sa) < 1:
            break
        h, sa = sa[0], sa[1:]
        n = h
    elif n = 'b':
        if len(sb) < 1:
            break
        h, sb = sb[0], sb[1:]
        n = h
    elif n = 'c':
        if len(sc):
            break
        h, sc = sc[0], sc[1:]
        n = h

print n


### FIXED CODE ###

sa = str(raw_input())
sb = str(raw_input())
sc = str(raw_input())

n = 'a'
h = ''
while True:
    if n == 'a':
        if len(sa) < 1:
            break
        h, sa = sa[0], sa[1:]
        n = h
    elif n == 'b':
        if len(sb) < 1:
            break
        h, sb = sb[0], sb[1:]
        n = h
    elif n == 'c':
        if len(sc) < 1:
            break
        h, sc = sc[0], sc[1:]
        n = h

print str.upper(n)
var x = x print(x*x*x)

### FIXED CODE ###

x = int(input())
print( x ** 3)
N=int(input())
a=[int(i) for i in input().split()]
rates=[0]*9
for rate in a:
    rates[rate//400]+=1
ans=0
for color in rates[:8]:
    ans+=bool(color)
ansmax=ans+rates[8]
print(ans,ansmax)

### FIXED CODE ###

N=int(input())
a=[int(i) for i in input().split()]
rates=[0]*9
for rate in a:
    rates[min(rate//400,8)]+=1
ans=0
for color in rates[:8]:
    ans+=(color!=0)
ansmax=ans+rates[8]
print(max(ans,1),ansmax)
N, M = map(int, input().split())
def root(x):
    if x == p[x]:
        return x
    p[x] = y = root(p[x])
    return y
def unite(x, y):
    px = root(x); py = root(y)
    if px < py:
        p[py] = px
    else:
        p[px] = py
*p, = range(N)

for i in range(M):
    x, y, z = map(int, input().split())
    unite(x-1, y-1)
ans = 0
for i in range(N):
    if root(i) == i:
        ans += 1
print(ans)

### FIXED CODE ###

M, K = map(int, input().split())
if 2**M <= K:
    print(-1)
    exit(0)
if M == 1:
    if K == 1:
        print(-1)
    else:
        print("0 0 1 1")
else:
    R = [i for i in range(2**M) if i != K]
    *S, = reversed(R)
    ans = [K] + R + [K] + S
    print(*ans)
age = 12
fee = 1000

if age > 13;
	print(fee)
else;
	print(fee / 2)

### FIXED CODE ###

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

if A >= 13:
	print(B)
    
elif 6 <= A <= 12:
	print(B // 2)

else:
	print(0)
print(["error",A+B],[eval(input().split().replace(" ","+"))<10])


### FIXED CODE ###

A,B=map(int,input().split())
if A+B<10:
    print(A+B)
else:
    print("error")
N,R = map(int,input().split())

if K >= 10:
  print(R)
else:
  print(R + 100*(10-K))

### FIXED CODE ###

N,R = map(int,input().split())
 
if N >= 10:
  print(R)
else:
  print(R + 100*(10-N))
from numba import njit

n, k = map(int, input().split())
arr = [0] + list(map(int, input().split())) + [0] * 1000


@njit
def solve(n, k, arr):
    INF = 1 << 60
    dp = [INF] * (n + 1000)
    dp[1] = 0

    for i in range(1, n):
        for k in range(1, k + 1):
            dp[i + k] = min(dp[i + k], dp[i] + abs(arr[i + k] - arr[i]))

    return dp[n]


print(solve(n, k, arr))

### FIXED CODE ###

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

# dp初期化
dp = [float("inf")] * n
dp[0] = 0

for i in range(1, n):
    dp[i] = min(dp[j] + abs(arr[i] - arr[j]) for j in range(max(i - k, 0), i))

print(dp[n - 1])
n,m = map(int,input().split())
branch = set(tuple(map(int,input().split())) for i in range(m))
print(branch)
que = range(n)
flag = -1
friend = [{0}]

for a,b in branch:
    for i in range(len(friend)):
        if (a in friend[i]) or (b in friend[i]):
            friend[i].add(a)
            friend[i].add(b)
            if flag >= 0:
                friend[flag] = friend[flag]|friend[i]
                friend.pop(i)
                break
            flag = i
    if flag == -1:
        friend.append({a,b})
    else: flag = -1
    print(friend)

len_friend = list(len(i) for i in friend)
print(max(len_friend))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

class Graph:
    def __init__(self,n,side):
        self.side = side
        self.neighbor = [set() for i in range(n+1)]
        self.visited = [False]*(n+1)
        self.group =[0]*n
        self.product()
    def product(self):
        for a,b in self.side:
            self.neighbor[a].add(b)
            self.neighbor[b].add(a)
    def dfs(self,x,a):
        self.group[a] += 1
        self.visited[x] = True
        for i in self.neighbor[x]:
            if self.visited[i]:continue
            self.dfs(i,a)
    def all_dfs(self):
        a = 0
        for i in range(1,n+1):
            if not self.visited[i]:
                self.dfs(i,a)
                a += 1

n,m = map(int,input().split())
side = list(tuple(map(int,input().split()))for i in range(m))
graph1 = Graph(n,side)
graph1.all_dfs()
print(max(graph1.group))