Harryxun/stf_run huggingface dataset:
count, init = tuple(map(int, input().split(" ")))
Xs = [init] + list(map(int, input().split(" ")))
l = [abs(Xs[i]-Xs[i+1]) for i in range(count)]
for i in range(2, min(l)+1)[::-1]:
    if max(map(lambda x: x%i, l)) == 0:
        print(i)
        exit(0)
print(1)

### FIXED CODE ###

args = input().split()
if ( int(args[0]) * int(args[1]) ) % 2 == 0:
  print("No")
else:
  print("Yes")
N, K = map(int,input().split())
b = input().split()

print(N)
print(K)
print(b)

passengers = 0

for i in b:
  if int(i) >= K:
    passengers += 1

print(passengers)

### FIXED CODE ###

n = int(input())
ans = 0

if n % 2 == 0:
  ans = (n / 2) / n
else:
  ans = ((n + 1) / 2) / n
  
print(ans)
import sys

n,m,x,y = map(int, sys.stdin.readline().split())
x_list = list(map(int, sys.stdin.readline().split()))
y_list = list(map(int, sys.stdin.readline().split()))

x_max = max(x_list.append(x))
y_min = min(y_list.append(y))

if x < y:
    print("No War")
else:
    print("War")

### FIXED CODE ###

N,M,X,Y = map(int,input().split())
x = max(X,max(list(map(int,input().split()))))
y = min(Y,min(list(map(int,input().split()))))
 
if y>x:
  print("No War")
else:
  print("War")
import numpy as num
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(1):
        l=np.amin(np.array(P[:i+1]))
        if P[i]>l:
            flag=False
            break
    if flag:
        count+=1
    else:
        flag=True
print(count)

### FIXED CODE ###

N=int(input())
P=list(map(int,input().split()))
count=1
min=P[0]
for i in range(1,N):
    if min>P[i]:
      count+=1
      min=P[i]
print(count)
s = input()
ans = []
count = 0
for i in range(len(s)):
    if  s[i]  in"ACGT":
            count +=1
    else:
        ans.append(count)
        count = 0
print(max(ans))

### FIXED CODE ###

s = input()
count = 0
ans = 0
for i in range(len(s)):
    if s[i] in "ACGT":
        count += 1
        ans = max(ans,count)
    else:
        count = 0
print(ans)
a = input().split(" ")
w = int(a[0])
h = int(a[1])
x = int(a[2])
y = int(a[3])
s = w * h / 2
if w % 2 == 0:
    if h %  2 == 0:
        if x == int(w/2):
            if y == int(h/2):
                how = 1
else:
    how = 0
print(str(s) + " " + str(how))

### FIXED CODE ###

a = input().split(" ")
w = int(a[0])
h = int(a[1])
x = int(a[2])
y = int(a[3])
s = w * h / 2
if w % 2 == 0:
    if h %  2 == 0:
        if x == int(w/2):
            if y == int(h/2):
                how = 1
            else:
                how = 0
        else:
            how = 0
    else:
        how = 0
else:
    how = 0
print(str(s) + " " + str(how))
N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
	w[i], v[i] = map(int, input().split())

dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
	for j in range(W + 1):
		if j - w[i] >= 0:
			dp[i + 1][j] = dp[i][j - w[i]] + v[i]
		dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
print(dp[N][W])


### FIXED CODE ###

N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
	w[i], v[i] = map(int, input().split())

V = sum(v)
dp = [[float("inf")] * (V + 1) for _ in range(N + 1)]
"""
for j in range(V + 1):
	dp[0][j] = 0
"""
dp[0][0] = 0
# dp[i][j]:i番目までの品物から価値がj以上になるよう選んだときの重さの総和の最小値
for i in range(N):
	for j in range(V + 1):
		# i+1番目を選ぶ場合
		if j - v[i] >= 0:
			dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - v[i]] + w[i])
		# i+1番目を選ばない場合
		dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])

# print(dp)

# dp[N][j]がW以下であるようなjの最大値が答えになる
ans = 0
for j in range(V + 1):
	if dp[N][j] <= W:
		ans = j

print(ans)
class RootedTree():
    def __init__(self, N, root = 1):
        # N is the number of nodes
        # self.nodes is a list of TreeNode
        self.nodes = [None] * (N + 1) # self.nodes[0] is kept None
        self.root = root
        self.N = N # number of nodes

    def add_node(self, tree_node, num):
        self.nodes[num] = tree_node

    def add_val(self, p, x, Q):
        for j in range(1, Q + 1):
            self._add_val(p[j], x[j])

    def _add_val(self, p_val, x_val):
        self.nodes[p_val].increment_counter(x_val)
        for ch in self.nodes[p_val].children:
            self._add_val(ch, x_val)

    def print_counter(self):
        for i in range(1, N):
            print("{} ".format(self.nodes[i].counter), end = "")
        print("{} ".format(self.nodes[N].counter))

class TreeNode():
    def __init__(self, num):
        self.number = num  # integer (vertex number)
        self.counter = 0
        self.children = set()

    def add_child(self, v):
        self.children.add(v)

    def increment_counter(self, x):
        self.counter += x

class Graph():
    def __init__(self, N):
        self.AL = [None] + [set() for i in range(N)] # adjacency list
        self.N = N # number ov vertices

    def add_edge(self, u, v):
        self.AL[u].add(v)
        self.AL[v].add(u)

    def to_rooted_tree(self):
        rooted_tree = RootedTree(self.N, 1)
        self._to_rooted_tree(1, {1}, rooted_tree)
        return rooted_tree

    def _to_rooted_tree(self, v, visited, rooted_tree):
        node = TreeNode(v)
        rooted_tree.add_node(node, v)

        for u in self.AL[v]: # leaf has only one neighbour (parent)
            if not u in visited:
                visited.add(u)
                node.add_child(u)
                self._to_rooted_tree(u, visited, rooted_tree)


# input
N, Q = [int(k) for k in input().split()]
a = [None] * N # a[0] = None
b = [None] * N # b[0] = None
for i in range(1, N):
    a[i], b[i] = [int(k) for k in input().split()]
p = [None] * (Q + 1)
x = [None] * (Q + 1)
for i in range(1, Q + 1):
    p[i], x[i] = [int(k) for k in input().split()]

# create a graph
G = Graph(N)
for i in range(1, N):
    G.add_edge(a[i], b[i])

# run depth first search to form a rooted tree
T = G.to_rooted_tree()


T.add_val(p, x, Q)
T.print_counter()


### FIXED CODE ###

# 20/5/28
from collections import deque

N, Q = [int(x) for x in input().split()]
AL = [[] for _ in range(N + 1)]
for i in range(1, N):
    a, b = [int(x) for x in input().split()]
    AL[a].append(b)
    AL[b].append(a)

cnt = [0] * (N + 1)
for j in range(Q):
    p, x = [int(x) for x in input().split()]
    cnt[p] += x

visited = [False] * (N + 1)
stk = deque([1])
while stk:
    root = stk.pop()
    visited[root] = True
    for v in AL[root]:
        if not visited[v]:
            cnt[v] += cnt[root]
            stk.append(v)

s = " ".join(map(str, cnt[1:]))
print(s)
n,x=map(int,input().split())
if x==1 or x==2*n-1:print("No")
else:
  print("Yes")
  b=[0]*n
  b[n//2]=x
  b[n//2-1]=x-1
  b[n//2+1]=x+1
  tor=[i+1 for i in range(n)]
  del tor[x-2:x+1]
  for i in range(n):
    if b[i]==0:
      b[i]=tor.pop()
  for i in b:
    print(i)


### FIXED CODE ###

N=int(input())
s=input()
t=input()
for i in range(1,N+1)[::-1]:
  if s[N-i:]==t[:i]:
    print(2*N-i)
    exit()
print(2*N)
n, y = map(int, input().split())

noguchi = 1000
higuchi = 5000
yukichi = 10000

ans = '-1 -1 -1'
for i in range(n+1):
    for j in range(n+1-i):
        k = n - (i+j)
        yen = noguchi * i + higuchi * j + yukichi * k
        if yen == y:
            ans = f'{k} {j} {i}'
            break

print(ans)

### FIXED CODE ###

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

i, j, k = -1, -1, -1

for a in range(n + 1):
    for b in range(n+1-a):
        sum = (10000*a) + (5000*b) + (1000 * (n-(a+b))) if n-(a+b) >= 0 else None
        if sum == y:
            i, j, k = a, b, n-(a+b)
            break


print(i, j, k)
from numba import njit
import numpy as np

@njit("i8(i8)")
def solve(n):
    s = np.ones(n + 1, dtype=np.int64)
    ans = 1
    for i in range(2,n+1):
        for j in range(i,n+1,i):
            s[j] += 1
        ans += (i * s[i])
n = int(input()) 
print(solve(n))


### FIXED CODE ###

from numba import njit
import numpy as np


@njit("i8(i8)")
def solve(n):
    ans = 1
    res = np.ones(n + 1, dtype=np.int64)
    for i in range(2, n + 1):
        for j in range(i, n + 1, i):
            res[j] += 1
        ans += i * res[i]
    return ans


N = int(input())
print(solve(N))
n = int(input())
A = sorted(list(map(int, input().split())), reverse = True)
l = 0
ln = []
for a in A:
    if l == a:
        ln.append(a)
        l = 0
    else:
        l = a
    if len(ln) == 2:
        break
if len(ln) == 2:
    print(ln[0]*ln[1])
else:
    print(0)

### FIXED CODE ###

x,a,b = map(int, input().split())
if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")
from functools import lru_cache


@lru_cache
def factrial(n):
    ans = 1
    for i in range(1, n+1):
        ans *= i
    return ans


@lru_cache
def combinations(n, r):
    return factrial(n) // (factrial(n - r) * factrial(r))


def main():
    n, k = map(int, input().split())
    A = sorted(map(int, input().split()))
    ans = 0
    mod = 10 ** 9 + 7
    for i, a in enumerate(A[k - 1:], k - 1):
        ans += ((a % mod) * (combinations(i, k - 1) % mod)) % mod
        ans %= mod
    for i, a in enumerate(A[: n - k + 1], 1):
        ans -= ((a % mod) * (combinations(n - i, k - 1)) % mod) % mod
        ans %= mod
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from functools import lru_cache
n, k = map(int, input().split())
A = sorted(map(int, input().split()))
mod = 10 ** 9 + 7
# 階乗とその逆元の計算
factrial = [0 for _ in range(n + 1)]
factrial[0] = 1
for i in range(1, n + 1):
    factrial[i] = (factrial[i - 1] * i) % mod
inverse_factrial = list()
for f in factrial:
    inverse_factrial.append(pow(f, -1, mod))


@lru_cache(maxsize=None)
def nCr(n, r):
    return (factrial[n] * inverse_factrial[r] * inverse_factrial[n - r]) % mod


ans = 0
# 最大値の和
for i, a in enumerate(A[k - 1:], k - 1):
    ans += ((a % mod) * nCr(i, k-1)) % mod
    ans %= mod
# 最小値の和
A.reverse()
for i, a in enumerate(A[k - 1:], k - 1):
    ans -= ((a % mod) * nCr(i, k-1)) % mod
    ans %= mod
print(ans)
N=int(input())
A=list(map(int,input().split()))
g='APPROVED'
for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            g='DENIED'
            break
print(g)

### FIXED CODE ###

A=list(map(int,input().split()))
B=len(set(A))
if B==2:
    print('Yes')
else:
    print('No')
s = list(input().split())
if  s[2] == s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = list(input())
if  s[2] == s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
n, q = map(int, input().split())
ans = [0 for _ in range(n)]
trees = [[] for _ in range(n)]

for _ in range(n-1):
    a, b = map(int, input().split())
    trees[a-1].append(b-1)
    trees[b-1].append(a-1)

for _ in range(q):
    p, x = map(int, input().split())
    ans[p-1] += x

visited = [False]*n
def dfs(n):
    visited[n] = True
    for i in trees[n]:
        if visited[i]:
            continue
        ans[i] += ans[n]
        dfs(i)
dfs(0)
for i in ans:
    print(i)



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

n, q = map(int, input().split())
ans = [0 for _ in range(n)]
trees = [[] for _ in range(n)]

for _ in range(n-1):
    a, b = map(int, input().split())
    trees[a-1].append(b-1)
    trees[b-1].append(a-1)

for _ in range(q):
    p, x = map(int, input().split())
    ans[p-1] += x

visited = [False]*n
def dfs(n):
    visited[n] = True
    for i in trees[n]:
        if visited[i]:
            continue
        ans[i] += ans[n]
        dfs(i)
dfs(0)
for i in ans:
    print(i)
import fileinput

if __name__ == '__main__':
  for line in fileinput.input():
    tokens = list(map(int, line.strip().split()))
    N, K, S = tokens[0], tokens[1], tokens[2]


if S[K - 1] == 'A':
  s = S.replace('A', 'a')

elif S[K - 1] == 'B':
  s = S.replace('B', 'b')

else:
  s = S.replace('C', 'c')

print(s)


### FIXED CODE ###

nums = input().split()
N = int(nums[0])
K = int(nums[1])
S = input()
s1 = S[:K - 1]
s2 = S[K:]

if S[K - 1] == 'A':
    s = s1 + 'a' + s2

elif S[K - 1] == 'B':
    s = s1 + 'b' + s2

else:
    s = s1 + 'c' + s2

print(s)
x = input()
 print(int(x*x*x))

### FIXED CODE ###

x = input()
ans = x**3
print ans
input()
L = map(int, input().split())
print("Yes" if sum(L)>2*max(L) else "No")

### FIXED CODE ###

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

max = max(list)
sum = sum(list)

if sum > 2*max:
  print("Yes")
else:
  print("No")
n=int(input())
a=[[int(x)-1 for x in input().split()] for _ in range(n)]

cnt=0
id=[[0]*n for _ in range(n)]
for i in range(n):
	for j in range(i+1,n):
		id[i][j] = cnt
		cnt+=1
def toid(x,y):
	return id[x][y] if x<y else id[y][x]

for i in range(n):
	for j in range(n-1):
		a[i][j] = toid(i,a[i][j])

nedge = n*(n-1)//2
g=[[]for _ in range(nedge)+5]

for i in range(n):
	for j in range(1,n-1):
		g[a[i][j-1]].append(a[i][j])

calced=[False]*(nedge+5)
visited=[False]*(nedge+5)
dp=[0]*nedge

def dfs(v):
	if visited[v]:
		if not calced[v]:
			return -1
		return dp[v]
	
	visited[v]=True
	dp[v]=1
	for u in g[v]:
		ret = dfs(u)
		if ret == -1:
			return -1
		dp[v] = max(dp[v],ret+1)
	
	calced[v]=True
	return dp[v]

ans = 0
for i in range(nedge):
	res = dfs(i)
	if res==-1:
		print(-1)
		exit()
	ans = max(ans,res)
print(ans)


### FIXED CODE ###

n=int(input())
a=[[int(x)-1 for x in input().split()] for _ in range(n)]

cnt=0
id=[[0]*n for _ in range(n)]
for i in range(n):
	for j in range(i+1,n):
		id[i][j] = cnt
		cnt+=1
def toid(x,y):
	return id[x][y] if x<y else id[y][x]

for i in range(n):
	for j in range(n-1):
		a[i][j] = toid(i,a[i][j])

nedge = n*(n-1)//2
g=[[]for _ in range(nedge)]
to = [0]*nedge
for i in range(n):
	for j in range(1,n-1):
		g[a[i][j-1]].append(a[i][j])
		to[a[i][j]]+=1

from collections import deque

dp=[1]*nedge
q=deque([])
cnt = 0
for i in range(nedge):
	if to[i]==0:
		q.append(i)
		cnt+=1

ans = 1
while(q):
	e = q.popleft()
	for ne in g[e]:
		dp[ne] = max(dp[ne],dp[e]+1)
		to[ne]-=1
		if to[ne]==0:
			q.append(ne)
			cnt+=1
	ans = max(ans,dp[e])

if cnt != nedge:
	print(-1)
else:
	print(ans)
import math

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

a.sort()

if n == 2:
    print(a[1])
elif n == 3:
    gcd1 = math.gcd(a[0],a[1])
    gcd2 = math.gcd(a[1],a[2])
    gcd3 = math.gcd(a[0],a[2])
    ans = [gcd1, gcd2, gcd3]
    ans.sort()

    print(ans[-1])

else:
    gcd1 = math.gcd(a[0],a[1])
    gcd2 = math.gcd(a[1],a[2])
    gcd3 = math.gcd(a[0],a[2])

    for i in range(3,n):
        if math.gcd(gcd1, a[i]) < gcd1:
            gcd1 = math.gcd(gcd1, a[i])

    for i in range(3,n):
        if math.gcd(gcd2, a[i]) < gcd2:
            gcd2 = math.gcd(gcd2, a[i])

    for i in range(3,n):
        if math.gcd(gcd3, a[i]) < gcd3:
            gcd3 = math.gcd(gcd3, a[i])

    ans = [gcd1, gcd2, gcd3]
    ans.sort()

    print(ans[-1])

### FIXED CODE ###

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

time = 0
for i in range(n):
    if a[i] < 0:
        time += 1
        a[i] = -a[i]

sum = 0
for i in range(n):
    sum += a[i]

a.sort()

if time % 2 == 0:
    print(sum)
else:
    print(sum - a[0] * 2)
x = input()
x = x.split("\n")
y = x[1].split(" ")
y = [int(z) for z in y]
cmax = ???1000000
cmin = 1000000
csum = 0
for z in y:
    if cmax < z:
        cmax = z
    if cmin > z:
        cmin = z
    csum += z
print("%d %d %d" % (cmin, cmax, csum))

### FIXED CODE ###

x = input()
x = input()
x = x.split(" ")
x = [int(z) for z in x]
cmax = -1000000
cmin = 1000000
csum = 0
for z in x:
    if cmax < z:
        cmax = z
    if cmin > z:
        cmin = z
    csum += z
print("%d %d %d" % (cmin, cmax, csum))
x = int(input())

from bitarray import bitarray
import bisect

def index_to_number(i): return 2*i+3
def number_to_index(n): return (n-3)//2

LIMIT_NUMBER = 50
LIMIT_INDEX = number_to_index(LIMIT_NUMBER)+1

odd_primes = bitarray(LIMIT_INDEX)
# index  0 1 2 3
# number 3 5 7 9

odd_primes.setall(True)

for i in range(LIMIT_INDEX):
    if odd_primes[i] is False:
        continue
    n = index_to_number(i)
    for m in range(n**2, LIMIT_NUMBER, 2*n):
        odd_primes[number_to_index(m)] = False

primes = [index_to_number(i) for i in range(LIMIT_INDEX)
          if odd_primes[i] is True]
primes.insert(0,2)

index = bisect.bisect_left(primes,x)
print(primes[index])

### FIXED CODE ###

x = int(input())

import bisect

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

primess = primes(100010)
idx = bisect.bisect_left(primess,x)
print(primess[idx])
n = int,input()
t, a = map(int,input().split())
dic_oA = {}
dic_lA = {}
H = list(map(int,input().split()))
kome = 0
for i in H:
    T = t -i*6/1000
    kome += 1        
    if T >= a:
        dic_oA[kome] = T
    else:
        dic_lA[kome] = T
if len(dic_oA) == 0:
    print(max(dic_lA,key=dic_lA.get))
elif len(dic_lA) == 0:
    print(min(dic_oA,key=dic_oA.get))

sa_o = min(dic_oA.values())- a
sa_l = a - max(dic_lA.values())

if sa_o > sa_l:
    print(max(dic_lA,key=dic_lA.get))
else:
    print(min(dic_oA,key=dic_oA.get))





### FIXED CODE ###

n = int,input()
t, a = map(int,input().split())
dic_oA = {}
dic_lA = {}
H = list(map(int,input().split()))
kome = 0

for i in H:
    T = t -i*6/1000
    kome += 1        
    if T >= a:
        dic_oA[kome] = T
    else:
        dic_lA[kome] = T

if len(dic_oA) == 0:
    print(max(dic_lA,key=dic_lA.get))
elif len(dic_lA) == 0:
    print(min(dic_oA,key=dic_oA.get))
else:
    sa_o = min(dic_oA.values())- a
    sa_l = a - max(dic_lA.values())
    if sa_o > sa_l:
        print(max(dic_lA,key=dic_lA.get))
    else:
        print(min(dic_oA,key=dic_oA.get))
X = int(input())
flag = False
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == X:
            print('{} {}'.format(a,b))
            flag = True
            break
    if flag:
        breakX = int(input())
flag = False
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == X:
            print('{} {}'.format(a,b))
            flag = True
            break
    if flag:
        break

### FIXED CODE ###

X = int(input())
flag = False
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == X:
            print('{} {}'.format(a,b))
            flag = True
            break
    if flag:
        break
N, M = map(int, input().split())
A = list(map(int, input().split()))
sum = sum(A)
flag = 0
A = sorted(A, reverse=True)
# print(sum, A)

for i in range(0, M+1):
  if M == 0:
    break
  if A[i]<(sum/(4*M)):
    print('No')
    flag = 1
    break

if flag == 0:
  print("Yes")

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
sum = sum(A)
flag = 0
A = sorted(A, reverse=True)
# print(sum, A)

for i in range(0, M):
  if M == 0:
    break
  if A[i]<(sum/(4*M)):
    print('No')
    flag = 1
    break

if flag == 0:
  print("Yes")
import numpy as np
a = np.zeros(2,dtype = "int64")

a[0] = int(input())

def func(i):

  if(i == 1): 
    return 1
  return i + func(i - 1)

print(func(a[0]-1))

### FIXED CODE ###

n = int(input())
ans = n * (n - 1) // 2
print(int(ans))
#import numpy as np#not for pypy

def main():
    ##get int
    first_input = list(map(lambda x:int(x), input().split(" ")))
    second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    #first_input = input().split(" ")
    #second_input = input().split(" ")

    N = first_input[0]
    K = first_input[1]
    A_n_list = second_input

    current_i = N-1
    chain = [A_n_list[current_i]]
    while True:
        current_i = A_n_list[current_i]-1
        if A_n_list[current_i] in chain:
            sentou_index = chain.index(A_n_list[current_i])
            chain_roop = chain[sentou_index:]
            break
        chain.append(A_n_list[current_i])

    print(chain_roop)
    if sentou_index>=K:
        print(chain[K])
    else:
        print(chain_roop[(K-sentou_index-2)%len(chain_roop)])

if __name__ == '__main__':
    main()


### FIXED CODE ###

#import numpy as np
#import math
#from fractions import gcd

def main():

    ##get int
    #first_input = list(map(lambda x:int(x), input().split(" ")))
    #second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    first_input = input().split(" ")
    second_input = input().split(" ")

    S = first_input[0]
    T = second_input[0]

    if S==T[:-1]:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
x,k,d = map(int, input.split())
x = abs(x)
kd = k*d

if kd<=x:
    print(x-kd)
else:
    count = x // d
    k_dash = k - count
    x -= count * d
    if k_dash % 2 == 0:
        print(x)
    else:
        print(d-x)    


### FIXED CODE ###

from itertools import combinations
n = int(input())
l = list(map(int, input().split()))
comb = list(combinations(range(n), 3))
ans = 0
for i,j,k in comb:
    a = l[i]
    b = l[j]
    c = l[k]

    if a == b:
        continue
    if b == c:
        continue
    if c == a:
        continue
    if sum([a,b,c]) <= 2 * max(a,b,c):
        continue
    ans += 1
print(ans)
l = list(map(int, input().split()))
count = 0
for i in range(l):
  ll = l[i-1:i+1]
  ll.sort()
  if ll[1]==l[i]:
    count+=1
print(count)

### FIXED CODE ###

N = int(input())
l = [int(i) for i in input().split()]
count = 0
for i in range(len(l) - 2):
    ll = l[i:i + 3]
    ll.sort()
    if ll[1] == l[i+1]:
        count += 1
print(count)
n = int(input())
x = input().split(' ')
l = [int(i) for i in x]

c = 0


for i in range(1,n):
    if not boon and l[i] == l[i-1]:
        c += 1
        boon = True
    else:
        boon = False

print(c)


### FIXED CODE ###

n = int(input())
x = input().split(' ')
l = [int(i) for i in x]

c = 0

i = 0
while i+1 < n:
    if l[i] == l[i+1]:
        c += 1
        i += 2
    else:
        i += 1
print(c)
l = list(map(int, input().split()))
if int(''.join(a)) % 4 = 0:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

x = int(''.join(input().split()))
if x % 4 == 0:
    print('YES')
else:
    print('NO')
N = int( input() )
As = [ map( int, input().split() ) ]

rate = []
anycol = 0
for i in A : 
  if i >= 3200 : 
    anycol += 1 
  else : 
     rate.append( i // 400 )

count = let( set(rate) )

print( max(count, 1), min(count+anycol, 8) )

### FIXED CODE ###

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

rate = []
anycol = 0
for i in As : 
  if i >= 3200 : 
    anycol += 1 
  else : 
     rate.append( i // 400 )
 
count = len( set(rate) )
 
print( max(count, 1), count+anycol )
import math
N = int(input())
p = []

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

total_price = max(N) / 2 + sum(N) - max(N)

print(math.floor(total_price))

### FIXED CODE ###

import math
N = int(input())
p = []

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

total_price = max(p) / 2 + sum(p) - max(p)

print(math.floor(total_price))
import networkx as nx
import numpy as np

h, w, *X, = open(0).read().split()
h, w = int(h), int(w)

G = nx.grid_2d_graph(h, w)
for i, S in enumerate(X):
    for j, s in enumerate(S):
        if s == '#':
            G.remove_node((i, j))
path = nx.shortest_path(G, (0, 0), (h-1, w-1))
for node in path:
    G.remove_node(node)
print(len(G.nodes))

### FIXED CODE ###

import networkx as nx
import numpy as np

h, w, *X, = open(0).read().split()
h, w = int(h), int(w)

G = nx.grid_2d_graph(h, w)
for i, S in enumerate(X):
    for j, s in enumerate(S):
        if s == '#':
            G.remove_node((i, j))
try:
    path = nx.shortest_path(G, (0, 0), (h-1, w-1))
except nx.NetworkXNoPath:
    print(-1)
else:
    for node in path:
        G.remove_node(node)
    print(len(G.nodes))