peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted

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

ans = []
for i in range(1, int(M**0.5)+1, 1):
    if M%i==0:
        ans.append([i,M//i])

a = 0
for x,y in ans:
    if x>=N:
        a = max(a, y)
    if y>=N:
        a = max(a, x)

print(a)
# Judge status: Accepted
n,m=map(int,input().split())
n,m=min(n,m),max(n,m)
if n>1 and m>1:
    print((n-2)*(m-2))
else:
    if m==1:
        print(1)
    else:
        print(m-2)
# Judge status: Accepted
W,H,x,y=map(int,input().split())
S = H*W/2
res = 0
if x*2 == W and y*2 == H:
  res = 1
print(S,res)
# Judge status: Wrong Answer
s = input()

if s[-1] != 's':
	print(s)
else:
	print(s + 'es')
# Judge status: Accepted
def solve():
    N = int(input())
    A = list(map(int,input().split()))
    for i in range(N):
        if A[i] % 2 == 0:
            if A[i] % 3 != 0 and A[i] % 5 != 0:
                print('DENIED')
                exit()
    print('APPROVED')


if __name__ == '__main__':
    solve()
# Judge status: Accepted
a, b = map(int, input().split())
a_s = str(a) * b
b_s = str(b) * a

if a_s == b_s:
  print(a_s)
elif a_s < b_s:
  print(a_s)
else:
  print(b_s)
# Judge status: Accepted
print('NYoe s'[' 1 1 1'in' '.join(str(len({*t.split()}))for t in open(0))::2])
# Judge status: Accepted
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

a, b = ri_()
if a == 0 or b == 0 or (a < 0 and b > 0):
    ans = 'Zero'
elif a > 0 and b > 0:
    ans = 'Positive'
else:
    if (b - a + 1) % 2 == 0:
        ans = 'Positive'
    else:
        ans = 'Negative'
print(ans)
# Judge status: Accepted
a = int(input())
print(1000 - (a % 1000) if a % 1000 != 0 else 0)
# Judge status: Accepted
import fractions
def div_cnt(x):
    return b//x-(a-1)//x

a,b,c,d = map(int,input().split())
e = c*d//fractions.gcd(c,d)
cnt = b-a+1
c_cnt = div_cnt(c)
d_cnt = div_cnt(d)
e_cnt = div_cnt(e)
print(cnt-c_cnt-d_cnt+e_cnt)
# Judge status: Accepted
N,M = map(int,(input().split()))
K = [[] for _ in range(N)]
for i in range(N):
    K[i] = list(map(int,(input().split())))

like = [0]*M
for i in range(N):
    for j in range(1,len(K[i])):
        like[K[i][j]-1] += 1

c = 0
for i in range(M):
    like[i] -= N


for i in range(M):
    if like[i] == 0:
        c += 1

print(c)
# Judge status: Wrong Answer
import sys
#import numpy as np
import math
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
from fractions  import gcd

input=sys.stdin.readline
n=int(input())
x=[int(input()) for _ in range(5)]
t=[0]*5
t[0]=math.ceil(n/x[0])
for i in range(1,5):
    if x[i]>=x[i-1]:
        t[i]=t[i-1]+1
    else:
        t[i]=i+1+math.ceil(n/x[i])
print(t[-1])
# Judge status: Accepted

import numpy as np
n,d=map(int,input().split())
zahyo=[0]*n
count=0

# 入力受けて多次元アレイ作成
for i in range(n):
    zahyo[i]=list(map(int,input().split()))
arr=np.array(zahyo)

# 
for i in range(n):
    for j in range(i+1,n):
        dis=sum((arr[i]-arr[j])**2)
        if (dis**0.5).is_integer():
            count+=1
print(count)
# Judge status: Wrong Answer
# a,b,c,d(距離） ：標準入力
a, b, c, d = map(int, input().split())


# 直接的に会話可↓
# AさんとCさんが直接会話可→ a-c <= d
# 間接的に可↓
# AさんとBさんが直接会話可→ a-b <= d
# BさんとCさんが直接会話可→ b-c <= d
if (a - c) <= d:
    print('yes')
elif (a - b) <= d and (b - c) <= d:
    print('yes')
else:
    print('no')
# Judge status: Wrong Answer
A,B,M=[int(x) for x in input().split()]

a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

waribiki = [[0 for i in range(A)]for j in range(B)]

for i in range(M):
    x,y,c=[int(x) for x in input().split()]
    waribiki[y-1][x-1] = min(c,waribiki[y-1][x-1])

ans = 1000000007
for i in range(A):
    for j in range(B):
        p = a[i]+b[j]-waribiki[j][i]
        if p<ans:
            ans =p

print(ans)
# Judge status: Accepted
import sys
S = input()
N = len(S)
s = S[::-1]

if S != s:
    print('No')
    exit()

if (S[:(N-1)//2]) != (S[:((N-1)//2)][::-1]):
    print('No')
    exit()

if S[((N+3)//2)-1:] != S[((N+3)//2)-1:][::-1]:
    print('No')
    exit()

print('Yes')
# Judge status: Accepted
#<kaijyo-nitidou-purokonn>
#<A>
S = input()
print(S[:3])
# Judge status: Accepted
a,b,c,d = map(int, input().split())

print(max(
  a*c,
  a*d,
  b*c,
  b*d
))
# Judge status: Accepted
s = input()

if len(set(s)) == 1:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
n = int(input())
if n%2 == 0:
    #print(format(n/(2*n), '.10f'))
    print(n/(2*n))
else:
    #print(format((n+1)/2*n, '.10f'))
    print((n+1)/2*n)
# Judge status: Wrong Answer
print("O" if input()=="1" else "1")
# Judge status: Wrong Answer
s = input()
n = int(input())

one_cnt = []
ans = 0
for i in range(len(s)):
    if s[i] == "1":
        one_cnt = i
    else:
        ans = s[i]
        break

print(ans if n - 1 != one_cnt else 1)
# Judge status: Wrong Answer
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if c>=a:
  if c<=b:
    print('Yes')
  else:
    print('No')
print('No')
# Judge status: Wrong Answer
import  math

# n = 1000000000000000000
n = int(input())

# nが奇数ならば必ず0
if n % 2 or n < 10:
    print(0)
else:
    s = 0
    for p in range(0, 26):
        s += math.floor(n / (10 * (5 ** p)))

    print(s)

# 298023223876953125
# 1490116119384765625
# 1000000000000000000

# dividers = [(p, 5 ** p) for p in range(1, 26)]
# Judge status: Accepted
s = input()
cnt = 0
l = int(len(s)/2)

for i in range(l):
  if s[i] != s[-(i+1)]:
    cnt += 1
print(cnt)
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    X = int(input())

    if X < 100:
        ans = 0
    else:
        q, r, = divmod(X, 100)
        if r <= 5 * q:
            ans = 1
        else:
            ans = 0

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s = input()
t = input()

s_set = set(s)
t_set = set(t)

if len(s_set) == len(t_set):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
a, b = map(int, input().split())
s = input()
if "-" not in s[:a] and s[a] == "-" and "-" not in s[b:]:
	print ("Yes")
else:
	print ("No")
# Judge status: Wrong Answer
from collections import deque
s = input()
d = deque()
d.append(s)
n = int(input())
count = 0
for i in range(n):
    j = list(input().split())
    if j[0] == '1':
        count+=1
    else:
        if (count + int(j[1])) % 2 == 1:
            d.appendleft(j[2])
        else:
            d.append(j[2])
ans = ""
if count % 2 == 1:
    while d:
        ans += d.pop()
else:
    while d:
        ans += d.popleft()
print(ans)
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())
count = 0
if(h >= w):
    while(n > h):
        h += h
        count += 1
    print(count)
else:
    while(n > w):
        w += w
        count += 1
    print(count)
# Judge status: Wrong Answer
#149_d:greedy
n,k = [int(i) for i in input().split()]
r,s,p =[int(i) for i in input().split()]
t = input()

dic = dict()
dic["r"]=p
dic["s"]=r
dic["p"]=s

ans = []
for i in range(k):
    ans.append(dic[t[i]])
    
for i in range(n-k):
    char = t[k+i]
    ans.append(dic[char])
    if ans[-1]==ans[-1-k]:
        ans[-1]=0

print(sum(ans))
# Judge status: Accepted
def checkpalindrome(n):
  s=str(n)
  a=[]
  for i in range(len(s)):
    a.append(s[i])
  a.reverse()
  if ''.join(a)==s:
    return 1
  else:
    return 0
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  ans+=checkpalindrome(i)
print(ans)
# Judge status: Wrong Answer
u = input()
for i in range(len(u)):
  for j in range(len(u)-i):
    if u[i]==u[j]:
      print("no")
      exit()
print("yes")
# Judge status: Wrong Answer
N = int(input())

Ls = list(map(int, input().split()))
L = sorted(Ls, reverse=True)


cnt = 0
for i in range(len(L)-2):
    for j in range(i+1, len(L)-1, 1):
        for k in range(j+1, len(L), 1):
            if L[i] < L[j] + L[k] and L[j] != L[k]:
                #print(L[i], L[j], L[k], i, j, k)
                cnt += 1
print(cnt)
# Judge status: Accepted
import fractions

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

ans = a[0]

for i in range(1,n):
    ans = fractions.gcd(ans,a[i])


print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
p = list(map(int, input().split()))

ans, ai = 0, -1
sum = 0
for i in range(N-K+1):
  if i == 0:
    for k in range(K):
      sum += p[i+k]
  else:
    sum = sum - p[i-1] + p[i+k]
  ans = max(ans, sum)
  if ans == sum:
    ai = i

dp = [0]*1001
dp[0] = 0
for i in range(1000):
  dp[i+1] = i+1 + dp[i]

ans = 0.0
for i in range(ai, ai+K):
  ans += dp[p[i]]/p[i]

print(ans)
# Judge status: Wrong Answer
import collections
n, m = map(int, input().split())
a_list = sum([list(map(int, input().split()))[1:] for _ in range(n)], [])
col = collections.Counter(a_list)
print(sum([k for k, v in col.items() if v == n]))
# Judge status: Wrong Answer
N, M = map(int, input().split())
ab = [map(int, input().split()) for _ in range(N)]
a, b = zip(*ab)
cd = [map(int, input().split()) for _ in range(M)]
c, d = zip(*cd)

for i in range(N):
    tmp_dist = 10 ** 8 * 2
    tmp_point = 0
    for j in range(M):
        if tmp_dist > abs(a[i] - c[j]) + abs(b[i] - d[j]):
            tmp_point = j + 1
        tmp_dist = min(tmp_dist, abs(a[i] - c[j]) + abs(b[i] - d[j]))
    else:
        print(tmp_point)
# Judge status: Accepted
A, B = map(int,input().split())

if (A > 9) or (B > 9):
  print(-1)
else :
  print(A*B)
# Judge status: Accepted
S = input()

ans = 'x' * len(S)

print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
S= input()
S_list = list(S)
if S_list[2] == S_list[3]:
    if S_list[4] == S_list[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
# Judge status: Wrong Answer
A,B,X=map(int,input().split())
if ((A<X)and(A+B>X)):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b=input().split()
print("Yes" if (int(a+b)**.5).is_integer() else "No")
# Judge status: Accepted
N,M = map(int,input().split()) #n:頂点数　w:辺の数


way = [[] for i in range(N)]
depth = [float("inf") for i in range(N)]
visited = [False for i in range(N)]
que=[0]

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

for i in que:
  for j in way[i]:
    if visited[j]:
      continue
    que.append(j)
    visited[j]=True
    depth[j] = min(i+1,depth[j])
print("Yes")
for i in range(1,N):
  print(depth[i])
# Judge status: Wrong Answer
import math
N = int(input())
if N == 0:
  print('No')
else:
  log10_N = int(math.log10(N)) + 1
  sum_keta = 0

  for i in range(log10_N):
    sum_keta += N % 10
    N = N // 10

  if sum_keta % 9 == 0:
    print('Yes')
  else:
    print('No')
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
imos = [0 for _ in range(n+1)]
"""
座標xに光の強さdの電球→[x-d, x+d] てらす
強さ0でもそれには適用.
"""
for _ in range(k):
	imos = [0 for _ in range(n+1)]
	for i in range(n):
		imos[max(i-a[i], 0)] += 1
		imos[min(i+a[i]+1, n)] -= 1
	cnt = 0
	alln = 0
	for i in range(n):
		cnt += imos[i]
		a[i] = cnt
		if a[i] == n:
			alln += 1
	if alln == n:
		break
print(*a)
# Judge status: Accepted
A, B, N = map(int, input().split())
ans = int(A*(min(N, B-1)/B))-A*int(min(N, B-1)/B)
print(ans)
# Judge status: Accepted
N,K = map(int, input().split())
*X, = map(int, input().split())

min = float('inf')
for i in range(N-K+1):
    left_cost = X[i]
    right_cost  = X[i+K-1]
    right_course = abs(right_cost)+abs(right_cost-left_cost)
    if min > right_course:
        min = right_course
    left_course = abs(left_cost)+abs(right_cost-left_cost)
    if min > left_course:
        min = left_course
        
print(min)
# Judge status: Accepted
# import sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))


a = int(input())
print(a+a*a+a*a*a)
# Judge status: Accepted
N,Q = map(int,input().split())

S = input()

T = S.replace("AC","!?")

csum = [0]*N

s = 0

for i in range(N):
    if T[i] == "?":
        s += 1
    csum[i] = s

for i in range(Q):
    l,r = map(int,input().split())
    print(csum[r-1]-csum[l-1])
# Judge status: Accepted
a,b = map(int,input().split())
if a < 10 and b < 10:
  print(a*b)
else:
  print(-1)
# Judge status: Wrong Answer
NM=input("N M")
N,M=NM.split()
N=int(N)
M=int(M)
if(N==M):
  print("Yes")
else:
  print("NO")
# Judge status: Accepted
from math import *
l=int(input())
k=3*(log10(l)-log10(3))
print(pow(10,k))
# Judge status: Wrong Answer
a=input()
b=int(len(a))
c=0
d=0
for i in range(b//2):
  if a[2*i]=="1":
    c=c+1
  if a[2*i+1]=="0":
    c=c+1
for i in range(b//2):
  if a[2*i]=="0":
    d=d+1
  if a[2*i+1]=="1":
    d=d+1
if c>d:
  print(d)
else:
  print(c)
# Judge status: Accepted
# https://atcoder.jp/contests/abc083/tasks/arc088_a

X, Y = map(int, input().split())

res = 1
while X*2 <= Y:
    X *= 2
    res += 1

print(res)
# Judge status: Wrong Answer
N=int(input())
S=list(input())
cha = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'*2)
for i in range(len(S)):
    S[i]=cha[cha.index(S[i])+2]
print("".join(S))
# Judge status: Accepted
S = [int(x) for x in input().split()]
for i in range(5):
	if S[i]==0:
		print(i+1)
		exit()
# Judge status: Accepted
n, m = map(int, input().split())
p = [0] * m
s = [0] * m
for i in range(m):
  p[i], s[i] = input().split()
  p[i] = int(p[i])
c = [0] * (n + 1)
w = [0] * (n + 1)
for i in range(m):
  if c[p[i]] == 0 and s[i] == 'AC':
    c[p[i]] = 1
  elif c[p[i]] == 0 and s[i] == 'WA':
    w[p[i]] = w[p[i]] + 1
    
for i in range(1, n+1):
  if c[i] == 0:
    w[i] = 0
print(sum(c), sum(w))
# Judge status: Accepted
n=list(map(int,input()))
if 7 in n:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a,b = map(int,input().split())
if a == b :
  print("Draw")
elif a == 1 :
  print("Alice") 
elif b == 1 :
  print("Bob")
elif a > b :
  print("Alice") 
elif a < b : 
  print("Bob")
# Judge status: Accepted
a, b, c, k = map(int, input().split())

if k < a:
  print(k)
elif k <= a + b:
  print(a)
else:
  print(a - (k - a - b))
# Judge status: Wrong Answer
a = int(input())

print(len(str(bin(int(a))))-3)
# Judge status: Wrong Answer
abc = list(map(int, input().split()))
if abc[0]+abc[1] == abc[2]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n=int(input())
dp=[0]*100010

for i in range(1,100010):
  dp[i]=float('inf')
  
for i in range(1,100010):
  power6=1
  while power6<=i:
    dp[i]=min(dp[i-power6]+1,dp[i])
    power6*=6
  power9=1
  while power9<=i:
    dp[i]=min(dp[i-power9]+1,dp[i])
    power9*=9

print(dp[n])
# Judge status: Accepted
import math

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

arr=[list(map(int,input().split())) for i in range(N)]
count=0

def dis(x,y):
    a=0
    for i in range(len(x)):
        a+=(x[i]-y[i])*(x[i]-y[i])
    return math.sqrt(a)
    
for i in range(N-1):
    for j in range(i+1,N):
        if dis(arr[i],arr[j])%1==0:
            count+=1

print(count)
# Judge status: Wrong Answer
a=int(input())
print("Christmas","Eve"*3)
# Judge status: Accepted
from collections import Counter, defaultdict
# for use in beginner level contests where speed is key

_,k = list(map(int,input().split()))
lst = list(map(int,input().split()))

print(sum(sorted(lst)[:k]))
# Judge status: Wrong Answer
lst = input().split()
a = int(lst[0])
b = float(lst[1])
if a == 0 or b == 0:
  print(0)
else:
  print(int(a*b))
# Judge status: Accepted
a,b,m=map(int, input().split())  
ai=list(map(int, input().split()))
bi=list(map(int, input().split()))

#xyc=[]
xymin=min(ai)+min(bi)

for i in range(m):
#    xyc.append(list(map(int, input().split()))
    x,y,c=map(int, input().split())
    xy=ai[x-1]+bi[y-1]-c
    if xymin>xy:
        xymin=xy

print(xymin)
# Judge status: Wrong Answer
n,m = map(int,input().split())
a,b = [0 for _ in range(n)],[0 for _ in range(n)]

for i in range(n):
    a[i] = list(map(int,input().split()))

bought = 0
ans = 0

if len(a) == 1:
    print(a[0][0]*m)
    exit()

a.sort(key = lambda a:a[0])

for i in range(n):
    remain = m - bought
    if a[i][0] < remain:
        ans += a[i][0] * a[i][1]
        bought += a[i][1]
    else:
        ans += a[i][0]*remain
        break

print(ans)
# Judge status: Accepted
import numpy as np
from fractions import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N,M=map(int,input().split())
a=[i//2 for i in map(int,input().split())]
b=np.array(a)
cnt=0
while all(b%2==0):
  b//=2
if any(b%2==0):
  print(0)
  exit()
ans=1
for i in a:
  ans=lcm(ans,i)
print((M//ans-1)//2+1)
# Judge status: Accepted
A,B,N=map(int, input().split())
def f(n):
    return A*n//B-A*(n//B)
ans=f(N)
ans=max(ans,f(N//B*B))
x=N//B*B-1
if x>0:
    ans=max(ans,f(x))
print(ans)
# Judge status: Accepted
int_n = int(input())

ans = 10**int_n -2*(9**int_n) +8**int_n

ans_divide = ans % (10**9 + 7)

print(ans_divide)
# Judge status: Accepted
# coding:utf-8
a, b, c, k = map(int, input().split())
point = 0

if k <= a:
    point += k
elif k > a and (k - a) <= b:
    point += a
elif k > a and (k - a) > b:
    point = a + (-1) * (k - a - b)

print(point)
# Judge status: Wrong Answer
X = int(input())
Max = 0
for i in range(2,10):
    b = int(X**(1/i))
    B = b**i
    if Max < B:
        Max = B
print(Max)
# Judge status: Accepted
a,b = map(int,input().split())
print("Even" if a * b % 2 == 0 else "Odd")
# Judge status: Wrong Answer
# int
# A = list(map(int, input().split()))
# string
# S = input().split()

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

if N >= 10:
    print(R)
else:
    print(R - 100 * (10-N))
# Judge status: Wrong Answer
N = int(input())
str_num = input().split()

num_list = []
for i in str_num:
  num_list.append(int(i))

num_list.sort(reverse=True)

ans = num_list[0]

LIMIT_NUM = 10**18

for i in range(1,N):
  ans *= num_list[i]
  if ans > LIMIT_NUM:
    break

if ans > LIMIT_NUM:
  print(-1)
else:
  print(ans)
# Judge status: Accepted
if __name__ == "__main__":
    S, W = map(int, input().split())
    print("unsafe" if S <= W else "safe")
# Judge status: Accepted
x, n = map(int, input().split())


p = list(map(int, input().split()))

a = 0


while True:
    if x - a not in p:
        print(x - a)
        break
    elif x + a not in p:
        print(x + a)
        break
    a += 1
# Judge status: Wrong Answer
from collections import deque

X = int(input())
N = 10**5+4
N_sq=N**(1/2)

check = deque(range(2,N+1))
search = deque([])

for n in range(N):
    if len(check)<=0:
        break
        
    c = check.popleft()
    search.append(c)

    check = deque([ _ for _ in check if _%c != 0])
    
    if c > N_sq:
        search.extend(check)
        break
        
for s in search:
    if X < s:
        print(s)
# Judge status: Accepted
from sys import stdin

s = [x for x in stdin.readline().rstrip()]

ans = "Yes"

for i in range(len(s)):
    if ((i + 1) % 2 == 0) and (s[i] == "R"):
        ans = "No"
        break
    elif ((i + 1) % 2 != 0) and (s[i] == "L"):
        ans = "No"
        break
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int, input().split()))
cnt_2=0
cnt_1=0
cnt_0=0

for num in a:
    if num%4==0:
        cnt_2+=1
    elif num%2==0:
        cnt_1+=1
    else:
        cnt_0+=1

if cnt_2>=cnt_0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
def calc():
    rem = (a + b)%2
    ans = 0

    if rem == 0:
        ans = (a+b)/2
        return ans
    else:
        ans = ((a+b)//2) + 1
        return ans

a, b = map(int,input().split())
print(calc())
# Judge status: Accepted
x=int(input())
ans=8
x-=400
ans-=x//200
print(ans)
# Judge status: Accepted
import bisect

ans = 0
N = int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort()
B.sort()
C.sort()


#A<B<Cの組み合わせの数が答え
for i in range(N):
    #Bを1つ決めた時、AがB未満の場合の総数
    B_miman = bisect.bisect_left(A,B[i])
    #Bを1つ決めた時、CがB以上の場合の総数
    B_ijou = N - bisect.bisect_right(C, B[i])

    ans+= B_miman*B_ijou

print(ans)
# Judge status: Wrong Answer
s = input()
print('×' * len(s), end='')
# Judge status: Accepted
import math
A, B, C, D, E = map(int, input().split())

hour = (C - A) * 60
min = D - B
cnt = hour + min - E

print(cnt)
# Judge status: Wrong Answer
x,k,d = map(int,input().split())
a = x

if x >= k*d or x <= -k*d:
    print(str(abs(x - k * d )))
else:
    for i in range(k):
        if abs(a + d) > abs(a - d):
            a = a-d
        else:
            a = a+d
    print(str(abs(a)))
# Judge status: Accepted
print((pow(10,n:=int(input()),M:=10**9+7)-pow(9,n,M)*2+pow(8,n,M))%M)
# Judge status: Accepted
n = int(input())
for i in range(7):
    if 2**i<=n<2**(i+1):
        print(2**i)
        break
    elif n==1:
        print(n)
        break
# Judge status: Accepted
n,m = map(int, input().split())
T = list(map(int, input().split()))

if n >= m:
    print(0)
    exit()

T.sort()
diff = []
for i in range(1,m):
    diff.append(T[i]-T[i-1])
diff.sort(reverse=True)
print(sum(diff[n-1:]))
# Judge status: Accepted
A, B, C, K = map(int, input().split())

if K <= A:
    print(K)
else:
    ans = A
    if K <= A + B:
        print(ans)
    else:
        ans = ans - (K - A - B)
        print(ans)
# Judge status: Accepted
n = int(input())
List = list(map(int, input().split()))

def euclid(a, b):
  while True:
    r = a % b
    a, b = b, r
    if r == 0:
  	  return(a)
    
List.sort(reverse = True)
res = euclid(List[0], List[1])
for i in range(1, n):
  res = euclid(res, List[i])
  if res == 1:
    break
    
print(res)
# Judge status: Accepted
s = input()
k = int(input())
slen = len(s)
new_s = ""

for i in range(slen):
  val = (ord("z") + 1 - ord(s[i])) % 26
  if k >= val:
    k -= val
    new_s += "a"
  else:
    new_s += s[i]
    
if k > 0:
  tmp_val = ord(new_s[slen-1]) + k % 26
  if tmp_val > ord("z"):
    tmp_val -= 26
  new_s = new_s[:-1] + chr(tmp_val)

print(new_s)
# Judge status: Accepted
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
x_sa = []
for i in range(len(x)-1):
    x_sa.append(abs(x[i]-x[i+1]))
x_sa.sort()
ans = 0
if n >= m:
    print(0)
else:
    for i in range(m-n):
        ans += x_sa[i]
    print(ans)
# Judge status: Accepted
def solve(string):
    n = int(string)
    return str(sum(i * (n // i) * (n // i + 1) // 2 for i in range(1, n + 1)))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
# Judge status: Accepted
x,y,z=map(int,(input().split()))
ans=1
x-=(y+2*z)
print(ans+x//(y+z))
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
for _ in range(m):
  p = a.pop()//2
  up=n-1
  low=0
  while up-low > 1:
    nb = low+(up-low)//2
    if p >= a[nb]:
      low = nb
    else:
      up = nb
  a.insert(up, p)
print(sum(a))
# Judge status: Accepted
X, Y = [int(item) for item in input().split()]
cnt = 0

while X <= Y:
    X *= 2
    cnt +=1

print(cnt)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(0, 3):
    for j in range(1*(100**i), 10*(100**i)):
        if j<=n:
            ans += 1
        else:
            print(ans)
            exit()
print(ans)
# Judge status: Accepted
N = int(input())

print((10**N-2*9**N+8**N)%1000000007)
# Judge status: Accepted
Q, H, S, D = map(int, input().split())
N = int(input())

if H > Q*2:
  H = Q*2
if S > H*2:
  S = H*2
if D > S*2:
  D = S*2

if N % 2 == 0:
  print((N//2)*D)
else:
  print((N//2)*D+S)
# Judge status: Accepted
import sys
input = sys.stdin.readline
from collections import *
from heapq import *

N, M = map(int, input().split())
d = defaultdict(list)

for _ in range(N):
    A, B = map(int, input().split())
    d[M-A].append(B)

pq = []
ans = 0

for i in range(M-1, -1, -1):
    for v in d[i]:
        heappush(pq, -v)
    
    if len(pq)>0:
        ans += -heappop(pq)

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

if a == 1:
  a += 13
if b == 1:
  b += 13

if a < b:
  ans = 'Bob'
elif a == b:
  ans = 'Draw'
else:
  ans = 'Alice'
print(ans)
# Judge status: Accepted
n = int(input())
for a in list(map(int, input().split())):
    if not a % 2 and a % 3 and a % 5:
        print("DENIED")
        break
else: print("APPROVED")