peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def judgiment(number_num):
  flag = True
  for number in list(map(int, input().split())):
    if number % 2 == 0:
      if not (number % 3 == 0 or number % 5 == 0):
        flag = False
        return flag
        break
    else:
      continue
  return flag

if __name__ == "__main__":
  number_num = int(input())
  flag = judgiment(number_num)
  if flag == True:
    print("APPROVED")
  else:
    print("DENIED")
# Judge status: Accepted
H, N = map(int, input().split())
A = list(map(int, input().split()))

if sum(A) >= H:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
def main():
    N = input()
    if (N[0] == "7") or (N[1] == "7") or (N[2] == "7"):
        print("Yes")
    else:
        print("No")

    return 0


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
List = [int(n) for n in input()]
ans = [List[0]] * 4
for i in range(8):
    for j in range(3):
        if i & (1<<j):
            ans[j+1]= -List[j+1]
        else:
            ans[j+1] = List[j+1]
    if sum(ans) == 7:
        break
ans = [str(ans[0])] + ['+' + str(x) if x>0 else str(x) for x in ans[1:]]
print("".join(ans) + '=7')
# Judge status: Wrong Answer
n,m=map(int,input().split())
py=[list(map(int,(str(_+1)+' '+input()).split())) for _ in range(m)]
py.sort(key=lambda x:str(x[1])+','+str(x[2]))
a=[]
pi=0
x=0
b='00000'
ans=[]
for pyi in py:
  if pyi[1]!=pi:
    x=1
    pi=pyi[1]
  else:
    x+=1
  ans.append([pyi[0],(b+str(pyi[1]))[-6:]+(b+str(x))[-6:]])
ans.sort(key=lambda x:x[0])
for ansi in ans:
  print(ansi[1])
# Judge status: Accepted
import sys
n,m = map(int,input().split())
s_c = [list(map(int,input().split())) for s in range(m)] #0 is s, 1 is c
l = 0
if n == 1:
	n,l = 0,9
elif n == 2:
	n,l =10,99
else:
	n,l = 100,999
for i in range(n,l+1):
	bol = True
	tmp = list(str(i))
	for j in range(m):
		k = s_c[j][0]
		if tmp[k-1] != str(s_c[j][1]):
			bol = False
	if bol:
		print(i)
		sys.exit()
print(-1)
# Judge status: Wrong Answer
s=input()
s="2018"+s[:4]
# Judge status: Accepted
import itertools
n=int(input())
p=tuple(map(int,input().split()))
q=tuple(map(int,input().split()))
num=[i for i in range(1,n+1)]
l=list(itertools.permutations(num, r=None))
a=l.index(p)
b=l.index(q)
print(abs(a-b))
# Judge status: Accepted
s,t=input().split()
a,b=map(int, input().split())
u=input()

if u==s:
    print(a-1,b)
    
else:
    print(a,b-1)
# Judge status: Accepted
N = input()
A = input().rstrip().split()
As = len(set(A))
if len(A) == As:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N,M=map(int,input().split())
from1=set()
toN=set()
for i in range(M):
  a,b=map(int,input().split())
  if a==1:
    from1.add(b)
  elif b==N:
    toN.add(a)
print(("","IM")[len(from1&toN)==0]+"POSSIBLE")
# Judge status: Accepted
s = input()
t = input()

ls = len(s)
lt = len(t)
max = 0
for i in range(ls-lt+1):
  k = 0
  for j in range(i,i+lt):
    if s[j] == t[j-i]:
      k += 1
  if max < k:
    max = k
    
print(lt-max)
# Judge status: Wrong Answer
N = int(input())

tmp = input().split(' ')

a = []
result = []
for i in range(N):
    a.append(int(tmp[i]))
    if (i % 2 == 1 and a[i] % 2 == 1):
        result.append(a[i])

print(len(result))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort()

ans = 0
for i in range(n):
    ans += a[-2*(i+1)]

print(ans)
# Judge status: Accepted
W, H, x, y = map(int, input().split())
print(W * H / 2, int((x == W / 2)&(y == H / 2)))
# Judge status: Accepted
N = list(input())
flag = False

for i in range(3):
    if N[i] == '7':
        flag = True

if flag:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from math import sqrt
n = int(input())
cnt = 0
for i in range(2, int(sqrt(n))):
    if n % i == 0:
        div = i
        while n % div == 0:
            n /= div
            div *= i
            cnt += 1
        while n % i == 0:
            n /= i
if n > 1:
    cnt += 1
print(cnt)
# Judge status: Wrong Answer
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T=input()
count=0
RSP={"r" : P, "s" : R, "p" : S}
for i in range(N):
    if (i//K)%2==0<K:
        count+=RSP[T[i]]
    else:
        if i+K<N:
            if T[i]!=T[i-K] and T[i]!=T[i+K]:
                count+=RSP[T[i]]
        else:
            if T[i]!=T[i-K]:
                count+=RSP[T[i]]

print(count)
# Judge status: Accepted
n,a,b = map(int, input().split())

mod = 10**9+7
ans = pow(2,n,mod)-1

nca = 1
ncb = 1

for i in range(b):
    ncb = ncb*(n-i)%mod
    ncb *= pow(i+1,mod-2,mod)
    if i+1==a:
        nca = ncb

ans -= nca+ncb
print(ans%mod)
# Judge status: Wrong Answer
import sys
import math

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    X, Y = map(int, readline().split())
    x = X
    if Y%X==0:
        print(-1)
    else:
        print(X)



if __name__ == '__main__':
    main()
# Judge status: Accepted
n,m,k=map(int,input().split())
for i in range(n+1):
  for j in range(m+1):
    s=m*i+n*j-2*i*j
    if s==k:
      print("Yes")
      exit()
print("No")
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

from itertools import accumulate
acc = [0] + a
acc = list(accumulate(acc))

suma = sum(a)

ans = float('inf')

for i in range(n):
    ans = min(abs( 2*acc[i]-suma  ),ans  )

print(ans)
# Judge status: Accepted
import math
def factorization(N):
  tmp=N
  F=[]
  for i in range(2,int(math.sqrt(N))+1):
    if tmp%i==0:
      F.append(i)
      tmp//=i
    while tmp%i==0:
      tmp//=i
    if i>tmp:
      break
  if tmp!=1:
    F.append(tmp)
  return F

N=int(input())
F=factorization(N)
ans=0
for f in F:
  ff=f
  while N%ff==0:
    ans+=1
    N//=ff
    ff*=f
print(ans)
# Judge status: Accepted
n=int(input())
s=set()
for i in range(n):s.add(input())
print(len(s))
# Judge status: Accepted
s = list(input())
q = int(input())
front = []
end = []
flip = False
for i in range(q):
    x = input()
    if x == "1":
        flip = flip ^ True
    else:
        z,f,c = x.split()
        f = bool(int(f)-1)
        if flip ^ f:
            end.append(c)
        else:
            front.append(c)
if flip:
    s = s[::-1]
    ans = end[::-1] + s + front
else:
    ans = front[::-1] + s + end
print("".join(ans))
# Judge status: Wrong Answer
try:
  s = input()
  s = s.replace(' ', '')
  s = s.replace('hii', 'xxx')
  #print(s)

  if "hi" in s:
    print("Yes")
  else: print("No")
    
except:
  print("No")
# Judge status: Accepted
N, R = map(int, input().split())
if N < 10:
    print(R + 100 * (10 - N))
else:
    print(R)
# Judge status: Accepted
x = int(input())
for c in range(x+1):
  l = 100*c
  r = 105*c
  if l <= x <= r:
    print(1)
    exit()
else:
  print(0)
# Judge status: Accepted
n,k = map(int, input().split())
h = list(map(int, input().split()))
h.sort(reverse=True)
k = min(k,len(h))
del h[:k]
print(sum(h))
# Judge status: Accepted
N,K=map(int,input().split())
for i in range(10**18):
    if K**i<=N<K**(i+1):
        print(i+1)
        break
# Judge status: Accepted
A, B = map(int,input().split())
ans = 0

for i in range(A, B+1):
    num = str(i)
    #print(i,num[0:2],num[::-1][0:2])
    if num[0:2] == num[::-1][0:2]:
        ans += 1
print(ans)
# Judge status: Accepted
def make_divisor(n):
  divisors=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      divisors.append([n//i,i])
  return divisors

n = int(input())
lis = make_divisor(n)
for j in lis:
  if j[0]<10 and j[1]<10:
    print('Yes')
    exit(0)
print('No')
# Judge status: Accepted
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[0]*n
for i in range(1,n):
    cnt=[]
    for j in range(max(0,i-k),i):
        cnt.append(dp[j]+abs(h[j]-h[i]))
    dp[i]=min(cnt)
print(dp[-1])
# Judge status: Wrong Answer
a, b = map(int, input().split())
print("Yay") if a+b % 16 > min(a,b) else print(":(")
# Judge status: Accepted
import bisect
def main():
    N = int(input())
    A = []
    c = 1
    l = []
    for _ in range(N):
        a = int(input())
        A.append(a)
    l.append(A[-1])
    for j in reversed(A[:-1]):
        i = bisect.bisect_right(l, j)
        if i == len(l):
            l.append(j)
        else:
            l[i] = j
    print(len(l))
main()
# Judge status: Accepted
import math
x,y=map(int,input().split())

def ans(x,x2,y):
    if x>y:
        return 0
    else:
        return ans(x2,x2*2,y)+1

print(ans(x,x*2,y))
# Judge status: Accepted
N, M = map(int, input().split())
wa = [0]*N
ac = [0]*N

for i in range(M):
  p, s = map(str, input().split())
  p = int(p)
  if (s=='WA') and (ac[p-1]==0):
    wa[p-1] += 1
  else:
    ac[p-1] = 1
    
    
ans_ac = 0
ans_wa = 0
for i in range(N):
  if ac[i] == 1:
    ans_ac += 1
    ans_wa += wa[i]
    
print(str(ans_ac), str(ans_wa))
# Judge status: Wrong Answer
a,b = map(int,input().split())
if abs(a-b)%2==0:
  print(abs(a-b)//2)
else:
  print('IMPOSSIBLE')
# Judge status: Accepted
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

n=ii()
s="abcdefghijklmnopqrstuvwxyz"
ans=""
while(n>0):
    n-=1
    ans+=s[n%26]
    n//=26
print(ans[::-1])
# Judge status: Wrong Answer
def main():
    N = int(input())
    ans = ''
    base = 1
    while N != 0:
        if N % (base * -2) == 0:
            ans += '0'
        else:
            ans += "1"
            N -= base
        base *= -2
    ans = list(ans)
    ans.reverse()
    print(''.join(ans))

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in A[1::2]:
    if i % 2 == 1:
        ans += 1
print(ans)
# Judge status: Accepted
N=int(input())
l_2d = []
for i in range(N):
  l_2d.append(list(map(int,input().split())))
l_2d.sort(key=lambda x: x[1], reverse=False)
A=0
ANS='Yes'
for l in l_2d:
  A += l[0]
  if l[1] < A:
    ANS = 'No'
    break
print(ANS)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

money = 1000
stock = 0

for i in range(n-1):
  if a[i+1] > a[i]:
    stock = money // a[i]
    money = money - stock * a[i] + stock * a[i+1]
    
print(money)
# Judge status: Accepted
MOD = int(1e9 + 7)
n = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(62):
    cnt = 0
    for a in A:
        if a & 1<<i:
            cnt += 1
    ans += (1<<i % MOD) * cnt % MOD * (n - cnt) % MOD
print(ans % MOD)
# Judge status: Accepted
s=input()
if s == 'RRR':
  print(3)
elif s == 'SRR' or s == 'RRS':
  print(2)
elif s == 'SSS':
  print(0)
else:
  print(1)
# Judge status: Accepted
a, b = map(int, input().split())

c = a*b
if a == c:
  print(1)
elif b == c:
  print(1)
elif c % 2 == 0:
  print(int(c/2))
else:
  print(int(c/2)+1)
# Judge status: Accepted
x = int(input())

primes = [True]*(2*x)

for i in range(2, x):
    if primes[i]:
        for j in range(i, 2*x, i):
            primes[j] = False
for i in range(x, 2*x):
    if primes[i]:
        print(i)
        exit()
# Judge status: Wrong Answer
import math
print(math.factorial(100000)%(10**9+7))
# Judge status: Accepted
N,A,B = map(int,input().split())

ans = 0
for i in range(1,N + 1):
  a = i
  digit_sum = 0
  while a > 0:
    digit_sum += a%10
    a //= 10
  if A <= digit_sum <= B:
    ans += i
print(ans)
# Judge status: Accepted
#python3
def main():
    n, k = map(int, input().split())
    s = input()
    sc = 0
    
    for i in range(n-1):
        if s[i] == s[i+1]:
            sc += 1
    ans = min(sc+2*k, n-1)
    print(ans)
main()
# Judge status: Accepted
N,C,K=map(int,input().split())
from collections import deque
T=[int(input())for _ in range(N)]
T.sort()
T=deque(T)

ans=1
bus=T[0]+K
count=0
while T:
    i=T.popleft()
    if i>bus:
        bus=i+K
        ans+=1
        count=1
    elif count==C:
        bus=i+K
        ans+=1
        count=1
    else:
        count+=1
print(ans)
# Judge status: Accepted
K, S = map(int, input().split())

sum_three = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - (i + j) <= K:
            sum_three += 1
print(sum_three)
# Judge status: Wrong Answer
L, R, d = map(int, input().split())
print('{(R-L)//d} + 1')
# Judge status: Accepted
K, X = map(int, input().split())
L = []
for i in range(K):
    num = X+i
    L.append(num)
for j in range(K-1):
    num = (X-1) - j
    L.append(num)
L2 = sorted(L)
print(*L2)
# Judge status: Accepted
S = input()
T = input()

cnt = 0
for i in range(len(S)):
    if(S[i] != T[i]):
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
a,b,c,x,y = map(int,input().split())
if a+b<=2*c:#そのまま買えばいいとき
    print(x*a+y*b)
else:#ABピザを買ったほうが安くなる場合
    if a*x+b*y<2*c*max(x,y):
        cnt=2*c*min(x,y) #ABピザを買えるだけ買う
        if x<y: cnt+=b*(y-x)
        elif x>y: cnt+=a*(x-y)
    else:
        cnt=2*c*max(x,y)
    print(cnt)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = a
while(1):
    c = [b[0]]
    for i in range(1,len(b)):
        if b[i] % b[0]:
            c.append(b[i]%b[0])
    b = sorted(c)
    if len(b) == 1:
        print(b[0])
        exit()
# Judge status: Wrong Answer
s= input()
z=len(s)//2
flag=0
sd=s[0:z-1]
if len(s)==3:
    if s[0]==s[2]:
        flag=1
else:
    if sd==s[z+1:len(s)-1]:
        if sd==sd[::-1]:
            flag=1
if flag==1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, m = map(int, input().split())

if n*2 < m:
    print((2*n+m)//4)
else:
    print(m//2)
# Judge status: Accepted
INF = 10 ** 9 + 7

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0] * (N + 1)
for i in range(M):
    dp[a[i]] = -1

dp[0] = 1
for i in range(1, N + 1):
    if dp[i] == -1: continue
    tmp = 0
    if dp[i - 1] != -1:
        tmp += dp[i - 1]
    if dp[i - 2] != -1 and i > 1:
        tmp += dp[i - 2]
    dp[i] = tmp % INF

print(dp[N])
# Judge status: Wrong Answer
import bisect

a, b = map(int, input().split())

towers = []
last = 0
for i in range(1, 1000):
    towers.append(last+i)
    last += i

i = bisect.bisect_left(towers, a)
print(towers[i] - a)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A.sort()
A = A[::-1]
ans = 0
if N%2==0:
    for i in range(N//2):
        if i==0:
            ans += A[i]
        else:
            ans += 2*A[i]
else:
    for i in range(N//2):
        if i==0:
            ans += A[i]
        else:
            ans += 2*A[i]
    ans += A[N//2]
print(ans)
# Judge status: Accepted
n = int(input())
lp = []
for i in range(3,int(n//2)+1):
  for k in lp:
    if i%2 == 0 or i%k == 0:
      break
  else:
    lp.append(i)

ans = 0
for i in (range(n)):
  li = []
  for k in lp:
    tmp = i+1
    cnt = 0
    while tmp%k == 0:
      tmp //= k
      cnt += 1
    if cnt > 0:
      li.append(cnt)
  if li in [[1,1,1], [1,3], [3,1], [7]]:
    ans += 1

print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python3

a, b, c = map(int, input().split())

if a + b*2 >= c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, k = map(int, input().split())
res = set()
for i in range(a, a + k):
    res.add(min(b, i))

for i in range(b, b - k, -1):
    res.add(max(a, i))

res = sorted(list(res))
for i in range(len(res)):
    print(res[i])
# Judge status: Wrong Answer
a=int(input())
print(a*+a*a+a**3)
# Judge status: Accepted
from collections import deque
s=deque(input())
q=int(input())
flag = 2

for i in range(q):
    query=input().split()
    if query[0] == "1":
        flag = 3 - flag
    elif int(query[1]) - flag :
         s.appendleft(query[2])
    else:
        s.append(query[2])

if flag-2:
    s.reverse()

print("".join(s))
# Judge status: Wrong Answer
s = input()
n = len(s)
for i in range(1, n+1):
    if s[-i] == 'T':
        index = n-i
        break
print((n-index-1)*2)
# Judge status: Accepted
from bisect import bisect_right
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a=[0]*N
b=[0]*M
a[0]=A[0]
b[0]=B[0]
for i in range(N-1):
    a[i+1]=a[i]+A[i+1]
for i in range(M-1):
    b[i+1]=b[i]+B[i+1]
book=bisect_right(b,K)
for i in range(N):
    if a[i]>K:
        break
    j=bisect_right(b,K-a[i])
    book=max(book,(i+1)+j)
print(book)
# Judge status: Accepted
S = input()
T = input()
tmp = 0
for i in range(len(S)):
  if S[i] == T[i]:
    pass
  else:
    tmp += 1
    
    
print(tmp)
# Judge status: Accepted
S = input()

list_s = ["hi","hi"*2,"hi"*3,"hi"*4,"hi"*5]

if list_s.count(S) == 1:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N,D = map(int,input().split())

count = 0

for i in range(N):
    X,Y = map(int,input().split())
    n = (X**2+Y**2)**0.5
    if n <=D:
        count +=1
print(count)
# Judge status: Wrong Answer
a, b = map(int, input().split())
x = [i  *(i + 1) // 2 for i in range(1, 1000)]
for i in x:
    if a <  i < b:
        print(i - a)
        break
# Judge status: Wrong Answer
#dfs試す
#挙動追うのきつい
n,m,q=map(int, input().split( ))
qs=tuple(tuple(map(int, input().split( ))) for _ in range(q))
def dfs(ll):
    if len(ll)==n+1:
        sm=0
        for ai,bi,ci,di in qs:
            if ll[bi]-ll[ai]==ci:
                sm+=di 
        return sm
    res=[]
    for i in range(ll[-1],m+1):
        ll2=ll+[i]
        res.append(dfs(ll2))
    return(max(res))
l=[0]
print(dfs(l))
# Judge status: Accepted
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        if (i+1) % 2 == 1 and a[i] % 2 == 1:
            ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse= True)
ans = 0
for i in range(N*2):
    if i%2 == 1:
        ans += A[i]
print(ans)
# Judge status: Accepted
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

s = rs()
A, B = s.split()
A = int(A)
B = int(B.replace('.',''))

print(A*B//100)
# Judge status: Accepted
from collections import *

S = input()
T = input()

if S==T[:-1]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import bisect
n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
cnt=0
for i in range(n):
  A = bisect.bisect_left(a, b[i])
  C = n-bisect.bisect_right(c, b[i])
  cnt+=A*C
print(cnt)
# Judge status: Wrong Answer
r,g ,b=map(int,input().split())
A=100*r+10*g+b
if A%4==0 :
    print("Yes")
else :
    print("No")
# Judge status: Accepted
A,B,C = map(int,input().split())

if A+B>=C:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, k = map(int, input().split())
D = list(map(str, input().split()))
money = n
ok = True
while True:
    for d in D:
        if d in str(money):
            ok = False
            break
    if ok:
        print(money)
        break
    money += 1
    ok = True
# Judge status: Wrong Answer
import math
def main():

    X = int(input())
    v = int(pow(X, 0.25)) + 1
    for A in range(-v, v+1):
        c = pow(A, 5)
        for B in range(-v, v+1):
            if c - pow(B, 5) == X:
                return A, B
    return -1


if __name__ == '__main__':
    print(main())
# Judge status: Accepted
s = input().split()
fiveCNT = 0
sevenCNT = 0
if s[0] == '5':
    fiveCNT = fiveCNT + 1
elif s[0] == '7':
    sevenCNT = sevenCNT + 1
if s[1] == '5':
    fiveCNT = fiveCNT + 1
elif s[1] == '7':
    sevenCNT = sevenCNT + 1
if s[2] == '5':
    fiveCNT = fiveCNT + 1
elif s[2] == '7':
    sevenCNT = sevenCNT + 1
if fiveCNT == 2 and sevenCNT == 1:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
x,y=map(int,input().split())
if x%y==0:
    print(-1)
else:
    if x*(y+1)<=10**18:
        print(x*(y+1))
    else:
        print(-1)
# Judge status: Accepted
s,w= map(int,input().split())
if w>=s:
  print("unsafe")
else:
  print("safe")
# Judge status: Wrong Answer
# import math
# import statistics
#a=input()
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#    c.append(i)
e1,e2,e3 ,e4= map(int,input().split())
#K = input()
# f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

if e4%2==0:
    print(-(e1-e2))
elif e4%2==1:
    print(e1-e2)
elif abs(e1-e2)>=10**18:
    print("Unfair")
# Judge status: Wrong Answer
n,k = map(int, input().split())
X = list(map(int, input().split()))
ans = 10**8


for i in range(n-k+1):
  l = X[i]
  r = X[i+k-1]
  
  ans = min(ans, r-l+min(abs(l), abs(r)))
  
print(ans)
# Judge status: Accepted
sizePrice = list(map(int, input().split()))
N = int(input())
oneLMin = min([sizePrice[0] * 4, sizePrice[1] * 2, sizePrice[2]])
twoLMin = min([oneLMin*2, sizePrice[3]])
ans = 0
if N % 2 == 0:
    ans = twoLMin * (N//2)
else:
    ans = twoLMin * ((N - 1)//2) + oneLMin
print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
A=list(map(int,input().split()))

l=0
r=max(A)+1
while r-l>1:
  m=(l+r)//2
  cut=0
  for i in range(n):
    cut+=((A[i]+m-1)//m)-1
  if cut>k:
    l=m
  else:
    r=m
print(m)
# Judge status: Accepted
mod = 1000000007

n,m = map(int,input().split())
ab = []
for _ in range(m):
    a=int(input())
    ab.append(a)
ab = set(ab)

memo = [0]*(n+1)

memo[0] = 1

for i in range(1,n+1):
    memo[i] = (memo[i-1]+memo[i-2])%mod
    if i in ab:
        memo[i] = 0
    #print(memo)
print(memo[-1])
# Judge status: Wrong Answer
N = int(input())

ans = 0
for i in range(1,N):
    if i % 3 != 0 and i % 5 != 0:
        ans += i

print(ans)
# Judge status: Accepted
N = int(input())
abc = [list(map(int, input().split())) for _ in range(N)]
dp = [[0,0,0] for _ in range(N+1)]

for i in range(1,N+1):
  dp[i][0] = max(dp[i-1][1] + abc[i-1][0], dp[i-1][2] + abc[i-1][0])
  dp[i][1] = max(dp[i-1][0] + abc[i-1][1], dp[i-1][2] + abc[i-1][1])
  dp[i][2] = max(dp[i-1][0] + abc[i-1][2], dp[i-1][1] + abc[i-1][2])

print(max(dp[N]))
# Judge status: Wrong Answer
import sys
a = list(map(int,input().split()))
b = list(map(int,input().split()))

N = a[0]
M = a[1]

count = 0
b_sum = sum(b)

for i in range(0,N-1):
    if b[i] >= (b_sum/(4*M)):
        count+=1

if count >= M:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
import math
truelist = [0]
def getlist(x):
    list = []
    for i in range(1,x+1):
        if x%i == 0 and (not i in list):
            list.append(i)
    return len(list)
tlist = getlist(N)
for i in range(1,int(math.sqrt(N))+2):
    t = getlist(i)
    if math.sqrt(i) != int(math.sqrt(i)):
        t *= 2
    else:
        t *= 2
        t -= 1
    truelist.append(t*i)
print(sum(truelist))
# Judge status: Accepted
N = int(input())
def divisor_all(n): # 約数全列挙
    l = [1,n]
    for i in range(2,int(pow(n,1/2))+1):
        if n % i == 0:
            if i == n//i:
                l.append(i)
            else:
                l.append(i)
                l.append(n//i)
    l.sort()
    return l # list
ans = 0
for i in range(1,N+1,2):
    if len(divisor_all(i))==8:
        ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
p = []
n2 = n
for i in range(2,int(n2**0.5//1 + 1)):
  index = 0
  while n2%i == 0:
    index+=1
    n2 = n2//i
  if index != 0:
    p.append(index)
  else:
    continue
count = 0
t = 1

if n2 == 1:
  next
else:
  count+=1

if n == 1:
  print(0)
elif not p:
  print(1)
else:
  for i in range(len(p)):
    while p[i] - t >= 0:
      p[i]-=t
      count+=1
      t+=1
    t = 1
  print(count)
# Judge status: Wrong Answer
X,Y = map(int,input().split())
while X < 10**18:
  X *= 2
  if X%Y != 0:
    print(X)
    exit()
  else:
    continue
print(-1)
# Judge status: Wrong Answer
x, k, d = map(int,input().split())

# 移動制限がないときの最小値
m = x % d

# mを得るために必要な最小の移動回数
n = x // d

if k <= n:
    print(x - k * d)
    exit()

k -= n

if k % 2 == 0:
    print(m)
else:
    print(min(abs(m - d), m + d))
# Judge status: Accepted
S = list(str(input()))
i=1
count = 0

while i < len(S):
    if S[i] == S[i-1]:
        count += 1
        i += 2
    i += 1

print(len(S)-count)