peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n,m=map(int, input().split())
a=[list(map(int, input().split())) for _ in range(m)]
c=[0]*-~n
id={}
for p,y in sorted(a,key=lambda x:x[1]):
    c[p]+=1
    id[y]=format(p,"06")+format(c[p],"06")
for _,y in a:
    print(id[y])
# Judge status: Accepted
s = input()
n = len(list(s))
p = s[:(n-1)//2]
t = s[(n+1)//2:]
p1 = ""
t1 = ""
for i in reversed(range((n-1)//2)):
    p1 += p[i]
    t1 += t[i]
if t1 == t and p1 == p and s == t1 + s[(n-1)//2]+p1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b = list(map(int, input().split()))
cnt = 0
while b >= a:
  a = a * 2
  cnt += 1

print(cnt)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))

dbl = [[0] * 61 for _ in range(N)]
for i in range(N): dbl[i][0] = a[i] - 1

for k in range(60):
  for i in range(N):
    x = dbl[i][k]
    dbl[i][k + 1] = dbl[x][k]

x = 0
while K:
  x = dbl[x][K.bit_length() - 1]
  K -= 1 << (K.bit_length() - 1)
print(x + 1)
# Judge status: Accepted
m,n = map(int,input().split())
if(m == n):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s = input()
n = len(s)
num_0 = s.count("0")
num_1 = n - num_0

print(n - abs(num_0 - num_1))
# Judge status: Accepted
def main():
    from collections import Counter
    n=int(input())
    s=[input() for _ in range(n)]
    print(len(Counter(s)))
if __name__=="__main__":
    main()
# Judge status: Accepted
from collections import deque

n = int(input())
A = []
for _ in range(n):
    A.append(int(input()))

leftA = [0]
tmp = A[0]
for a in A:
    tmp = max(tmp, a)
    leftA.append(tmp)
# print(leftA)

rightA = deque([0])
tmp = A[-1]
for a in reversed(A):
    tmp = max(tmp, a)
    rightA.appendleft(tmp)
rightA.appendleft(0)
# print(rightA)

for i in range(1, n+1):
    print(max(leftA[i-1], rightA[i+1]))
# Judge status: Accepted
N, A, B = map(int, input().split())
 
ans = (B-A)//2
if A%2 == B%2:
    print(ans)
else:
    if A-1 >= N-B:
        ans += N-B+1
        print(ans)
    elif N-B > A-1:
        ans += A
        print(ans)
# Judge status: Wrong Answer
s = list(input())
n = len(s)
left = 0
for i,c in enumerate(s):
    if c == "A":
        left = i
right = 0
for i,c in enumerate(reversed(s)):
    if c == "Z":
        right = n-i
print(right-left)
# Judge status: Accepted
n=int(input())
ans=0
for i in range(1,n+1):
    if len(str(i))%2==1:ans+=1
print(ans)
# Judge status: Wrong Answer
num = int(input())
word = str(input())

if len(word) <= num:
    print(word)
else:
    word_r = word[:num]
    for _ in range(len(word) - num):
        word_r += '.'
    print(word_r)
# Judge status: Wrong Answer
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
result = sum(reversed(sorted(H)[K:]))
print(int(result))
# Judge status: Accepted
from fractions import gcd
import math
a,b = map(int,input().split())
n = gcd(a,b)
if n == 1:
    print(1)
    exit()
count = 1
for i in range(2,math.ceil(math.sqrt(n))+1):
    if n % i == 0:
        count += 1
        while n % i == 0:
            n //= i
if n > 1:
    count += 1
print(count)
# Judge status: Accepted

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    a,b,c=input().split()
    print(a[0]+b[0]+c[0])

main()
# Judge status: Accepted
a, b = map(str, input().split(" "))

ans = False
for i in range(1000):
    if int(a + b) == i ** 2:
        ans = True

print("Yes" if ans else "No")
# Judge status: Accepted
s = list(input())
r = s[::-1]

ss=0
for i, j in zip(s, r):
    ss+=int(i!=j)

print(int(ss/2))
# Judge status: Accepted
# coding: utf-8

s = input().rstrip()

def isValid(s:str):
    if s[0] != "A":
        return False
    if s[1] == s[1].upper():
        return False
    sub = s[2:-1]
    if len([i for i in sub if i == "C"]) != 1:
        return False

    sub2 = s[1] + sub.replace("C", "") + s[-1]
    if sub2 != sub2.lower():
        return False
    return True

ans = "AC"

if not isValid(s):
    ans = "WA"

print(ans)
# Judge status: Accepted
import sys
def input():
    return sys.stdin.readline()[:-1]
def main():
    A  = list(map(int,input().split()))
    for k in range(5):
        if A[k] == 0:
            print(k+1)
            exit(0)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())

num_sum = 0
max_num = 1
for i in range(n):
    num_sum += i
    if num_sum >= n:
        max_num = i
        break

for i in range(1, max_num+1):
    if i != num_sum - n:
        print(i)
# Judge status: Accepted
x = int(input())
y = 100
ans = 0
while x > y:
    y = int(y * 1.01)
    ans += 1
print(ans)
# Judge status: Wrong Answer
s = input()
t = ''
q = int(input())
Q = [list(map(str, input().split())) for _ in range(q)]

for qi in Q:
    if int(qi[0]) == 1:
        s, t = t, s
    else:
        if int(qi[1])  == 1:
            t += qi[2]
        else:
            s += qi[2]
t[::-1]
t += s
print(t)
# Judge status: Wrong Answer
import math
def total_amount():
    N = int(input("Enter number of meals:"))
    sets = math.ceil(N / 15)
    discount = sets * 200
    print(discount)

total_amount()
# Judge status: Wrong Answer
H, N = map(int, input().split())
M = dict(iter([tuple(map(int, input().split())) for i in range(N)]))
dp = [float('inf') for i in range(H + 1)]
dp[0] = 0

for a, b in M.items():
    for i in range(H + 1):
        dp[i] = min(dp[i], dp[max(0, i - a)] + b)

print(dp[H])
# Judge status: Accepted
N = int(input())
d = list(map(int, input().split()))
d.sort()
middle = (N // 2) -1
print(d[middle+1] - d[middle])
# Judge status: Accepted
n = int(input())
h = [int(i) for i in input().split()]
INF = float("INF")
dp = [INF]*n
dp[0] = 0
dp[1] = abs(h[0]-h[1])
for i in range(2,n):
    dp[i] = min(dp[i-2]+abs(h[i-2]-h[i]),dp[i-1]+abs(h[i-1]-h[i]))
print(dp[n-1])
# Judge status: Accepted
n, k = map(int, input().split())
x = list(map(int, input().split()))

neg_to_pos = n
for i in range(n):
    if x[i] > 0:
        neg_to_pos = i
        break

res = 10 ** 14
for i in range(n - k + 1):
    l = min(x[i], 0)
    r = max(0, x[i + k - 1])
    if i <= neg_to_pos and neg_to_pos - 1 <= i + k - 1:
        tmp = min(-2 * l + r, -l + 2 * r)
        res = min(res, tmp) 
print(res)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

n, k = map(int, input().split())
x = [int(c) for c in input().split()]

ans = 1001001001
for i in range(n - k + 1):
    xl = x[i]
    xr = x[i + k - 1]
    ans = min(ans, min(abs(xl) + abs(xr - xl), abs(xr) + abs(xr - xl)))
print(ans)
# Judge status: Accepted
def resolve():
  n = int(input())
  a = list(map(int, input().split()))
  b = list(map(int, input().split()))
  ans = 0
  for i in range(n):
    if a[i] >= b[i]:
      ans += b[i]
    else:
      ans += a[i]
      b[i] -= a[i]
      if a[i+1] >= b[i]:
        ans += b[i]
        a[i+1] -= b[i]
      else:
        ans += a[i+1]
        a[i+1] = 0
  print(ans)
  return

if __name__ == "__main__":
  resolve()
# Judge status: Accepted
n,m = map(int,input().split())
li = []
for i in range(n):
    a,b = map(int,input().split())
    li.append([a,b])
li = sorted(li)
cnt = 0
coin = 0
i = 0
while True:
    if cnt == m:
        break
    if li[i][1]>0:
        li[i][1]-=1
        coin += li[i][0]
        cnt+=1
    else:
        i += 1
print(coin)
# Judge status: Accepted
def resolve():
    import numpy as np
    from decimal import Decimal

    n = int(input())
    A = np.array(list(map(Decimal, input().split())))
    if 0 in A:
        print(0)
        return

    a = Decimal(1)
    for b in A:
        a *= b
        if a > 10**18:
            print(-1)
            return
    print(a)

resolve()
# Judge status: Wrong Answer
N = int(input())
T, A = map(int, input().split())
H_li = list(map(int, input().split()))
min_abs = 10 ** 9
num = 2000
for i in range(N) :
    mean_t = T - H_li[i] * 0.006
    abs_ha = abs(H_li[i] - mean_t)
    if abs_ha < min_abs :
        min_abs = abs_ha
        num = i + 1
print(num)
# Judge status: Accepted
N,C,K=map(int,input().split())
arrive=[]
c=0
for i in range(N):
    temp=int(input())
    arrive.append(temp)

arrive.sort()
sw=False
ans=0

for j in range(N):
    if sw==False:
        lim=arrive[j]+K
        c+=1
        sw=True
    else:
        c+=1
    if j<N-1:
        if c==C or lim<arrive[j+1]:
            ans+=1
            c=0
            sw=False
    else:
        ans+=1
print(ans)
# Judge status: Wrong Answer
N=str(input())
a=list(map(int,N))
A=a[-1]
if A==3:
  print("bon")
elif A==2 or 4 or 5 or 7 or 9:
  print("hon")
else:
  print("pon")
# Judge status: Wrong Answer
n = int(input())

if n*100 % 108 == 0:
  print(int(n/1.08))
else:
  print(':(')
# Judge status: Wrong Answer
N=int(input())
w=list(map(int, input().split()))
S=sum(w)
print(S)
k=0
ans=10**7

for i in range(N-1):
    k+=w[i]
    if abs(S-2*k)<=ans:
        ans=abs(S-2*k)
        print(ans)

print(ans)
# Judge status: Wrong Answer
n = int(input())
al = list(int(input()) for _ in range(n))

for i in range(n):
    if i == 0:
        print(max(al[i:]))
    elif i == n-1:
        print(max(al[:i+1]))
    else:
        print(max(max(al[:i]), max(al[i+1:])))
# Judge status: Wrong Answer
s = int(input())
s2 = 2 * s
for w in range(2, int(s2**0.5+1)):
    if s2 % w == 0 and s2 // w <= 10**9:
        print(0, 0, w, 0, 0, s2 // w)
        break
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
D = {}
for a in A:
    if a not in D:
        D[a] = 1
    else:
        D[a] += 1

D_list = sorted(D.items(), key=lambda x: x[1])
N = len(D_list)
ANS = 0
for t in D_list:
    if N <= K:
        break
    ANS += t[1]
    N -= 1

print(ANS)
# Judge status: Wrong Answer
n = int(input())
S = []
for _ in range(n):
    S.append(input())

d = {}
for s in S:
  if s in d:
    d[s] += 1
  else:
    d[s] = 1
    
ans = 0
for i in d:
  if ans < d[i]:
    ans = d[i]

for i in d:
  if ans == d[i]:
    print(i)
# Judge status: Accepted
S = input()
string = ''
for c in S:
    if c == '0':
        string = string + '0'
    elif c == '1':
        string = string + '1'
    elif c == 'B':
        if string == '':
            pass
        else:
            string = string[:-1]
print(string)
# Judge status: Accepted
# coding: utf-8
# Your code here!
import math

def main():
    n, d = map(int, input().split())
    count = 0
    for i in range(n):
        x, y = map(int, input().split())
        distance = math.sqrt(x ** 2 + y ** 2)
        if distance <= d:
            count += 1
    print(count)
    
main()
# Judge status: Accepted
def main():
    k = int(input())
    tbl = {}
    v = int(0)
    cnt = 0
    while True:
        cnt += 1
        v = 10 * v + 7
        v = v % k

        if v == 0:
            print(cnt)
            break
        elif v in tbl.keys():
            print('-1')
            break
        else:
            tbl[v] = 0


if __name__ == '__main__':
    main()
# Judge status: Accepted
a = list(str(input()))
b = list(str(input()))
c = list(str(input()))

from collections import deque
a = deque(a)
b = deque(b)
c = deque(c)

t = a.popleft()
while True:
  if t == 'a':
    if len(a) == 0:
      print('A')
      exit()
    else:
      t = a.popleft()
  elif t == 'b':
    if len(b) == 0:
      print('B')
      exit()
    else:
      t = b.popleft()
  else:
    if len(c) == 0:
      print('C')
      exit()
    else:
      t = c.popleft()
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n):
    if i>=k:
        print('Yes' if a[i-k]<a[i] else 'No')
# Judge status: Accepted
x = int(input())
if 400 <= x <= 599:
    print(8)
elif 600 <= x <= 799:
    print(7)
elif 800 <= x <= 999:
    print(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
else:
    print(1)
# Judge status: Accepted
a, b= map(int, input().split())
print(a if b >= a else a-1)
# Judge status: Accepted
import math

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

if 2*x <= a*a*b:
  y = 2 * x / (a*b)
  print(math.degrees(math.atan(b/y)))
else:
  y = 2 * (a*a*b - x) / (a*a)
  print(math.degrees(math.atan(y/a)))
# Judge status: Accepted
n = int(input())
print(sum(sorted([int(x) for x in input().split()] * 2, reverse = True)[1:n]))
# Judge status: Accepted
def check(s):
    if len(s)%2 == 1:
        return False
    if s[len(s)//2:] == s[:len(s)//2]:
        return True
    else:
        return False

S = input()

for i in reversed(range(1,len(S))):
    if check(S[:i]):
        print(i)
        break
# Judge status: Wrong Answer
a, b = input().split()
 
if a[0] < b[0]:
  print(a+b)
else:
  print(b+a)
# Judge status: Accepted
import math

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

h=x/(a*a)
if h>(b/2):
    c=(b-h)*2
    ans = math.atan2(c,a)
else:
    d=2*a*h/b
    ans=math.atan2(b,d)
print(math.degrees(ans))
# Judge status: Wrong Answer
a=j=1
for i in input():a*=j;a%=10**9+7;j+=1
print(a)
# Judge status: Wrong Answer
import math 
n,a,b = map(int,input().split())
if a>b:
  print(0)
  exit()
if n==1 and a!=b:
  print(0)
  exit()
q = 2*(b-a+1)-1
print(q)
# Judge status: Accepted
n = int(input())
s = input()
a = s.count('.')
g = [a]
b=0
while b<n:
  if s[b] == '.':
    a-=1
  else:
    a+=1
  g.append(a)
  b+=1
print(min(g))
# Judge status: Accepted
import itertools
import math
import fractions
import functools
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

def main():
    a,b = map(int, input().split())
    sum = 0
    
    for height in range(1,1000):
        sum += height
        if b-a == height:
            print(sum-b)
            break;
        
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n=int(input())
x= list(range(-64, 64, 1))
#print(x)
a = 100
b = 100
for i in x:
    for j in x:
        if i**5-j**5 == n:
            print(i, end=" ")
            print(j)
            exit()
# Judge status: Wrong Answer
H, N = map(int, input().split())

count = 0
i = 0
arr = list(map(int, input().split()[:N]))
attack = H

for i in range(N):
    attack = attack - arr[i]
    count = count + 1
    i = i + 1
if attack <= 0 and count > 1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())

xyz = {}
for x in range(1, 10**2):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            num = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if num in xyz.keys():
                xyz[num] += 1
            else:
                xyz[num] = 1

for i in range(1, n + 1):
    if i in xyz.keys():
        print(xyz[i])
    else:
        print(0)
# Judge status: Accepted
input()
A=list(map(int,input().split()))
M=[0,1000]
for i in range(0,len(A)-1):
    if A[i]>A[i+1]:
        M[1]+=A[i]*M[0]
        M[0]=0
    elif A[i]<A[i+1]:
        M[0]+=int(M[1]/A[i])
        M[1]=M[1]%A[i]
M[1]+=A[i+1]*M[0]
M[0]=0
print(M[1])
# Judge status: Accepted
x = int(input()) - 1

time1 = x // 11
X = x % 11
time1 *= 2
if X > 5:
    time1 += 2
else:
    time1 += 1
print(time1)
# Judge status: Accepted
S = list(input())
a = 0
b = 0
N = len(S)
for i in range(N):
  if S[i] == '0':
    a += 1
  else:
    b += 1
m = min(a, b)
ans = m*2
print(ans)
# Judge status: Accepted
x,a,b = map(int,input().split())
print("delicious" if a>=b else "safe" if b-a<=x else "dangerous")
# Judge status: Wrong Answer
h = int(input())

ans = 0

for i in range(h):
    ans += 2 ** i
    h//= 2
    if h == 1:
        ans += 2 ** (i + 1)
        print(ans)
        exit()
# Judge status: Accepted
s=input()
word='keyence'
flag=0
if s[:6]==word:
    flag=1
if s[-7:]==word:
    flag=1
for i in range(7):
    if s[:i]+s[-(7-i):]==word:
        flag=1
print('YES' if flag else 'NO')
# Judge status: Wrong Answer
import sys

s = input()
k = int(input())

for i in range(0, len(s)):
  if s[i] != '1':
    print(s[i])
    sys.exit(0)
print('1')
# Judge status: Accepted
X = list(map(int,input().split()))
if sum(X) <= 21:
    print("win")
else:
    print("bust")
# Judge status: Accepted
A,B=map(int,input().split())

ans=A+B

if ans>=24:
    print(ans-24)
else:
    print(ans)
# Judge status: Wrong Answer
l,r = map(int,input().split())
ans = 2019

for i in range(l,r+1):
    if ans == 0:
        break
    ans = min(ans,i%2019)

print(ans*(ans+1))
# Judge status: Wrong Answer
X,Y=map(int,input().split())
if 2*X<=Y and Y<=4*X:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a = [0] * 3
for i in range(3):
    a[i] = list(map(int, input().split()))
n = int(input())
b = set()
for _ in range(n):
    b.add(int(input()))

if (
    set(a[0]) <= b
    or set(a[1]) <= b
    or set(a[2]) <= b
    or set(x[0] for x in a) <= b
    or set(x[1] for x in a) <= b
    or set(x[2] for x in a) <= b
    or {a[0][0], a[1][1], a[2][2]} <= b
    or {a[0][2], a[1][1], a[2][0]} <= b
):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a = input()
if ord(a) <= ord('Z'):
    print('A')
else:
    print(a)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

rua = [0] * (n + 1)
rub = [0] * (n + 1)
for i in range(n):
    rua[i + 1] = rua[i] + a[i]
    rub[i + 1] = rub[i] + b[i]
    
ans = 0
for i in range(n):
    ans = max(ans, rua[i + 1] + rub[n - i])
print(ans)
# Judge status: Wrong Answer
A, B, X = map(int, input().split())
if 0 < X - A <= B:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, K = map(int, input().split())
MOD = 10 ** 9 + 7

ans = 0
for k in range(K, N+2):
    ans = (ans + k*N - k*(k-1) + 1) % MOD
#     print(k*(k-1)//2, k*N - k*(k-1)//2)
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
n, k  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()


n -= k
k -= 1
print(n // k + (int(bool(n % k))) + 1)
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
total = 0
for i in range(n-1):
  if a[i]+1==a[i+1]:
    total += c[a[i]-1]
total += sum(b)
print(total)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if a<=c<=b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
S = input()
N = len(S)

map_ = [-1] * 2019
map_[0] = 0
ans = 0
now = 0
for i in range(0, N):
    now = (now + int(S[N - i - 1]) * pow(10, i, 2019)) % 2019
    map_[now] += 1
    ans += map_[now]

print(ans)
# Judge status: Accepted
n = int(input())
if n < 1000:
	print("ABC")
else:
	print("ABD")
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())
print((a+b) * h // 2)
# Judge status: Accepted
o = input()
e = input()

olen = len(o)
elen = len(e)

res = ""

if olen == elen:
    for i in range(olen):
        res += o[i]
        res += e[i]
    print(res)

else:
    for i in range(elen):
        res += o[i]
        res += e[i]
    res += o[elen]
    print(res)
# Judge status: Accepted
n = int(input())
print(n*2*3.14159)
# Judge status: Wrong Answer
n = input()

if n[0] != 7 and n[1] != 7 and n[2] == 7:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
N,A,B = map(int,input().split())
if (B-A)%2 == 0:
  print((B-A)//2)
else:
  print( (B-A)//2 + 1 +min(A-1,N-B) )
# Judge status: Accepted
n=int(input())
l=[]
for i in range(n):
  a,b=input().split()
  b=-1*int(b)
  l.append([a,b,i+1])
l=sorted(l)
for i in range(n):
  print(l[i][2])
# Judge status: Accepted
s = input()
year = s[0:4]
month = s[5:7]
day = s[8:10]
i = int(year + month + day)
if i <= 20190430:
  print('Heisei')
else:
  print('TBD')
# Judge status: Wrong Answer
N = int(input())

if N == 1:
  print(0)
elif N % 2 == 0:
  print(0.5)
else:
  print((N//2) / N)
# Judge status: Wrong Answer
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = str(input())
lst = []

for i in range(len(T)):
    if T[i] == 'r':
        lst.append(P)
    elif T[i] == 's':
        lst.append(R)
    else: # T[i] == 'p'
        lst.append(S)
#print(lst)

for j in range(N,K,-1):
    if lst[j-1] == lst[j-K-1]:
        lst[j-K-1] = 0

print(sum(lst))
# Judge status: Accepted
n,k = map(int, input().split())
H = list(map(int, input().split()))
H.sort(reverse=True)

for i in range(min(k,n)):
    H[i] = 0

print(sum(H))
# Judge status: Wrong Answer
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if a > b:
    a = a - v * t
    b = b - w * t
    print('YES' if a < b else 'NO')
elif a < b:
    a = a + v * t
    b = b + w * t
    print('YES' if a > b else 'NO')
# Judge status: Accepted
k=int(input())

from collections import deque
q = deque(range(1,10))

for i in range(k-1):
    d = q.popleft()
    #10
    if d % 10 != 0:
        q.append(10 * d + d % 10 - 1)
    #11
    q.append(10 * d + d % 10)
    #12
    if d % 10 != 9:
        q.append(10 * d + d % 10 + 1)
print(q.popleft())
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = ""

if n%2 == 0:
  for i in range(0,n,2):
    b = b + str(a[i])
    b = str(a[i+1]) + b
else:
  for i in range(0,n-1,2):
    b = str(a[i]) + b
    b = b + str(a[i+1])
  b = str(a[n-1]) + b

print(" ".join(b))
# Judge status: Accepted
N=int(input())
A=[0 for _ in range(N)]
B=[0 for _ in range(N)]
for i in range(N):
  a,b=[int(s) for s in input().split()]
  A[i]=a
  B[i]=b
A.sort()
B.sort()
def doublemed(ls,num):
  if num%2==0:
    return(ls[num//2-1]+ls[num//2])
  else:
    return(ls[num//2])
meda=doublemed(A,N)
medb=doublemed(B,N)
print(medb-meda+1)
# Judge status: Accepted
a, b = list(map(int, input().split()))

if 0 < a:
    ans = 'Positive'
elif b < 0:
    if (b - a + 1) % 2 == 0:
        ans = 'Positive'
    else:
        ans = 'Negative'
else:
    ans = 'Zero'
    
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = []
for i in range(N):
    a,b=input().split()
    b=100-int(b)
    A.append(a+str(b))
B=sorted(A)
for b in B:
    print(A.index(b)+1)
# Judge status: Accepted
n,t=map(int,input().split())
ans=10**10
for _ in range(n):
  c,tt=map(int,input().split())
  if tt<=t:ans=min(ans,c)
if ans==10**10:print("TLE")
else:print(ans)
# Judge status: Wrong Answer
a,b=map(int,input().split())
c=0
for i in range(a):
  c+=b*(10**i)

d=0
for j in range(b):
  d+=a*(10**j)

e=min(c,d)
print(e)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
c=int(input())
x=int(input())
aa=x//500
bb=x//100
cc=x//50
ans=0
for ai in range(aa):
  for bi in range(bb):
    for ci in range(cc):
      y=500*ai+100*bi+50*ci
      if x == y:
        ans+=1
      if y>x:
        break
print(ans)
# Judge status: Wrong Answer
#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    print(sum(A[N:2*N]))

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = int(input())

if N % 500 == 0 :
	answer = "Yes"
elif N % 500   <= A:
	answer = "Yes"
else:
	answer = "No"

print(answer)
# Judge status: Accepted
n, k = map(int, input().split())
scaffolds = list(map(int, input().split()))
dp = [10 ** 5 * 10 ** 4] * n
dp[0] = 0
for i in range(n):
    for j in range(1, k + 1):
        if i + j >= n:
            break
        dp[i + j] = min(dp[i + j], abs(scaffolds[i] - scaffolds[i + j]) + dp[i])
print(dp[-1])
# Judge status: Wrong Answer
D,N=map(int,input().split())
print(N*100**D)
# Judge status: Accepted
S = list(map(int, input()))

zero = []
one = []

zerocount = 0
onecount = 0

for i in range(len(S)):
    if i%2 == 0:
        zero.append(0)
        one.append(1)
    else:
        zero.append(1)
        one.append(0)

for i in range(len(S)):
    if zero[i] != S[i]:
        zerocount += 1
    if one[i] != S[i]:
        onecount += 1

if zerocount<onecount:
    print(zerocount)
else:
    print(onecount)
# Judge status: Wrong Answer
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

def main():
    x, y, z = map(int, input().split())
    print(x * y / 2)


main()