Harryxun/stf_run huggingface dataset:
n = input()
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y < t or (x+y-t)%2 /= 0
        print("No")
        exit()
print("Yes")

### FIXED CODE ###

n = int(input())
ti=0
xi=0
yi=0
for i in range(n):
    t, x, y = map(int, input().split())
    if abs(x-xi) + abs(y-yi) > abs(t-ti) or (abs(x-xi) + abs(y-yi) + abs(t-ti)) % 2 != 0:
        print("No")
        exit()
    ti=t
    xi=x
    yi=y
print("Yes")
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/dsu>
//using namespace atcoder;

typedef long long int ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define sz(x) int(x.size())
const ll mod = 1000000007;
const ll INF = 1001001001001001000;

int main() {
    int a,b; cin >> a >> b;
    if (a >= 10 || b >= 10) cout << -1 << endl;
    else cout << a*b << endl;
    return 0;
}

### FIXED CODE ###

A,B=map(int,input().split())
if 1<=A<=9 and 1<=B<=9:
    print(A*B)
else:
    print(-1)
# ABC131C - Anti-Division
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//math.gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

### FIXED CODE ###

from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)
N, M = map(int, input().split())
A = []
for i in range(0, M):
    a = tuple(map(int, input().split()))
    A.append(a)
for x in range(10**(N-1)-1, 10**N):
    ans = str(x)
    flag = True
    for a in A:
        if ans[a[0]-1] != str(a[1]):
            flag = False
    if flag:
        print(x)
        exit(0)
print(-1)


### FIXED CODE ###

N, M = map(int, input().split())
A = []
for i in range(0, M):
    a = tuple(map(int, input().split()))
    A.append(a)
start = 10**(N-1)
if N == 1:
    start = 0
for x in range(start, 10**N):
    ans = str(x)
    flag = True
    for a in A:
        if ans[a[0]-1] != str(a[1]):
            flag = False
    if flag:
        print(x)
        exit(0)
print(-1)
import collections

li = list(map(int, input().split()))
c = collections.Counter(li)

print(count(c.keys()))

### FIXED CODE ###

import collections

li = list(map(int, input().split()))
c = collections.Counter(li)

print(len(c.keys()))
import sys

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

str_len = len(S)

for i in range(str_len):

    a = S[i]
    if i==A:
        if a=="-"
            break
        else:
            print("No")
            sys.exit()
    if str.isdecimal(a)==False:
        print("No")
        sys.exit()
print("Yes")


### FIXED CODE ###

import sys

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

str_len = len(S)

for i in range(str_len):

    a = S[i]
    if i==A:
        if a=="-":
            continue
        else:
            print("No")
            sys.exit()
    if str.isdecimal(a)==False:
        print("No")
        sys.exit()
print("Yes")
ip=[int(x) for x in input().split()]
n=list(range(ip[0],ip[1]+1))
print(n)
xl=n[:ip[2]]
xh=n[-ip[2]:]
ans=xl+xh
anset=list(set(ans))
anset.sort()
for i in anset:
	print(i)



### FIXED CODE ###

ip=[int(x) for x in input().split()]
a=ip[0]
b=ip[1]
k=ip[2]
if k>=(b-a+1):
  for i in range(a,b+1):
    print(i)
else:
	lw=list(range(a,a+k))
	hg=list(range(b-k+1,b+1))
	res=list(set(lw+hg))
	res.sort()
	for i in res:
  		print(i)
import numpy as np
from numba import double
from numba.decorators import jit

N = int(input())
Ps = list(map(int, input().split()))
Ps = np.array(Ps)
count = 0

@jit
for i in range(N):
    low = Ps[i]
    if ( np.sum(Ps[:i] < low) == 0):
        count += 1

print(count)

### FIXED CODE ###

N = int(input())
Ps = list(map(int, input().split()))
count = 0
min = Ps[0]+1

for i in range(N):
    if (Ps[i] < min):
        min = Ps[i]
        count += 1

print(count)
A , B , M = int(input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = []
for i in range(M-):
    q = list(map(int, input().split()))
    x = a[A-1] + b[B-1] - q[2]
    ans.append(x)
print(min(ans))

### FIXED CODE ###

A , B , M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = [min(a) + min(b)]
for i in range(M):
    q = list(map(int, input().split()))
    x = a[q[0]-1] + b[q[1]-1] - q[2]
    ans.append(x)
print(min(ans))
A, B, C, D, E, F = map(int, input().split())

mx = -s
ans = 0, 0
for a in range(0, F+1, A*100):
    for b in range(0, F-a+1, B*100):
        if a + b == 0:
            continue

        for c in range(0, F-a-b+1, C):
            for d in range(0, F-a-b-c+1, D):
                x = 100 * (c + d) / (a + b)
                if x <= E and mx < x:
                    mx = x
                    ans = (a + b + c + d), int(x)
print(*ans)

### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())
W = set()
for a in range(0, F+1, 100*A):
    for b in range(0, F+1, 100*B):
        W.add(a+b)
S = set()
for c in range(0, F+1, C):
    for d in range(0, F+1, D):
        S.add(c+d)

rate = -1
for w in W:
    for s in S:
        if 0 < w + s <= F and s * 100 <= E * w:
            if s / (s + w) > rate:
                rate = s / (s + w)
                ans = w + s, s
print(ans[0], ans[1])
from heapq import heappush, heappop
from collections import defaultdict

N, K = map(int, input().split())
TD = [list(map(int, input().split())) for _ in range(N)]

DT = [[d, t] for t, d  in TD]
DT.sort(reverse = True)
#print(DT)

h_in = []
cnt = defaultdict(int)

tmp = []
kiso = 0
for d, t in DT:
    if cnt[t] == 0:
        heappush(h_in, [d, t])
        kiso += d
    else:
        tmp.append([d, t])
    cnt[t] += 1

tmp = tmp[::-1]
len_h_in = len(h_in)
if len_h_in < K:
    d = K - len_h_in
    for i in range(d):
        heappush(h_in, tmp[i])
        kiso += tmp[i][0]

kind = 0
for k, v in list(cnt.items()):
    if v:
        kind += 1
#print(kiso, kind)
#print(h_in)
#print(tmp)

answer = kiso + kind ** 2
tmp = tmp[::-1]
while tmp:
    out_d, out_t = tmp.pop()
    in_d, in_t = heappop(h_in)
    
    kiso += out_d - in_d
    cnt[in_t] -= 1
    if cnt[in_t] == 0: kind -= 1
    cnt[out_t] += 1
    if cnt[out_t] == 1: kind += 1
    
    answer = max(answer, kiso + kind ** 2)

print(answer)

### FIXED CODE ###

from collections import defaultdict

N, K = map(int, input().split())
TD = [list(map(int, input().split())) for _ in range(N)]

TD.sort(key = lambda x: -x[1])
#print(TD)

tmp = [[] for _ in range(N + 1)]
cnt = defaultdict(int)
out_candidate = []
kiso = 0
kind = 0
for i in range(K):
    t, d = TD[i]
    tmp[t].append(d)
    if cnt[t]:
        out_candidate.append([t, d])
    else:
        kind += 1
    kiso += d
    cnt[t] += 1
out_candidate.sort(key = lambda x: -x[1])
#print(tmp)
#print(cnt)
#print(out_candidate)
#print(kiso, kind)

answer = []
answer.append(kiso + kind ** 2)

in_candidate = []
if K < N:
    for i in range(K, N):
        in_candidate.append(TD[i])
in_candidate.sort(key = lambda x: x[1])
#print(in_candidate)

while out_candidate and in_candidate:
    in_t, in_d = in_candidate.pop()
    if cnt[in_t] == 0:
        cnt[in_t] += 1
        out_t, out_d = out_candidate.pop()
        kiso += in_d - out_d
        kind += 1
        answer.append(kiso + kind ** 2)
        
print(max(answer))
import bisect

n, m = map(int, input().split())
data = [list(map(int, input().split())) for _ in range(m)]  # 市iの順番を保つ
py_list = [[] for _ in range(m)]  # 市iの(属する県, 誕生年)

for p, y in data:
    py_list[p-1].append(y)

for i in range(m):
    py_list[i].sort()

for p, y in data:
    pos = bisect.bisect_left(py_list[p-1], y) + 1
    print("%06d%06d" % (p, pos))

### FIXED CODE ###

import bisect

n, m = map(int, input().split())
data = [list(map(int, input().split())) for _ in range(m)]  # 市iの順番を保つ
py_list = [[] for _ in range(n)]  # 市iの(属する県, 誕生年)

for p, y in data:
    py_list[p-1].append(y)

for i in range(n):
    py_list[i].sort()

for p, y in data:
    pos = bisect.bisect_left(py_list[p-1], y) + 1
    print("%06d%06d" % (p, pos))
s=str(input())
k=int(input())

l=len(s)
chars=set()
chars1=set()
sub1=['']*l

for j in range(l):
    chars1.add(s[j])
    min_c=sorted(chars1)[0]

def subset(st,m):
    substring=set()
    if m==0:
        lst=len(st)
    else:
        lst=m
    for i in range(lst):
        n=i+1 #length = n
        for j in range(lst-i):
            substring.add(st[j:j+n])
    return substring
    

for i in range(l):
    if s[i]==min_c:
        chars=chars|subset(s[i:i+5],0)

#print(min_c,chars)

'''
for i in range(l):
    n=i+1 #length = n
    for j in range(l-i):
        chars.add(s[j:j+n])
        #print('i,j,sub',i,j,s[j:j+n])
'''

print(sorted(chars)[k-1])

### FIXED CODE ###

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

l=len(s)
chars=set()
chars1=set()
sub1=['']*l

for j in range(l):
    chars1.add(s[j])
    min_c=sorted(chars1)[0]

def subset(st,m):
    substring=set()
    if m==0:
        lst=len(st)
    else:
        lst=m
    for i in range(lst):
        n=i+1 #length = n
        for j in range(lst-i):
            substring.add(st[j:j+n])
    return substring
    
chars=chars|subset(s[max(l-10,0):],0)
for i in range(l):
    if s[i]==min_c:
        chars=chars|subset(s[i:i+5],0)

#print(min_c,chars)

'''
for i in range(l):
    n=i+1 #length = n
    for j in range(l-i):
        chars.add(s[j:j+n])
        #print('i,j,sub',i,j,s[j:j+n])
'''

print(sorted(chars)[k-1])
print("YNEOS"[int(input().replace(" ",""))%4!=0::2]

### FIXED CODE ###

print("YNEOS"[int(input().replace(" ",""))%4!=0::2])
X = [0, 0, 0]
N, X[0], X[1], X[2] = map(int, input().split())
Q = []
for _ in range(N):
    s = input()
    if s == 'AB':
        Q.append([0, 1])
    elif s == 'AC':
        Q.append([0, 2])
    else:
        Q.append([1, 2])
ans = True
ret = ''
for i in range(N):
    a = Q[i][0]
    b = Q[i][1]
    if X[a] == X[b] == 0:
        ans = False
        break
    elif i == N - 1 or X[a] < X[b]:
        ret += chr(ord(str(a)) + 17)
        X[a] += 1
        X[b] -= 1
    elif X[a] > X[b]:
        ret += chr(ord(str(b)) + 17)
        X[a] -= 1
        X[b] += 1
    else:
        s = Q[i + 1][0]
        t = Q[i + 1][1]
        if a == s or a == t:
            ret += chr(ord(str(a)) + 17)
            X[a] += 1
            X[b] -= 1
        else:
            ret += chr(ord(str(b)) + 17)
            X[a] -= 1
            X[b] += 1
    if X[i] < 0 or X[j] < 0:
        ans = False
        break
if ans:
    print('Yes')
    print('\n'.join(ret))
else:
    print('No')

### FIXED CODE ###

X = [0, 0, 0]
N, X[0], X[1], X[2] = map(int, input().split())
Q = []
for _ in range(N):
    s = input()
    if s == 'AB':
        Q.append([0, 1])
    elif s == 'AC':
        Q.append([0, 2])
    else:
        Q.append([1, 2])
ans = True
ret = ''
for i in range(N):
    a = Q[i][0]
    b = Q[i][1]
    if X[a] == X[b] == 0:
        ans = False
        break
    elif X[a] < X[b]:
        ret += chr(ord(str(a)) + 17)
        X[a] += 1
        X[b] -= 1
    elif X[a] > X[b] or i == N - 1:
        ret += chr(ord(str(b)) + 17)
        X[a] -= 1
        X[b] += 1
    else:
        s = Q[i + 1][0]
        t = Q[i + 1][1]
        if a == s or a == t:
            ret += chr(ord(str(a)) + 17)
            X[a] += 1
            X[b] -= 1
        else:
            ret += chr(ord(str(b)) + 17)
            X[a] -= 1
            X[b] += 1
    if X[a] < 0 or X[b] < 0:
        ans = False
        break
if ans:
    print('Yes')
    print('\n'.join(ret))
else:
    print('No')
A, B = map(int,input().split())
print(max(0, a - B * 2))

### FIXED CODE ###

A, B = map(int,input().split())
print(max(0, A - B * 2))
def s(way):
    global w
    w2 =[]
    for i in way:
        c[i] = 1
        for j in w[i]:
            if c[j] == 0:
                w2.append(i)
            if not w2 ==[]:
                s(w2)


n,m = map(int,input().split())
a = [0 for i in range(m)]
b = [0 for i in range(m)]
w = [[] for i in range(n)]
c = [0 for i in range(n)]
for i in range(m):
    a[i],b[i] = map(int,input().split())
    w[a[i]-1].append(b[i]-1)
    w[b[i]-1].append(a[i]-1)
ans =-1
for i in range(n):
    if c[i] == 0:
        c[i] = 1
        ans += 1
        s(w[i])

print(ans)

### FIXED CODE ###


from collections import deque

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

w = [[] for i in range(n)]
c = [0 for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    w[a-1].append(b-1)
    w[b-1].append(a-1)
ans =-1
for i in range(n):
    if c[i] == 0:
        c[i] = 1
        ans += 1
        d.append(i)
        while d:
            x = d.pop()
            for i in w[x]:
                if c[i] == 0:
                    c[i] = 1
                    d.append(i)

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

graph = [ [] for _ in range(N) ]

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

dp = [-1] * N
length = [0] * N

def count(j):
    if dp[j] != -1:
        return(dp[j])
    else:
        dp[j] = 0
        for k in graph[j]:
            dp[j] = max(count(k)+1, dp[j])
        return dp[j]

for i in range(N):
    length[i] = count(i)

print(max(length))
    


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

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

graph = [ [] for _ in range(N) ]

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

dp = [-1] * N
length = [0] * N

def cnt(j):
    if dp[j] != -1:
        return(dp[j])
    else:
        dp[j] = 0
        for k in graph[j]:
            dp[j] = max(cnt(k)+1, dp[j])
        return dp[j]

for i in range(N):
    length[i] = cnt(i)

print(max(length))
a,b,c=input().split
ans=a.upper[0]+b.upper[0]+c.upper[0]
print(ans)

### FIXED CODE ###

a,b,c=input().split()
ans=a.upper()[0]+b.upper()[0]+c.upper()[0]
print(ans)
l = input().split()
H = int(l[0])
W = int(l[1])
N = int(input())


c= [[0 for i in range(W)] for j in range(H)]

color_num = [int(i) for i in input().split()]
row = 0
column = 0

for i in range(N):
    index = color_num[i]
    for j in range(0, index):
        c[row][column] = i+1
        if column % (W-1) == 0 and column != 0:
            row += 1
            column = 0
        else:
            column += 1

for i in range(H):
    if i%2 == 1:
        print('change')
        c[i].reverse()


for i in range(0, H):
    for j in range(0, W):
        print(c[i][j], end=' ')
    print('')

### FIXED CODE ###

l = input().split()
n = int(l[0])
m = int(l[1])
print((n-1) * (m-1))
X = list(map(int,input().split()))
for i in range(5):
  if X[i] = 0:
    print(i+1)
    break

### FIXED CODE ###

X = list(map(int,input().split()))
for i in range(5):
  if X[i] == 0:
    print(i+1)
    break
n, k = map(int, input().split())
mod = 10 ** 9 + 7

ai = n - k + 1
print(ai)

for i in range(2, k +1):
    if n - k + 1 < i:
        print(0)
        continue

    ai = int(ai * (n - k - i + 2) * (k - i + 1) / (i * (i - 1)))
    print(ai % mod)


### FIXED CODE ###

import numpy as np

global mod
mod = 10 ** 9 + 7

def mpow(x, n):  # x^nをmod取りながら返す
    ans = 1
    while n != 0:
        if n & 1:
            ans = ans * x % mod
        x = x * x % mod
        n = n >> 1

    return ans

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

ai = n - k + 1
print(ai)

for i in range(2, k +1):
    if n - k + 1 < i:
        print(0)
        continue

    ai = ai * (n - k - i + 2) * (k - i + 1) % mod
    ai = ai * mpow(i*(i-1), mod-2) % mod

    print(ai)
S=input()
cnt=0
for i in range(S//2):
  if S[i]!=S[-i]:
    cnt+=1
print(cnt)

### FIXED CODE ###

S=input()
cnt=0
for i in range(len(S)//2):
  if S[i]!=S[-i-1]:
    cnt+=1
print(cnt)
n = input()
s = list(map(int,input().split()))

MAX = max(s)
nums = [0]*(MAX+1)


for i in s:
    if i == 0:
        nums[0] += 1
        nums[1] += 1
    elif i == MAX:
        nums[-1] += 1
        nums[-2] += 1
    else:
        nums[i-1] += 1
        nums[i] += 1
        nums[i+1] += 1

print(max(nums))

### FIXED CODE ###

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

MAX = max(s)
nums = [0]*(MAX+1)

if MAX == 0:
    print(n)
    exit()

for i in s:
    if i == 0:
        nums[0] += 1
        nums[1] += 1
    elif i == MAX:
        nums[-1] += 1
        nums[-2] += 1
    else:
        nums[i-1] += 1
        nums[i] += 1
        nums[i+1] += 1

print(max(nums))
N = int(input())
h = list(map(int, input().split()))

cost = [0, abs(h[1]-h[0])]
def dp(i):
  if i > len(cost):
    cost.append(min(dp(i-1)+abs(h[i]-h[i-1]), dp(i-2)+abs(h[i]-h[i-2])))
  return cost[i]

print(dp(N-1))


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

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

memo = [10**10 for _ in range(N+1)]

def dp(i):
    if i == 1:
        return 0
    elif i == 2:
        memo[i] = abs(h[i-2]-h[i-1])
        return memo[i]
    elif memo[i] < 10**10:
        return memo[i]
    else:
        memo[i] = min(
            dp(i-1) + abs(h[i-2]-h[i-1]),
            dp(i-2) + abs(h[i-3]-h[i-1]),
            dp(i-2) + abs(h[i-3]-h[i-2]) + abs(h[i-2]-h[i-1])
        )
        return memo[i]
print(dp(N))
num = input().split()

print(float(num[0]) / float(num[1]))

### FIXED CODE ###

num = input().split()

print(float(num[0]) / float(num[1]))
a, b, c = map(int,raw_input().split())
if a > b and b > c:
  print ("Yes")
else
  print ("No")

### FIXED CODE ###

a,b,c=map(int, raw_input().split())
if a < b and b < c:
  print ('Yes')
else:
  print ('No')
a, b = map(input().split())
print(int(a) * int(b))

### FIXED CODE ###

N = [int(i) for i in input().split(' ')]
print(N[0] * N[1])
from string import ascii_lowercase as letters

data = ''
while True:
	temp = input()
	if temp == '':
		break
	else:
		data += temp.lower()
'''
num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)
'''
print('')

### FIXED CODE ###

from string import ascii_lowercase as letters
import sys
data = sys.stdin.read().lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)
n, m, x, y = map(int, input().split())
xs = map(int, input().split())
ys = map(int, input().split())
if max([x] + list(xs)) < min([y] + list(ys)):
    print "No War"
else:
    print "War"

### FIXED CODE ###

n, m, x, y = map(int, input().split())
xs = map(int, input().split())
ys = map(int, input().split())
print("No War" if max([x] + list(xs)) < min([y] + list(ys)) else "War")
N=int(input())
S=list(input())
count=0
for i in range(N):
  if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
    count+=1
print(count)
    

### FIXED CODE ###

N=int(input())
S=list(input())
count=0
for i in range(N-2):
  if S[i]=="A":
    if S[i+1]=="B":
      if S[i+2]=="C":
        count+=1
print(count)
num ,m =map(int,input().split())
arr = sorted(list(map(int,input().split())),reverse=True)
print(arr)

for i in range(m):
    for j in range(len(arr)):
        if arr[j]//2 < arr[j+1]:
            arr[j] = arr[j] //2
            arr.sort(reverse=True)
            break

    print(arr)

print(sum(arr))
    

### FIXED CODE ###

import heapq as hq

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

arr = [-i for i in list(map(int,input().split()))]
hq.heapify(arr)

for i in range(m):
    hq.heappush(arr, -1*(-1*hq.heappop(arr)//2))

    
print(-1*sum(arr))
n = int(input())
a = list(map(int,input().split()))
dp = [[0,0] for i in range(1<<n)]
def merge(ls1,ls2):
  p,q,r,s = *ls1,*ls2
  ret = [max(p,r)]
  if p>r:
    ret.append(max(q,r))
  else:
    ret.append(max(p,s))
  return ret
for i in range(1<<n):
  dp[i][0] = a[i]
for i in range(n):
  for j in range(1<<n):
    if 1<<i & j:
      dp[j] = merge(dp[j],dp[1<<i^j])
ans = [0 for i in range(2**n)]
for i in range(1,1<<n):
  ans[i] = max(ans[i-1],sum(dp[i]))
for i in ans:
  if i:
    print(i)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
dp = [[0,0] for i in range(1<<n)]
def merge(ls1,ls2):
  p,q = ls1
  r,s = ls2
  ret = [max(p,r)]
  if p>r:
    ret.append(max(q,r))
  else:
    ret.append(max(p,s))
  return ret
for i in range(1<<n):
  dp[i][0] = a[i]
for i in range(n):
  for j in range(1<<n):
    if 1<<i & j:
      dp[j] = merge(dp[j],dp[1<<i^j])
ans = [0 for i in range(2**n)]
for i in range(1,1<<n):
  ans[i] = max(ans[i-1],sum(dp[i]))
for i in ans:
  if i:
    print(i)
import sys,queue,copy,heapq
sys.setrecursionlimit(10**8)
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
INF = float('inf')

N,K = inpl()

hlist = inpl()

dp = [INF for _ in range(N)]

dp[0]=0

for i in range(1,N):
    for j in range(1,K+1):
        if i-j < 0:
            break
        dp[i]=dp[i-j]+abs(hlist[i]-hlist[i-j])


print(dp[N-1][0])


### FIXED CODE ###

import numpy as np
import sys
def inpl(): return list(map(int, sys.stdin.readline().split()))
INF = float('inf')

N,K = inpl()

hlist = np.array(inpl())

dp = np.full(N,INF)

dp[0]=0

for i in range(1,N):
    s = max(0,i-K)
    dp[i] = np.min(dp[s:i]+abs(hlist[i]-hlist[s:i]))

print(int(dp[N-1]))
N = int(input())
T = []

for i in range(N):
    T.append(int(input()))

T.sort
a = T[0]

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

for i in range(N-1):
    d = gcd(a, T[i+1])
    a = int(a * T[i+1] / d)

print(a) 


### FIXED CODE ###

N = int(input())
T = []

for i in range(N):
    T.append(int(input()))

a = 1

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

for i in range(N):
    a = a * T[i] // gcd(a,T[i])

print(a)
import collections

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
c = collections.Counter(a)
data = sorted(list(set(a)))
max_ = max(a)+1
prime_bool = [True]*max_
prime_bool[0] = False

for i in range(len(data)):
  p = data[i]
  if prime_bool[p]:
    #print(p)
    k = 2
    while k*p <= max_:
      prime_bool[k*p] = False
      k += 1

count = 0
for i in range(len(prime_bool)):
  if prime_bool[i]:
    if c[i] == 1:
      count += 1
print(count)
#print(prime_bool)


### FIXED CODE ###

import collections

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
c = collections.Counter(a)
data = sorted(list(set(a)))
max_ = max(a)+1
prime_bool = [True]*max_
prime_bool[0] = False

for i in range(len(data)):
  p = data[i]
  if prime_bool[p]:
    #print(p)
    k = 2
    while k*p < max_:
      prime_bool[k*p] = False
      k += 1

count = 0
for i in range(len(prime_bool)):
  if prime_bool[i]:
    if c[i] == 1:
      count += 1
print(count)
#print(prime_bool)