peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math


def main():
    # n = int(input())
    # n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    s = input()
    # h = [int(input()) for _ in rane(n)]
    f = int(s[:2])
    b = int(s[2:])
    if 1 <= f and f <= 12 and 1 <= b and b <= 12:
        print("AMBIGUOUS")
    elif 0 <= f and f <= 99 and 1 <= b and b <= 12:
        print("YYMM")
    elif 0 <= b and b <= 99 and 1 <= f and f <= 12:
        print("MMYY")
    else:
        print("NA")


if __name__ == '__main__':
    main()
# Judge status: Accepted
n, k = map(int, input().split())
d = sorted(list(map(int, input().split())))

for i in range(n, 100000):
    for j in d:
        if str(i).count(str(j)) != 0:
            break
    else:
        print(i)
        exit()
# Judge status: Accepted
def fib(n):
  memo = [0]*(n+1)
  def _fib(n):
    if n == 0:
      return 2
    elif n == 1:
      return 1
    if memo[n] != 0:
      return memo[n]
    memo[n] = _fib(n-1) + _fib(n-2)
    return memo[n]
  return _fib(n)
n = int(input())
print(fib(n))
# Judge status: Accepted
a = a, b, c, = map(int, input().split())
bc = int(b/c)
ac = int((a-1)/c)
ans = bc-ac
print(ans)
# Judge status: Accepted
A,B,K=map(int,input().split())

if B-A+1>2*K:
    for i in range(K):
        print(A+i)
    for j in range(K):
        print(B-K+j+1)
else:
    for k in range(B-A+1):
        print(A+k)
# Judge status: Accepted
H,W=[int(i) for i in input().split()]
if H==1 or W==1:
    print(1)
else:
    print(int(H*W/2)+(H*W)%2)
# Judge status: Accepted
import itertools as it
n=[x for x in input()]
In=list(it.product(['+','-'],repeat=3))
for k in range(8):
   ans = eval(n[0]+In[k][0]+n[1]+In[k][1]+n[2]+In[k][2]+n[3])
   if ans==7:
    print(n[0]+In[k][0]+n[1]+In[k][1]+n[2]+In[k][2]+n[3]+"=7")
    exit()
# Judge status: Accepted
if input()[1]=="B":
    print("ARC")
else:
    print("ABC")
# Judge status: Wrong Answer
N = int(input())
lists = []
for n in range(N):
    s = input()
    lists.append(s)
from collections import Counter
counter = Counter(lists)
#print(counter)
anslist = sorted(counter.items(), key = lambda x:x[1])
anslist.reverse()
#print(anslist)
num = anslist[0][1]
len = len(anslist)
#print(num)
for n in range(len):
    if anslist[n][1] == num:
        print(anslist[n][0])
    else:
        pass
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))


a_sort = sorted(a, reverse=True)

a_sum = a_sort[0]

if (N-2) % 2 == 0:
    for i in range(int((N-2)/2)):
        a_sum += 2*a_sort[i+1]
    print(a_sum)
else:
    for i in range((N-2)//2):
        a_sum += 2*a_sort[i+1]
    print(a_sum+a_sort[(N-2)//2 + 1])
# Judge status: Accepted
def b_collatz_problem():
    def collatz(n):
        return n // 2 if n % 2 == 0 else 3 * n + 1

    S = int(input())
    collatz_set = {S}
    num = S
    ans = 1
    while True:
        num = collatz(num)
        ans += 1
        if num in collatz_set:
            return ans
        collatz_set.add(num)

print(b_collatz_problem())
# Judge status: Accepted
k, x = list(map(int, input().split()))
print(*[i for i in range(x - k + 1, x + k)])
# Judge status: Accepted
s = list(input())
k = len(s)
for i in range(k):
  if s[i] == '?':
    s[i] = 'D'
A = "".join(s)
print(A)
# Judge status: Wrong Answer
n, m = map(int, input().split())
correct = 0
penal = 0
d = {i: set() for i in range(1,n+1)}
for _ in range(m):
    p, s = input().split()
    if s == 'AC':
        if not s in d[int(p)]:
            correct += 1
    else:
        if not 'AC' in d[int(p)]:
            penal += 1
    d[int(p)].add(s)
print(correct, penal)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n,m = map(int,input().split())
oks = [True]*(n+1)
for i in range(m):
    a = int(input())
    oks[a] = False

dp = [0]*(n+1)
dp[0] = 1
for i in range(n):
    for j in range(i+1,min(n,i+2)+1):
        if oks[j]:
            dp[j] += dp[i]
            dp[j] %= (10**9+7)
print(dp[n])
# Judge status: Accepted
N, K, S = map(int, input().split())

ans = []

for i in range(N):
    if i < K:
        ans.append(str(S))
    else:
        if S == 10 ** 9:
            ans.append(str(1))
        else:
            ans.append(str(S+1))

print(" ".join(ans))
# Judge status: Wrong Answer
D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]
ans = [i%26 for i in range(1,D+1)]
for i in ans:
    print(i)
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

s = p[:x] + q[:y]
s.sort()
ans = sum(s)
for si, ri in zip(s, r):
    if si < ri:
        ans += ri - si

print(ans)
# Judge status: Wrong Answer
H,A = map(int, input().split())
print(H//A+1)
# Judge status: Accepted
from collections import Counter
n = int(input())
s = [[0]*10 for _ in range(n)]
ans = 0
for i in range(n):
    str_s = input()
    for j in range(10):
        s[i][j] = str_s[j]

dict_s = {}
for i in range(n):
    s[i].sort()
    si = "".join(s[i])
    dict_s.setdefault(si, 0)
    dict_s[si] += 1

for x in dict_s.values():
    ans += x*(x-1)//2
print(ans)
# Judge status: Accepted
N = int(input())
alpha=list('abcdefghijklmnopqrstuvwxyz')
res=['']
for i in range(N):
    tmp = []
    for j in res:
        for k in alpha[:len(set(list(j))) +1]:
            tmp.append(j+k)
    res = tmp

for i in res:
    print(i)
# Judge status: Accepted
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
r = min(a) + min(b)
for S in range(M):
    x, y, c = map(int, input().split())
    r = min(r, a[x-1] + b[y-1] - c)
print(r)
# Judge status: Wrong Answer
from math import radians, cos

A, B, H, M = map(int, input().split())

angle_h = (H + M/60) * 30
angle_m = M * 60
theta = min(abs(angle_h-angle_m), 360 - abs(angle_h-angle_m))
r2 = A**2 + B**2 - 2*A*B*cos(radians(theta))
print(r2**(1/2))
# Judge status: Accepted
s = list(input())
K = int(input())
a = ord('z') + 1
for i in range(len(s)-1):
    if s[i] == 'a':
        continue
    #print(K,a - ord(s[i]))
    if K >= (a - ord(s[i])):
        K -= a - ord(s[i])
        s[i] = 'a'
    #print(K,a - ord(s[i]))
i = len(s)-1
s[len(s)-1] = chr((ord(s[i])-ord('a') + K) % 26 + ord('a'))
print(''.join(s))
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n+1):
    m = n//i
    ans += i * m * (m+1) // 2
print(ans)
# Judge status: Accepted
x, a, b = map(int, input().split())
print("A" if max(x, a) - min(x, a) < max(x, b) - min(x, b) else "B")
# Judge status: Accepted
K, N = map(int, input().split())
A = list(map(int, input().split()))

dmax = K - A[N-1] + A[0]
apre = -(K - A[N-1])
for a in A:
  d = a - apre
  if d > dmax:
    dmax = d
  apre = a

print(K - dmax)
# Judge status: Accepted
N = int(input())
dn = {}
dm = {}

for _ in range(N):
    s = input()
    if s in dn:
        dn[s] += 1
    else:
        dn[s] = 1
        
M = int(input())
for _ in range(M):
    t = input()
    if t in dm:
        dm[t] += 1
    else:
        dm[t] = 1

ans = 0
for k, v in dn.items():
    res = v
    if k in dm:
        res -= dm[k]
    ans = max(ans, res)

print(ans)
# Judge status: Accepted
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for _ in range(N)]

field = 0
for v in b:
	for i in range(9):
		if A[i // 3][i % 3] == v:
			field = field | (1 << i)
ans = False
for v in sum([[273,84],sum([[73<<i,7<<i*3]for i in range(3)],[])],[]):
  ans = ans or field&v==v;
print('Yes' if ans else 'No')
# Judge status: Accepted
import sys
S = int(input())
xy = [map(int, input().split()) for _ in range(S)]
x, y = [list(i) for i in zip(*xy)]
count = 0

for i in range(S):
  if x[i] == y[i]:
    count += 1
    if count == 3:
      print("Yes")
      sys.exit()
    else:
      pass
  else:
    count = 0
print("No")
# Judge status: Accepted
N, M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]

lList = [arr[0] for arr in LR]
rList = [arr[1] for arr in LR]

l = max(lList)
r = min(rList)

print(max(r-l+1, 0))
# Judge status: Accepted
if input() in ['a','i','o','u','e']:
  print('vowel')
else:
  print('consonant')
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if d>=abs(c-a) or (d>=abs(c-b) and d>=abs(b-a)):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
S="012 345 678 036 147 258 048 246 "
A=[]
A.extend(list(map(int,input().split())) for i in range(3))
N=int(input())
for i in range(N):
  j=input()
  for l in range(3):
    for m in range(3):
      S=S.replace(str([9,l*3+m][A[l][m]==int(j)]),"")
print(["No","Yes"][S.find("  ")>-1])
# Judge status: Wrong Answer
n = int(input())
res = [0] * n
for i in range(1, n):
  c, s, f = map(int, input().split())
  res[i-1] += s + c
  for j in range(i-1):
    if res[j] < s:
      res[j] = s + c
    elif res[j] == s:
      res[j] += c
    else:
      if (res[j] - s) % f == 0:
        res[j] += c
      else:
        res[j] += f + c
for elem in res:
  print(elem)
# Judge status: Accepted
a, b = map(int, input().split())
if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Wrong Answer
N, T = map(int, input().split())
CT = [tuple(map(int, input().split())) for _ in range(N)]

ans = 1010
for c, t in CT:
    if t > T:
        continue
    ans = min(ans, c)
print(ans if ans <= T else 'TLE')
# Judge status: Accepted
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    for j in range(len(str(i))//2+1):
        #print(str(i), str(i)[j],str(i)[-j-1],j , len(str(i))//2)
        if str(i)[j] != str(i)[-j-1]:
            break
        if j == len(str(i))//2:
            ans += 1


print(ans)
# Judge status: Accepted
N = int(input())
n = N // 7
flag = 0
for i in range(n + 1):
  if (N - i*7) % 4 == 0:
    print("Yes")
    flag = 1
    break
if flag == 0:
  print("No")
# Judge status: Accepted
x = int(input())


k = x // 11

ans = k * 2
if x - k * 11 == 0:
    ans += 0
elif x - k * 11 <= 6:
    ans += 1
else:
    ans += 2
print(ans)
# Judge status: Accepted
x,y=map(int,input().split())
if x%3==0 or y%3==0 or (x+y)%3==0:
    print('Possible')
else:
    print('Impossible')
# Judge status: Wrong Answer
num = int(input("半径を入力してください"))

num = num * 2 * 3.14

print(num)
# Judge status: Accepted
N=int(input())
a=1
for i in range(1,int(N**(1/2))+2):
    if N%i==0:
        a=max(a,i)
print(a+N//a-2)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

SUM = 0
for i in range(N):
  SUM += B[A[i]-1]
  
for i in range(1,N):
  if A[i]-A[i-1]==1:
    SUM += C[A[i-1]-1]

print(SUM)
# Judge status: Accepted
s = input()
print('Yes' if s.count('a') == s.count('b') == s.count('c') == 1 else 'No')
# Judge status: Accepted
r  = int(input())
print(r*r)
# Judge status: Accepted
d,n=map(int,input().split())
k=100**d
if n%100==0:
  n+=n//100
ans=n*k

print(ans)
# Judge status: Accepted
import sys

sys.setrecursionlimit(1000000)

import bisect
import math
import collections
import heapq


def solve(N):
    i = 8
    n = 400
    while i > 0:
        if N < 200 + n + (200 * (8 - i)):
            return str(i)
        i -= 1


if __name__ == "__main__":

    N = int(input())
    print(solve(N))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
total = sum(A)
i = 0
tmp=A[i]
while total/2 > tmp:
  i += 1
  tmp += A[i]
ans = min(2*tmp-total, total-2*(tmp-A[i]))
print(ans)
# Judge status: Accepted
def check(s):
  if s % 2 == 0:
    return s//2
  else:
    return 3*s+1

s = int(input())
count = 0
a = [s]
n = s
while count < 1:
  n = check(n)
  length = len(a)
  a.append(n)
  if length+1 != len(set(a)):
    print(len(a))
    break
# Judge status: Wrong Answer
N = int(input())
List = [input() for i in range(N)]
count_str = N
for i in range(N-1):
    j = i+1
    if List[i] == List[j]:
        count_str = count_str - 1
    else:
        pass
print(count_str)
# Judge status: Wrong Answer
W, H ,x, y = map(int, input().split())
if H > W:
  if x == W/2:
    can = 0
  else:
    can = 1
elif H == W:
  can = 1
else:
  if y == H/2:
    can = 0
  else:
    can = 1

print('{:.9f}'.format(W*H/2), can)
# Judge status: Wrong Answer
S = list(map(int,input().split()))
if S[0] == S[1]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N,K=map(int,raw_input().split())
if N/K%2==1:
    print "1"
elif N/K%2==0:
    print "0"
# Judge status: Accepted
from collections import deque

N = int(input())

q = deque()
for i in range(1, 10):
    q.append(i)

for i in range(N):
    a = q.popleft()
    d = a % 10
    if d > 0:
        q.append(10*a + d - 1)
    q.append(10*a + d)
    if d < 9:
        q.append(10*a + d + 1)

print(a)
# Judge status: Accepted
n = int(input())
d = {}
for i in range(n):
    s = input()
    try:
        d[s] += 1
    except:
        d[s] = 1

m = int(input())
for i in range(m):
    t = input()
    try:
        d[t] -= 1
    except:
        d[t] = -1

max_num = 0
for item in d.items():
    if item[1] > max_num:
        max_num = item[1]

print(max_num)
# Judge status: Accepted
K = int(input())

if K%2 == 0:
  print( (K//2) ** 2 )
else:
  print( ( (K+1) // 2) * (K//2) )
# Judge status: Accepted
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b = i2()
cnt = 0
for i in range(a,b+1):
	memo = str(i)
	if memo[0] == memo[4] and memo[1] == memo[3]:
		cnt += 1
print(cnt)
# Judge status: Accepted
S = input()
T = input()
ans = 0

for i in range(len(S)):
    if S[i] != T[i]:
        ans +=1

print(ans)
# Judge status: Wrong Answer
N = int(input())
hs = list(map(int, input().split()))

Cost = [1e7 for _ in range(N)]
Cost[0] = 0

for i in range(N-2):
  if (i+1 > N-1):
    continue
  Cost[i+1] = min(Cost[i+1], Cost[i] + abs(hs[i]-hs[i+1]))
  if (i+2 > N-1):
    continue
  Cost[i+2] = min(Cost[i+2], Cost[i] + abs(hs[i]-hs[i+2]))

print(Cost[N-1])
# Judge status: Accepted
import math
M = 360
X = list(map(int, input().split()))[0]
Y = math.gcd(M, X)

result = M // Y
print(result)
# Judge status: Wrong Answer
"""
author : halo2halo
date : 31, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
S = readline().decode('utf8')

print(max(0, S.count('I') - S.count('D')))
# Judge status: Wrong Answer
n = int(input())
s = input()
ans = 1
for x in set(s):
    ans *= s.count(x)+1
    print(ans)
print((ans-1)%(10**9+7))
# Judge status: Accepted
s=input()
t=input()
m=len(s)
for i in range (len(s)-len(t)+1):
    c=0
    for j in range (len(t)):
        if t[j]!=s[i+j]:
            c+=1
    m=min(m,c)
print(m)
# Judge status: Accepted
import math
a,b,x = [ int(r) for r in input().split(' ') if len(r) > 0]

if 2*x >= a*a*b:
    # 半分より多い
    print(90-math.degrees((math.atan2(a,2*(b-x/a**2)))))
else:
    # 半分より少ない
    print(90-math.degrees(math.atan2((2*x)/(a*b),b)))
# Judge status: Accepted
import collections

n = int(input())
a = [int(input()) for i in range(n)]
x = collections.Counter(a)
y = x.most_common()
ans = 0
for i in range(len(y)):
    if y[i][1]%2==1:
        ans+=1
print(ans)
# Judge status: Accepted
a,b=(int(x) for x in input().split())

#print((a * b) % 2)

if (a * b) % 2 == 1:
    print('Odd')
else:
    print('Even')
# Judge status: Accepted
S = input()
A = [0 for i in range(2019)]
x = 0
q = 1
for i in range(len(S)):
    p = i + 1
    a = (int(S[-p]))
    b = a*q%2019
    x = (x+b) % 2019
    A[x] += 1
    q = q*10%2019
ans = A[0]
for i in range(2019):
    ans += A[i]*(A[i]-1)//2
print(ans)
# Judge status: Accepted
def main():
    k = int(input().strip())
    if k % 2 == 0 or k % 5 == 0:
        print(-1)
        return
    x = 7 % k
    for n in range(1, k + 1):
        if x == 0:
            print(n)
            return
        x = (10 * x + 7) % k

    print(-1)
    return


if __name__ == "__main__":
    main()
# Judge status: Accepted
# coding: utf-8
# Your code here!
a,b=(map(int,input().split()))

if a*b%2==0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
r=0
for i in range(n-1):
    if a[i+1]==a[i]+1:
        r+=c[a[i]-1]
print(sum(b)+r)
# Judge status: Accepted
# -*- coding: utf-8 -*-
A, B = map(int, input().split())

print(['Impossible', 'Possible'][A%3 == 0 or B%3 == 0 or (A+B) %3 == 0])
# Judge status: Wrong Answer
a, b = map(int, input().split())
num = a
for i in range(50):
    if num > b:
        break
    else:
        num -= 1
        num += a
print(i+1)
# Judge status: Accepted
a=input()

a1=int(a)

b=a1+(a1*a1)+(a1*a1*a1)

print(b)
# Judge status: Wrong Answer
n = int(input())

ans = 0
if n % 2 == 0:
    for i in range(1, 18):
        k = 10**i
        ans += n//k
    print(ans)
else:
    print(ans)
# Judge status: Accepted
n = int(input())
s = input()
m = 0
c = 0
for i in range(min([n,len(s)])):
    if s[i] == 'I':
        c += 1
    else:
        c -= 1
    if c > m:
        m = c
print(m)
# Judge status: Accepted
n,m = map(int,input().split())
H = [int(i) for i in input().split()]
H_max = [True for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    if H[a-1]>H[b-1]:
        H_max[b-1] = False
    elif H[a-1]<H[b-1]:
        H_max[a-1] = False
    else:
        H_max[a-1] = False
        H_max[b-1] = False
ans = 0
for i in range(n):
    if H_max[i] == True:
        ans += 1
print(ans)
# Judge status: Accepted
a = input()
if a.upper() == a:
    print('A')
else:
    print('a')
# Judge status: Accepted
N = int(input())
a = 0
nums = [int(i) for i in input().split()]
while True:
    if [i for i in nums if i %2==1]:
        break
    else:
        nums = [i//2 for i in nums]
        a+=1
        
print(a)
# Judge status: Accepted
n = int(input())
ais = list(map(int, input().split()))
bis = list(map(int, input().split()))
cis = list(map(int, input().split()))
sat = bis[ais[0]-1]
for i in range(1, n):
  sat += bis[ais[i]-1]
  if ais[i] == ais[i-1] + 1:
    sat += cis[ais[i]-2]
print(sat)
# Judge status: Accepted
s,t=open(0)
m=len(t:=t[:-1])
for i in range(51):
 if all(c in'?'+d for c,d in zip(s[-i-m:],t)):s=s.replace(*'?a');exit(print(s[:-i-m]+t+s[-i:]))
print('UNRESTORABLE')
# Judge status: Accepted
# B

S=input()
T=input()

def check(i,T):
    ns=S[i:i+len(T)]
    res=0
    for i in range(len(T)):
        if ns[i]!=T[i]:
            res+=1
    return res

print(min([check(i,T) for i in range(len(S)-len(T)+1)]))
# Judge status: Accepted
x,y=map(int,input().split())
counter=1
while x<=y:
  counter+=1
  x=x*2
print(counter-1)
# Judge status: Wrong Answer
n, m, k = map(int, input().split())

for i in range(n):
    for j in range(m):
        if k == i*(m-j) + j*(n-i):
            print("Yes")
            exit()

print("No")
# Judge status: Accepted
a,b=map(int,input().split())
if a<=b:
  print(a)
else:
  print(a-1)
# Judge status: Accepted
R=int(input())
print(R*2*3.141592)
# Judge status: Accepted
n = int(input())
P = list(map(int, input().split()))

check = 0
ans = 0
for i in range(n):
    if P[i] == i+1:
        ans += 1
        if check == 1:
            ans -= 1
            check = 0
        else:
            check += 1
    else:
        check = 0
print(ans)
# Judge status: Accepted
n = int(input())
d = {}
for i in range(1, n+1):
    c = str(i)
    cr = c[0]
    cl = c[-1]
    key = cr + cl
    if key in d:
        d[key] += 1
    else:
        d[key] = 1
ans = 0
for key in d:
    key_r = key[-1] + key[0]
    if key_r in d:
        ans += d[key] * d[key_r]
print(ans)
# Judge status: Accepted
x,y = map(int,input().split())
n = abs(abs(x)-abs(y))
if x >=0:
  if y > 0:
    if y>x:
      ans = n
    else:
      ans = n+2
  else:
    ans = n+1
else:
  if y > 0:
    ans = n+1
  else:
    if y > x:
      ans = n
    else:
      ans = n+2
print(ans)
# Judge status: Wrong Answer
N,K = map(int,input().split())
ps = list(map(int,input().split()))

dicesSum=[]
l1=ps[0:K]
dicesSum.append(sum(l1))

if K==1:
    exp= (1+ dicesSum[0])/2
    print(exp)
else:
    for i in range(1,N-K):
        dicesSum.append(dicesSum[i-1]-ps[i-1]+ps[i+K-1])
    max_value = max(dicesSum)
    exp= (K+ max_value)/2
    print(exp)
# Judge status: Wrong Answer
n = int(input())

a = n // 11
b = n % 11

ans = 0
if b <= 6:
    ans += 1
elif b >= 7 and b <= 10:
    ans += 2

ans += a * 2 

print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
A = N // K
B = N % K
if B > abs(B-K):
  print(abs(B-K))
else:
  print(B)
# Judge status: Accepted
a=int(input())
ans=a//11*2
a%=11
if 6>=a>=1:ans+=1
elif a!=0:ans+=2
print(ans)
# Judge status: Accepted
n = int(input())

if n % 2 == 0:
  print("{:.9f}".format(0.5))

else:
  print("{:.9f}".format((n + 1) // 2 / n))
# Judge status: Accepted
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

x = ni()
ans = 0
ans += (x // 500) * 1000
x -=(x // 500) * 500
ans += (x // 5) * 5
print(ans)
# Judge status: Accepted

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

l.sort()

ans = 0
ans += l[2] - l[1]

if  (l[2] - (ans + l[0])) % 2 == 0:
    ans += (l[2] - (ans + l[0])) / 2
else:
    ans += int((l[2] - (ans + l[0])) / 2) + 2

print(int(ans))
# Judge status: Accepted
n, d = map(int, input().split())
d = d*d
ans = 0

for i in range(n):
    x, y = map(int, input().split())
    if d >= x*x + y*y:
        ans += 1

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = [0] * N
for i in range(N):
  A[i] = int(input())
  
ans = 0  
for i in range(N - 1):
  if A[i] >= A[i + 1]:
    now = int((A[i] - A[i + 1]) / 2)
    ans += now
    A[i] -= now * 2
    now2 = min(A[i], A[i + 1])
    ans += now2
    A[i + 1] -= now2
    A[i] -= now2
    
  else:
    now = A[i]
    ans += now
    A[i] -= now
    A[i + 1] -= now
  
#print(A)
print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int, input().split()))
al=sum(A)
cent=al/2
now=0
for a in A:
  if abs(cent-al+now)<abs(cent-al+now+a):
    print(abs(al-2*now))
    break
  now+=a
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    count = 0
    B =[]
    for j in range(len(A)):
        if A[j]==i:
            count += 1
        else:
            B.append(A[j])
    print(count)
    print(B)
    A = B
# Judge status: Accepted
N, K = map(int, input().split())
p = list(map(int, input().split()))
E = [(1+p[i])/2 for i in range(N)]
S = [0]
for i in range(0,N):
  S.append(S[i]+E[i])

maxnum = 0
for i in range(N+1):
  if i+K >= N+1:
    break
  maxnum = max(S[i+K]-S[i], maxnum)
print(maxnum)
# Judge status: Accepted
def gcd_e(x, y):
  if y == 0:
    return x
  else:
    return gcd_e(y,x%y)      

def lcm(x, y):
  return (x * y) // gcd_e(x, y)

n,m=list(map(int,input().split()))
A=list(map(int,input().split()))
a,b=A[0],0

for i in range(1,n):
  b = A[i]
  a = lcm(a,b)
  
for i in range(n):
  if (a // A[i]) % 2 == 0:
    print('0')
    exit()    
  
if a // 2 > m:
  print('0')
else:
  print((m-a//2)//a+1)
# Judge status: Accepted
#辞書型でリトライ
N,K = map(int, input().split(' '))
A = input().split(' ')

dic = {}
for a in range(len(A)):
    tmp = A[a]
    if not tmp in dic:
        dic[tmp] = 1
    else:
        dic[tmp] += 1

values = sorted(dic.values())
ans = 0
if len(values)<=K:
    pass
else:
    tmp = len(values)-K
    values = values[:tmp]
    ans = sum(values)

print(ans)
# Judge status: Accepted
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)
sum=0
K=int(input())
for i in range(K):
    for j in range (K):
        for k in range (K):
            sum=sum+gcd(i+1,j+1,k+1)
print(sum)
# Judge status: Accepted
N = int(input())
sum = 0
N_string = str(N)
for i in range(len(N_string)):
    sum += int(N_string[i])
if sum % 9 == 0:
    print('Yes')
else:
    print('No')