Harryxun/stf_run huggingface dataset:
using System;

namespace myApp {
    class Program {
        static void Main (string[] args) {
            int a, v;
            int b, w;
            int t;
            string[] str = Console.ReadLine ().Split (' ');
            a = int.Parse (str[0]);
            v = int.Parse (str[1]);
            string[] str1 = Console.ReadLine ().Split (' ');
            b = int.Parse (str1[0]);
            w = int.Parse (str1[1]);
            t = int.Parse (Console.ReadLine ());

            if (a <= b) {
                if (a + v * t >= b + t * w) {
                    System.Console.WriteLine ("YES");
                } else {
                    System.Console.WriteLine ("NO");
                }
            } else {
                if (a - v * t <= b - w * t) {
                    System.Console.WriteLine ("YES");
                } else {
                    System.Console.WriteLine ("NO");
                }
            }
        }
    }
}

### FIXED CODE ###

a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a<=b:
    if (a+v*t>=b+w*t) :
        print("YES")
    else:
        print("NO")
else:
    if (a-v*t<=b-w*t) :
        print("YES")
    else:
        print("NO")
N,M = map(int, input().split())
#for _ in range(M):
#    s, c = map(int, input().split())
P = [list(map(int,input().split())) for i in range(M)]
s=[]
c=[]

for i in range(M):
    s.append(P[i][0])
    c.append(P[i][1])
A=[-1]*N

k=0
for i in range (M):
    if (A[s[i]-1]==-1) or (A[s[i]-1]==c[i]):
        A[s[i]-1]=c[i]
    else:
        k=1
        print(-1)
aa=0

if k==0:
    for i in range (M):
        if A[i]==-1:
            A[i] = 0
        aa+=A[i]*pow(10,(M-i-1))

    print(aa)

### FIXED CODE ###

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

P = [list(map(int,input().split())) for i in range(M)]
s=[]
c=[]

for i in range(M):
    s.append(P[i][0])
    c.append(P[i][1])
A=[-1]*N

k=0
for i in range (M):
    if (A[s[i]-1]==-1) or (A[s[i]-1]==c[i]):
        A[s[i]-1]=c[i]
    else:
        k=1
        print(-1)
aa=0
if A[0]==0 and N>1:
    k=1
    print(-1)
if M==0:
    k=1
    if N==1:
        print(0)
    else:
        print(pow(10,(N-1)))

if k==0:
    for i in range (N):
        if A[i]==-1:
            A[i] = 0
            if A[0]==0:
                A[0]=1

        aa+=A[i]*pow(10,(N-i-1))

    print(aa)
k = int(input())
sum = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      sum += gcd(a,gcd(b,c))
print(sum)


### FIXED CODE ###

k = int(input())
from math import gcd
sum = 0
for a in range(1, k+1):
  for b in range(1, k+1):
    for c in range(1, k+1):
      sum += gcd(a, gcd(b,c))
print(sum)
H, W, K = map(int, input().split())
c = [input() for i in range(H)]
max_num = count_num(c)

ans = 0
for h in range(2**H):
  for w in range(2**W):
    cnt = 0
    for i in range(H):
      for j in range(W):
        if (h >> i) & 1:
          continue
        if (w >> j) & 1:
          continue
        if c[i][j] == '#'
          cnt +=1
    if cnt == K:
      ans +=1
print(ans) 

### FIXED CODE ###

H, W, K = map(int, input().split())
c = [input() for i in range(H)]

ans = 0
for h in range(2**H):
  for w in range(2**W):
    cnt = 0
    for i in range(H):
      for j in range(W):
        if (h >> i) & 1:
          continue
        if (w >> j) & 1:
          continue
        if c[i][j] == '#':
          cnt +=1
    if cnt == K:
      ans +=1
print(ans)
rdx = list(map(lambda x: int(x), input().split()))
r = rdx[0]
d = rdx[1]
x = rdx[2]

memo = [0 for i in range(d+1)]

memo[0] = x
for i in range(10):
  memo[i+1] = memo[i] * r - d
  print(memo[i+1])

### FIXED CODE ###

rdx = list(map(lambda x: int(x), input().split()))
r = rdx[0]
d = rdx[1]
x = rdx[2]

memo = [0 for i in range(11)]

memo[0] = x
for i in range(10):
  memo[i+1] = memo[i] * r - d
  print(memo[i+1])
s = input()
ans = "AC"
if s[0] == "A":
  c_cnt = 0
  for i in range(2,len(s)-1):
    if s[i] == "C":
      c_cnt += 1
  if c_cnt = 1:
    for i in s:
      if i.lower() != "a" and i.lower() != "c" and i.lower() != i:
        ans = "WA"
        break
  else:
    ans = "WA"
else:
  ans = "WA"
print(ans)

### FIXED CODE ###

s = input()
ans = "AC"
if s[0] == "A":
  c_cnt = 0
  for i in range(2,len(s)-1):
    if s[i] == "C":
      c_cnt += 1
  if c_cnt == 1:
    for i in s:
      if i.lower() != "a" and i.lower() != "c" and i.lower() != i:
        ans = "WA"
        break
  else:
    ans = "WA"
else:
  ans = "WA"
print(ans)
import sys
input=sys.stdin.readline
sys.sstrecursionlimit(2*10**5)
n,q=map(int,input().split())
graph=[[] for _ in range(n)]
for _ in range(n-1):
  a,b=map(int,input().split())
  graph[a-1].append(b-1)
  graph[b-1].append(a-1)
counter=[0]*n
for _ in range(q):
  p,x=map(int,input().split())
  counter[p-1]+=x
score=[0]*(n+1)
stack=[(0,-1)]
while stack!=[]:
  node,prev=stack.pop()
  score[node]=score[prev]+counter[node]
  for i in graph[node]:
    if i!=prev:
      stack.append((i,node))
print(*score[:-1])

### FIXED CODE ###

import sys
input=sys.stdin.readline
sys.setrecursionlimit(2*10**5)
n,q=map(int,input().split())
graph=[[] for _ in range(n)]
for _ in range(n-1):
  a,b=map(int,input().split())
  graph[a-1].append(b-1)
  graph[b-1].append(a-1)
counter=[0]*n
for _ in range(q):
  p,x=map(int,input().split())
  counter[p-1]+=x
score=[0]*(n+1)
stack=[(0,-1)]
while stack!=[]:
  node,prev=stack.pop()
  score[node]=score[prev]+counter[node]
  for i in graph[node]:
    if i!=prev:
      stack.append((i,node))
print(*score[:-1])
while True:
  try:
    a = [10000]
    a,b,c = map(str,raw_input().split())
    b,c=a[1],a[2]
    print "%s %d %d" %(a,b+c,200*b+300+c)
  except EOFError:
    break

### FIXED CODE ###

while True:
 try:
  a = map(str,raw_input().split())
  s = int(a[1])+int(a[2])
  d = int(a[1])*200+int(a[2])*300
  print a[0],s,d
 except EOFError: break
 except IndexError: break
class BIT:
    def __init__(self,n):
        self.size = n
        self.tree = [0]*(n+1)

    def add(self,i,x):
        while i <= self.size:
            self.tree[i] += x
            i += i&-i

    def sum(self,i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i&-i
        return s

N,Q = map(int,input().split())
C = list(map(int,input().split()))
LR = [list(map(int,input().split()))+[i] for i in range(Q)]
bit = BIT(N)
#color[i] => 色iが最後に登場したインデックス(1-indexed)
color = [0]*(N)

ANS = []
LR.sort(key=lambda x: x[1])
cur = 1
for l,r,i in LR:
    while cur <= r:
        c = C[cur-1]
        if color[c] == 0:
            color[c] = cur
            bit.add(cur,1)
        else:
            bit.add(color[c],-1)
            color[c] = cur
            bit.add(cur,1)
        cur += 1
    ANS.append((bit.sum(r)-bit.sum(l-1),i))
ANS.sort(key=lambda x: x[1])
for a,i in ANS:
    print(a)


### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline
    class BIT:
        def __init__(self,n):
            self.tree = [0]*(n+1)
            self.size = n
        
        def add(self,i,x):
            while i <= self.size:
                self.tree[i] += x
                i += i&-i
        
        def sum(self,i):
            s = 0
            while i > 0:
                s += self.tree[i]
                i -= i&-i
            return s

    N,Q = map(int,input().split())
    bit = BIT(N)
    C = list(map(int,input().split()))
    query = []
    for i in range(Q):
        l,r = map(int,input().split())
        query.append([l,r,i])
    query.sort(key=lambda x: x[1])
    ans = [0]*Q
    #良い玉のindexを1-indexで管理する
    colorMemo = [0]*(N+1)
    cur = 1
    for q in query:
        l,r,j = q
        #良い玉の情報を更新する
        for i in range(cur,r+1):
            c = C[i-1]
            if colorMemo[c]:
                bit.add(colorMemo[c],-1)
            bit.add(i,1)
            colorMemo[c] = i
        cur = r + 1
        ans[j]=bit.sum(r)-bit.sum(l-1)

    print(*ans, sep="\n")
main()
a, b =map(int, input()split())
if (a*b) % 2:
    print("Odd")
eles:
    print("Even")


### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
INF = 2000000000
n,W = map(int,input().split())
w = [0]*n
v = [0]*n
for i in range(n):
    w[i], v[i] = map(int, input().split())
sum_v = sum(v)
dp = [INF for i in range(sum_v + 1)]

# ここからメイン
dp[0] = 0
for i in range(n):
    for j in range(sum_v ,-1 ,-1):
        if j >= v[i]:
            dp[j] = min(dp[j], dp[j - v[i]] + w[i])

# n個まで使って,重さがlimit_wを超えないで価値が最大のものを求める.
for i in range(sum_v, -1, -1):
    if dp[i] <= W:
		print(i)
		break

### FIXED CODE ###

INF = 2000000000
"""
メモ : Pythonでは無限大を表す float('inf') があるが, 処理がかなり重たいので
       代わりにsum(v)より真に大きい 2*10^9 を INFとする.
       (https://atcoder.jp/contests/dp/tasks/dp_e において,PyPyを使用して,
        前者だと1060ms, 後者だと570msで2倍近く差が出ている.)
"""
n,W = map(int,input().split())
w = [0]*n
v = [0]*n
for i in range(n):
    w[i], v[i] = map(int, input().split())
sum_v = sum(v)
dp = [[INF for i in range(sum_v + 1)] for j in range(n + 1)]
# dp[i][j]には重さが入る.
# dp[i][j]=(i番目までの品物から価値がちょうどｊになるための重さの最小値)

# ここからメイン
dp[0][0] = 0
for i in range(n):
    for j in range(sum_v + 1):
        if j < v[i]:
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i + 1][j] = min(dp[i][j], dp[i][j - v[i]] + w[i])

# n個まで使って,重さがlimit_wを超えないで価値が最大のものを求める.
max_value = 0
for i in range(sum_v + 1):
    if dp[n][i] <= W:
        max_value = i
print(max_value)
S, T = list(input().split())

count = 0

for i in range(3):
  if S[i] == T[i]:
    count += 1
    
print(count)

### FIXED CODE ###

S = input()
T = input()

count = 0

for i in range(3):
  if S[i] == T[i]:
    count += 1
    
print(count)
s = input()
x = ""
for i in s
	x+="x"
print(x)

### FIXED CODE ###

s = input()
x = ""
for i in s:
	x+="x"
print(x)
s=input()
if len(set(s))=2 and count(s[0])=2:
       print('Yes')
else:
       print('No')
    

### FIXED CODE ###

s=input()
if len(set(s))==2 and s.count(s[0])==2:
    print('Yes')
else:
    print('No')
s = input()
tmp = "keyence"
# if s == "keyence":
#     print("YES")
#     exit()
cnt = 0
aaa = True
for i in s:
    if i == tmp[0]:
        aaa = True
        tmp = tmp[1:]
    else:
        if aaa and cnt == 0:
            aaa = False
            cnt += 1
        elif not aaa and cnt == 1:
            pass
        else:
            break

print("YES" if len(tmp) == 0 else "NO")

### FIXED CODE ###

s = input()
tmp = "keyence"
# if s == "keyence":
#     print("YES")
#     exit()
for i in range(len(s)):
    for j in range(i, len(s)):
        tmp2 = s[:i] + s[j:]
        if tmp2 == "keyence":
            print("YES")
            exit()
else:
    print("NO")
a = int(raw_input().split(" ")[0])
b = int(raw_input().split(" ")[1])
print a * b, 2*(a + b)

### FIXED CODE ###

x = raw_input().split(" ")
a = int(x[0])
b = int(x[1])
print a * b, 2*(a + b)
a,b=map(int,input().split())
y=0
high=0
for i in range(1,1000):
    y+=i
    x.append(y)
for xz in x:
    if xz < b:
        high=xz
print(high-a)

### FIXED CODE ###

import sys
def readQuestion():
    line = sys.stdin.readline()
    sline = line.rstrip()
    [rline,r1line]=sline.split(" ")
    a=int(rline)
    b=int(r1line)
    return a,b 

def solve(a,b):
    x=[]
    y=0
    high=0
    z=0
    u=0
    for i in range(1,1000):
        y+=i
        x.append(y)
    high = b-a
    z=high-1
    u=x[z]-b
    return u
# 全体
def main():
    x,y = readQuestion()
    answer = solve(x, y)
    print(answer)

# mainを呼び出す
if __name__ == '__main__':
    main()
from collections import Counter

n = int(input())
v = input().split()

v1 = v[::2]
v2 = v[1::2]
c1 = Counter(v1).most_common(2)
c2 = Counter(v2).most_common(2)

if c1[0][0] != c2[0][0]:
    print(n=c1[0][1] - c2[0][1])
else:
    print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))


### FIXED CODE ###

from collections import Counter

n = int(input())
v = input().split()

v1 = v[::2]
v2 = v[1::2]
c1 = Counter(v1).most_common(2)
c2 = Counter(v2).most_common(2)

if len(set(v)) == 1:
    print(len(v) // 2)
elif c1[0][0] != c2[0][0]:
    print(n - c1[0][1] - c2[0][1])
else:
    print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))
from atcoder import dsu
n,m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
ds = dsu.DSU(n)
for i in ab:
    ds.merge(i[0]-1,i[1]-1)
    
s = ds.groups()
ans = 0
for i in s:
    if len(i)==1:
        ans+=1
print(ans)

### FIXED CODE ###

import types

_atcoder_code = """
# Python port of AtCoder Library.

__version__ = '0.0.1'
"""

atcoder = types.ModuleType('atcoder')
exec(_atcoder_code, atcoder.__dict__)

_atcoder_dsu_code = """
import typing


class DSU:
    '''
    Implement (union by size) + (path compression)
    Reference:
    Zvi Galil and Giuseppe F. Italiano,
    Data structures and algorithms for disjoint set union problems
    '''

    def __init__(self, n: int = 0):
        self._n = n
        self.parent_or_size = [-1] * n

    def merge(self, a: int, b: int) -> int:
        assert 0 <= a < self._n
        assert 0 <= b < self._n

        x = self.leader(a)
        y = self.leader(b)

        if x == y:
            return x

        if -self.parent_or_size[x] < -self.parent_or_size[y]:
            x, y = y, x

        self.parent_or_size[x] += self.parent_or_size[y]
        self.parent_or_size[y] = x

        return x

    def same(self, a: int, b: int) -> bool:
        assert 0 <= a < self._n
        assert 0 <= b < self._n

        return self.leader(a) == self.leader(b)

    def leader(self, a: int) -> int:
        assert 0 <= a < self._n

        if self.parent_or_size[a] < 0:
            return a

        self.parent_or_size[a] = self.leader(self.parent_or_size[a])
        return self.parent_or_size[a]

    def size(self, a: int) -> int:
        assert 0 <= a < self._n

        return -self.parent_or_size[self.leader(a)]

    def groups(self) -> typing.List[typing.List[int]]:
        leader_buf = [self.leader(i) for i in range(self._n)]

        result = [[] for _ in range(self._n)]
        for i in range(self._n):
            result[leader_buf[i]].append(i)

        return list(filter(lambda r: r, result))
"""

atcoder.dsu = types.ModuleType('atcoder.dsu')
exec(_atcoder_dsu_code, atcoder.dsu.__dict__)
dsu = atcoder.dsu

#c
# from atcoder import dsu
n,m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
ds = dsu.DSU(n)
for i in ab:
    ds.merge(i[0]-1,i[1]-1)
    
s = ds.groups()

print(len(s)-1)
s = list(map(int, list(str(input()))))
k = int(input())

if k == 1:
    ans = s[0]
else:
    if s[0] != 1:
        ans = s[0]
    else:
        i = 0
        while i < len(s):
            i += 1
            ans = s[i]
            if s[i] != 1:
                break
print(ans)

### FIXED CODE ###

s = list(map(int, list(str(input()))))
k = int(input())

i = 0
while i + 1 <= k:
    ans = s[i]
    if s[i] != 1:
        break
    i += 1
print(ans)
A,B=map(int,input(),split())
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

A,B=map(int,input().split())
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)
# -*- coding: utf-8 -*-
H, W = map(int, input().split(' '))
table = [list(map(int, input().split(' '))) for _ in range(H)]

def get_next():
    for h in range(H):
        if h % 2:
            for w in range(W-1, -1, -1):
                yield h, w
        else:
            for w in range(W):
                yield h, w


ret = []
prv_h, prv_w = -1, -1
for h, w in get_next():
    if prv_h >= 0 and prv_w >= 0:
        if table[prv_h][prv_w] % 2:
            ret.append(prv_h, prv_w, h, w)

    prv_h, prv_w = h, w


print(len(ret))
for prv_h, prv_w, h, w in ret:
    print(prv_h + 1, prv_w + 1, h + 1, w + 1)






### FIXED CODE ###

# -*- coding: utf-8 -*-
H, W = map(int, input().split(' '))
table = [list(map(int, input().split(' '))) for _ in range(H)]

def get_next():
    for h in range(H):
        if h % 2:
            for w in range(W-1, -1, -1):
                yield h, w
        else:
            for w in range(W):
                yield h, w


ret = []
routes = list(get_next())
prv_h, prv_w = routes[0]
for h, w in routes[1:]:
    if table[prv_h][prv_w] % 2:
        ret.append((prv_h, prv_w, h, w))
        table[h][w] += 1

    prv_h, prv_w = h, w


print(len(ret))
for prv_h, prv_w, h, w in ret:
    print(prv_h + 1, prv_w + 1, h + 1, w + 1)
a="0"+input()
b="1"+input()
dp=[[0]*len(b) for i in range(len(a))]
for i in range(len(a)):
    for j in range(len(b)):
        if a[i]==b[j]:
            if i>0 and j>0:
                dp[i][j]=dp[i-1][j-1]+1
            else:
                dp[i][j]=1
        else:
            if i>0 and j>0:
                dp[i][j]=max(dp[i-1][j],dp[i][j-1])
            elif i==0 and j>0:
                dp[i][j]=dp[i][j-1]
            elif i>0 and j==0:
                dp[i][j]=dp[i-1][j]
            else:
                dp[i][j]=0

def findout(x,y):
    stack=[(x,y)]
    while stack:
        x,y=stack.pop()
        if x<0 or y<0:
            continue
        if dp[x][y]==dp[x-1][y-1]+1 and a[x]==b[y]:
            return (x,y)
        stack+=[(x-1,y),(x,y-1)]
        
ans=""
L=dp[-1][-1]
x,y=len(a)-1,len(b)-1
for i in range(L):
    x,y=findout(x,y)
    ans+=a[x]
    x-=1
    y-=1
print(ans[::-1])

### FIXED CODE ###

a="0"+input()
b="1"+input()
dp=[[0]*len(b) for i in range(len(a))]
for i in range(len(a)):
    for j in range(len(b)):
        if a[i]==b[j]:
            if i>0 and j>0:
                dp[i][j]=dp[i-1][j-1]+1
            else:
                dp[i][j]=1
        else:
            if i>0 and j>0:
                dp[i][j]=max(dp[i-1][j],dp[i][j-1])
            elif i==0 and j>0:
                dp[i][j]=dp[i][j-1]
            elif i>0 and j==0:
                dp[i][j]=dp[i-1][j]
            else:
                dp[i][j]=0

ans = []
x,y=len(a)-1,len(b)-1
lcs = dp[x][y]
while x > 0 or y > 0:
    if x-1 >= 0 and dp[x-1][y] == lcs:
        x -= 1
    elif y-1 >= 0 and dp[x][y-1] == lcs:
        y -= 1
    else:
        ans.append(a[x])
        y -= 1
        x -= 1
        
        lcs -= 1
print("".join(ans[::-1]))
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
if sum(a) < (1/4m) or n < m:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
for i in a:
  if i >= sum(a)*(1/(4*m)):
    cnt += 1

if cnt >= m:
  print("Yes")
else:
  print("No")
S = list(input())

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

 upper = False
 count = 0
for i in S[2:len(S)-1]:
    if i.isupper():
        count += 1

if count == 1:
    upper = True

if ac and upper:
    print("AC")
else:
    print("WA")


### FIXED CODE ###

S = list(input())

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

upper = False
count = 0
for i in S:
    if i.isupper():
        count += 1

if count == 2:
    upper = True

if ac and upper:
    print("AC")
else:
    print("WA")
r, c = [int(i) for i in input().split()]

data = []
sum_row = [0] * (c + 1)

for ri in range(r):
    data[ri].append([int(i) for i in input().split()])
    data[ri].append(sum(data[ri]))
    print(" ".join([str(d) for d in data[ri]]))
    for ci in range(c + 1):
        sum_row[ci] += data[ri][ci]
print(" ".join([str(s) for s in sum_row]))

### FIXED CODE ###

r, c = [int(i) for i in input().split()]

data = []
sum_row = [0] * (c + 1)

for ri in range(r):
    data.append([int(i) for i in input().split()])
    data[ri].append(sum(data[ri]))
    print(" ".join([str(d) for d in data[ri]]))
    for ci in range(c + 1):
        sum_row[ci] += data[ri][ci]
print(" ".join([str(s) for s in sum_row]))
h0, w0, k0 = [ int(x) for x in input().split() ]
buf = 1
for i in range(h0):
  buf[1 << w0] = { 1 << j for j,x in enumerate(input()) if x == '#' }
found = 0
for i in range(1, 1 << h0):
  idx = {}
  for k,v in buf.items():
    if k & i == 0: continue
    for v in vs: idx[v] = idx.get(v, 0) + 1
  for j in range(1, 1 << w0):
    n = sum([ v for k,v in idx.items() if k & j ])
    if n == k0: found += 1
print(found)

### FIXED CODE ###

h0, w0, k0 = [ int(x) for x in input().split() ]
found, buf = 0, {}
for i in range(h0): buf[1 << i] = { 1 << j for j,x in enumerate(input()) if x == '#' }
for i in range(1, 1 << h0):
  idx = {}
  for k,vs in buf.items():
    if k & i == 0: continue
    for v in vs: idx[v] = idx.get(v, 0) + 1
  for j in range(1, 1 << w0):
    n = sum([ v for k,v in idx.items() if k & j ])
    if n == k0: found += 1
print(found)
import sys
def input():
	sys.stdin.readline().strip()
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[sys.maxsize]*n
dp[0]=0
for i in range(n):
    for j in range(i+1,i+k+1):
        if j<n:
            dp[j]=min(dp[j], dp[i]+ abs(l[i]-l[j]))


print(dp[-1])
    
    


### FIXED CODE ###

import sys
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[sys.maxsize]*n
dp[0]=0
for i in range(n):
    for j in range(i+1,i+k+1):
        if j<n:
            dp[j]=min(dp[j], dp[i]+ abs(l[i]-l[j]))


print(dp[-1])
def bit_fullsearch(target):
    n = len(target)
    ret = []
    for i in range(2**n):
        tmp = []
        for j in range(n):
            if (i>>j)&1:
                tmp.append(target[j])
        ret.append(tmp)
    return ret

n,m,x = map(int,input().split())
choice = [i for i in range(n)]
l = [list(map(int,input().split())) for _ in range(n)]

ans = float('inf')
for lst in bit_fullsearch(choice):
    tmp = 0
    A = [0 for _ in range(m)]
    if len(lst)==0:
        continue
    elif len(lst)==1:
        tmp = l[0]
        j = lst[0]
        for k in range(m):
            A[k] += l[j][1+k]
    else:
        for j in lst:
            tmp += l[j][0]
            for k in range(m):
                A[k] += l[j][1+k]
    if min(A) >= x:
        ans = min(ans, tmp)
print(ans if ans!=float('inf') else -1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10*7)

def bit_fullsearch(target):
    n = len(target)
    ret = []
    for i in range(2**n):
        tmp = []
        for j in range(n):
            if (i>>j)&1:
                tmp.append(target[j])
        ret.append(tmp)
    return ret

n,m,x = map(int,input().split())
lst = [list(map(int,input().split())) for _ in range(n)]
ans = float('inf')

for l in bit_fullsearch(lst):
    tmp = [0 for _ in range(m+1)]
    for k in l:
        for i in range(m+1):
            tmp[i] += k[i]
    if min(tmp[1:]) >= x:
        ans = min(ans, tmp[0])
print(ans if ans!=float('inf') else -1)
x, n = map(int, input().split())
p = list(map(int, input().split()))
if n == 0:
  print(x)

# x, n = 10, 5
# p =  [4, 7, 10, 6, 5]
# ->9が解
# x, n = 6, 5
# p = [4, 7, 10, 6, 5]

# pに含まれない整数リストを、最小値-1最大値+1も含めて求める
pl = min(p)-1
pr = max(p)+2
npl = list(range(pl, pr))
np = list(set(npl) - set(p))
np.sort()

# np内で最もxに近い数値を算出する
mx = x
res = x
for k in np:
  t = abs(k - x)
  if t < mx:
    mx = t
    res = k
 
print(res)


### FIXED CODE ###

x, n = map(int, input().split())
p = list(map(int, input().split()))
if n == 0:
  print(x)
  exit()
  
# x, n = 10, 5
# p =  [4, 7, 10, 6, 5]
# ->9が解
# x, n = 6, 5
# p = [4, 7, 10, 6, 5]

# x, n = 1, 1
# # p = list(range(1, 101))
# p = [1]

# pに含まれない整数リストを、最小値-1最大値+1も含めて求める
pl = min(p)-1
pr = max(p)+2
npl = list(range(pl, pr))
np = list(set(npl) - set(p))
if len(np) == 0:
  print(x)
  exit()
np.sort()

# np内で最もxに近い数値を算出する
mx = x
res = np[0]
for k in np:
  t = abs(k - x)
  if t < mx:
    mx = t
    res = k
 
print(res)
a,b=map(int, input().split())
print(max([A+B,A-B,A*B])

### FIXED CODE ###

A,B=map(int, input().split())
print(max([A+B,A-B,A*B]))