Harryxun/stf_run huggingface dataset:
import math as m
n,k=map(int,input().split())
p=0
for i in range(1,k):
  r=m.ceil(m.log(k/i,2))
  p+=1/(2**r)
for _ in range(K,N+1):
  p+=1
print(p/n)

### FIXED CODE ###

import math as m
n,k=map(int,input().split())
p=0
for i in range(1,min(n+1,k)):
  r=m.ceil(m.log(k/i,2))
  p+=1/(2**r)
for _ in range(k,n+1):
  p+=1
print(p/n)
import sys

sys.setrecursionlimit(10 ** 9)

N = int(input())
if N == 1:
    print(0)
    exit()

def f(n):
    arr = list()
    temp = n
    for i in range(2, int(-((-1 * (n**0.5)) // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if len(arr) == 0:
        arr.append([n, 1])

    return arr


tmp = f(N)
res = 0
A = [0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6]
for b, a in tmp:
    res += A[a]
print(int(res))


### FIXED CODE ###

import math

def f(n):
    arr = list()
    temp = n
    for i in range(2, int(math.sqrt(n)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append(tuple([i, cnt]))

    if temp != 1:
        tup = tuple([temp, 1])
        arr.append(tup)

    if len(arr) == 0:
        tup = tuple([n, 1])
        arr.append(tup)

    return arr

N = int(input())
if N == 1:
    print(0)
    exit()

t = f(N)
res = 0

for a in t:
    cnt = 0
    c = 0
    while cnt <= a[1]:
        c += 1
        cnt += c
    res += c - 1
    
print(res)
import heapq
N = int(input())
A = list(map(int,input().split()))

ans = 0
for i in range(N):
    ans ^= A[i]

for i in range(N):
    A[i] = (~ans)&A[i]
    A[i] *= -1

A = [a for a in A if a != 0]
heapq.heapify(A)
b = []

M = -heapq.heappop(A)
while A:
    m = -heapq.heappop(A)
    if len(bin(M)) == len(bin(m)):
        m ^= M
        if m != 0:
            heapq.heappush(A,-m)
    else:
        b.append(M)
        M = m
b.append(M)

b = b[::-1]
ans_ = 0
for i in range(len(b)):
    M = b[i]
    for j in range(i+1,len(b)):
        m = b[j]
        if len(bin(M))==len(bin(M&m)):
            b[j] ^= M
    ans_ ^= M

ans += ans_*2
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
for a in A:
    ans ^= a
M = 2**60-1
b = M^ans
for i in range(N):
    A[i] &= b
A.sort(reverse=True)
for i in range(min(60,N)):
    a = A[i]
    if a == 0:
        break
    l = len(bin(a))-3
    for j in range(N):
        if j==i:
            continue
        if A[j]//2**l%2==1:
            A[j] ^= a
        else:
            if i < j:
                break
    A.sort(reverse=True)
s = 0
for a in A:
    s ^= a
ans += 2*s
print(ans)
N = int(input())
dlist = list(map(int, input().split()))
dlist.sort(reverse=True)
sum = 0
N_2 = 2 ** N
for i in range(N_2):
    if bin(i).count('1') == 3:
        bin_i = bin(i)
        i_2 = bin_i.split('0b')[1]
        if len(i_2) < N:
            N_i = (N - len(i_2))
            N_0 = '0' * N_i
            i_2 = N_0 + i_2
        a_find = i_2.find('1')
        b_find = i_2.find('1',a_find + 1)
        c_find = i_2.find('1',b_find + 1)
        a = dlist[a_find]
        b = dlist[b_find]
        c = dlist[c_find]
        if a < b + c:
            sum += 1
print(sum

### FIXED CODE ###

import bisect
N=int(input())
L=sorted(list(map(int,input().split())))

ans=0
for i in range(N-2):
  for j in range(i+1,N-1):
    ans+=bisect.bisect_left(L,L[i]+L[j])-j-1 # Code 1 
    # ans+=bisect.bisect_left(L,L[i]+L[j],j)-j-1 # Code 2 
print(ans)
from functools import lru_cache

L = input().split()
sprime = 998244353 # approx 10**9
N = int(L[0])
A = int(L[1])
B = int(L[2])
K = int(L[3])

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

memo = [0] * (N+1)
memo[0] = memo[N] = 1
for i in range(1,N//2+1):
	v = memo[i-1] * (N-i+1) * modinv(i,sprime)
	v = v % sprime
	memo[i] = memo[N-i] = v

# max is A*N + B*N
sum = 0
for i in range(0,N):
	if (K - A*i) % B == 0:
		j = (K-A*i)//B
		sum += (memo[i] * memo[j]) % sprime

print(sum)



### FIXED CODE ###

N,A,B,K = map(int,input().split())
sprime = 998244353 # approx 10**9
A,B = sorted((A,B))
if (A+B) * N < K:
	print(0)
	exit()
 
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)
 
def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
 
memo = [0] * (N+1)
memo[0] = memo[N] = 1
for i in range(1,N//2+1):
	v = memo[i-1] * (N-i+1) * modinv(i,sprime)
	v = v % sprime
	memo[i] = memo[N-i] = v
 
# max is A*N + B*N
sum = 0
for b in range(N+1):
  a = (K-b*B)//A
  if 0 <= a <= N and a*A+b*B == K:
    sum += memo[a]*memo[b]
    sum %= sprime

print(sum)
n,m,v,p = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
p-=1

a.sort(reverse=True)

ans=0
s = sum(a)

def safe(index):
    if a[p]>a[index]+m:
        return False
    i=0
    wall = -1
    while a[i]>=a[index]+m:
        if a[i]>=a[index]+m+1:
            wall = i
        i+=1
    if i>index:
        return True
    intg = 0
    while i<index:
        intg += a[index] + m - a[i]
        i+=1
    intg += (len(a)-1-index)*m + min(v,p - wall + 1)*m
    #print("intg = ",intg ,m*(v-1) )
    return intg >= m*(v-1)

left = 0
right = len(a)-1
ans = int((right - left)/2)
if safe(right):
    ans = right
else:
    j = safe(ans)
    while not(j and not safe(ans+1)):
        if j:
            left = ans
        else:
            right = ans
        ans = left + int((right - left)/2)
        j = safe(ans)
print(ans+1)
"""
for i in range(len(a)):
    print(a[i],safe(i))
"""

### FIXED CODE ###

n,a,b = [int(i) for i in input().split()]
if (b-a)%2==0:
    print((b-a)//2)
else:
    r = a + (b-a-1)//2
    l = n-b+1 + ( n - (a+n-b+1) )//2 
    print(min(r,l))
def dfs(i: int, t: int, op: str):
  if i == 3:
    if t == 7:
      return op
    else:
      return ""

  return dfs(i + 1, t + s[i + 1], op + "+") + dfs(i + 1, t - s[i + 1], op + "-")

s = list(map(int, list(input())))
ans = 0
op = ""

op = dfs(0, s[0], op)
print(f"{s[0]}{op[0]}{s[1]}{op[1]}{s[2]}{op[2]}{s[3]}=7")


### FIXED CODE ###

def dfs(i: int, t: int, op: str):
  if i == 3:
    if t == 7:
      return op
    else:
      return ""

  return dfs(i + 1, t + s[i + 1], op + "+") + dfs(i + 1, t - s[i + 1], op + "-")

s = list(map(int, list(input())))
op = ""

op = dfs(0, s[0], op)
ans = str(s[0]) + op[0] + str(s[1]) + op[1] + str(s[2]) + op[2] + str(s[3]) + "=7"
print(ans)
N,K = [int(i) for i in input().split()]
D = [int(i) for i in input().split()]
use = [0,1,2,3,4,5,6,7,8,9]
Keta = []
Keta.append(N // 1000)
Keta.append(N % 1000 // 100)
Keta.append(N % 1000 % 100 // 10)
Keta.append(N % 1000 % 100 % 10)
Keta_Min = []

for i in range(len(D)):
    use.remove(D[i])
for i in range(4):
    A = []
    for j in range(len(use)):
        if Keta[i] <= use[j]:
            A.append(use[j])
            Keta_Min.append(min(A))

Answer = 0
Answer = Keta_Min[0] * 1000 + Keta_Min[1] * 100 + Keta_Min[2] * 10 + Keta_Min[3]
print(Answer)


### FIXED CODE ###

N,K = [int(i) for i in input().split()]
#D = [int(i) for i in input().split()]は数値代入
#文字列を複数代入
D = input().split()
#集合に置き換える(型はset)
D = set(D)
use = set(['0','1','2','3','4','5','6','7','8','9'])
use -= D

for i in range(N,100*N):
    if use >= set(str(i)):
        print(i)
        break
list = list(map(int, input().split()))
A = list[0]
B = list[1]
C = list[2]
D = list[3]

while A > 0 and B >0:
    C = C - B
    if C =< 0:break
    A = A - D

if A > 0: print("Yes")
else: print("No")

### FIXED CODE ###

list = list(map(int, input().split()))
A = list[0]
B = list[1]
C = list[2]
D = list[3]

while A > 0 and B >0:
    C = C - B
    if C <= 0:break
    A = A - D

if A > 0: print("Yes")
else: print("No")
#!/usr/bin/env python3

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

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

print(dp[N][W])


### FIXED CODE ###

#!/usr/bin/env python3

def rec(i, j):
    if (i, j) in dp:
        return dp[(i, j)]

    if i == N:
        res = 0
    elif j < w[i]:
        res = rec(i + 1, j)
    else:
        res = max(rec(i + 1, j), rec(i + 1, j - w[i]) + v[i])

    dp[(i, j)] = res
    return res


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

dp = {}
print(rec(0, W))
input()
s = 0
a = input()
a = a.split(" ")
a = map(int,a)
for u in a:
    s=s+u

print(min(a),max(a),s)


### FIXED CODE ###

n = input()
s = 0
a = input()
b = a.split(" ")
c = []
for i in range(int(n)):
    c.append(int(b[i]))

for u in c:
    s=s+u

print(min(c),max(c),s)
N = int(input())
A = list(input())
if sum(A)%2:
    print("NO")
else:
    print("YES")

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
if sum(A)%2:
    print("NO")
else:
    print("YES")
n = int(input())

ans = 0
for i in range(1, n+1, 2):
    tmp = 0
    for j in range(1, (n+1)/2):
        if i % j == 0:
            tmp += 1

    if tmp == 4:
        ans += 1

print(ans)


### FIXED CODE ###

N = int(input())
ans = 0
for i in range(1, N+1, 2):
  tmp = 0
  for j in range(1, N+1):
    if i % j == 0:
      tmp += 1
  if tmp == 8:
    ans += 1
print(ans)
from fractions import gcd
def lcm(x,y):
    return (x*y)//gcd(x,y)
n,m=map(int,input().split())
s=input()
t=input()
w=min(m,n)
l=w//gcd(m,n)
d=lcm(m,n)
p=d//n
q=d//m
h=lcm(p,q)
for i in range(0,l-1):
    g=i*h
    if s[g//p]!=t[g//q]:
        print(-1)
        break
else:
    print(d)

### FIXED CODE ###

from fractions import gcd
def lcm(x,y):
    return (x*y)//gcd(x,y)
n,m=map(int,input().split())
s=input()
t=input()
d=lcm(n,m)
p=d//n
q=d//m
h=lcm(p,q)
l=d//h
for i in range(0,l):
    g=i*h
    if s[g//p]!=t[g//q]:
        print(-1)
        break
else:
    print(d)
pritn(input().replace(","," "))

### FIXED CODE ###

s=input()
print(s.replace(",", " "))
n = int(input())
a = [int(input()) for i in range(n)]

g = gcd(a[0], a[1])
for i in range(2, n):
    g = gcd(g, a[i])
    
print(g)

### FIXED CODE ###

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

import math
g = math.gcd(a[0], a[1])
for i in range(2, n):
    g = math.gcd(g, a[i])

print(g)
S = input()
num = 753
ans = 999

for i in range(len(S) - 2):
  cur = int(S[i:i + 3])
  if (abs(num - cur) < ans):
	ans = abs(num - cur)
print(ans)
      

### FIXED CODE ###

s = input()

answer = 10000
for j in range(len(s)-2):
  t = s[j:j+3]
  answer = min(answer,abs(int(t)-753))

print(answer)
n = int(input())

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

result = aList[0]

for i + 1 in range(n):
  result = result * aList[i]

enemy = 10 ** 18

if result < enemy:
  print(result)
else:
  print("-1")

### FIXED CODE ###

n = int(input())
 
aList = list(map(int,input().split()))
 
if 0 in aList:
  print(0)
else:
  result = 1
  for a in aList:
    result = result * a
    if result > 10 ** 18:
      result = -1
      break
  print(result)
S = input()

if "a" not in S:
  print("No")
  exit()

if "b" not in S:
  print("No")
  exit()

if "c" not in S:
  print("No")
  exit()

 print("Yes")

### FIXED CODE ###

S = input()

if "a" not in S:
  print("No")
  exit()

if "b" not in S:
  print("No")
  exit()

if "c" not in S:
  print("No")
  exit()

print("Yes")
l=int(input())

list=[0]*1000000000
for i in range(l):
    a=input()
    if list[a]==1:
        list[a]=0
    else:
        list[a]=1

print(list.count(1))

### FIXED CODE ###

l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)
import math
import sys
sys.setrecursionlimit(10**7)
n, k = map(int, input().split())
a = list(map(int, input().split()))
def binary_search(left, right):
    if right - left <= 0.01:
        return right
    middle = round((right + left) / 2, 2)
    if is_can(middle):
        return binary_search(middle, right)
    else:
        return binary_search(left, middle)
def is_can(target):
    count = 0
    for i in range(n):
        count += a[i] //target
    return count > k
print(math.ceil(round(binary_search(0,10**10),1)))


### FIXED CODE ###

import math
import sys
sys.setrecursionlimit(10**8)
n, k = map(int, input().split())
a = list(map(int, input().split()))
def binary_search(left, right):
    if right - left <= 0.01:
        return right
    middle = (right + left) / 2
    if is_can(middle):
        return binary_search(left, middle)
    else:
        return binary_search(middle, right)
def is_can(target):
    count = 0
    for i in range(n):
        if a[i] > target:
            count += a[i] // target
    return count <= k
p = binary_search(0, 10**10)
if int(p) != 0 and is_can(int(p)) :
    print(int(p))
else:
    print(int(p) + 1)
A = int(input())
B = list(map(int, input().split()))
ans = 0

for i in range(1, A-1):
  if B[i-1] > B[i] > B[i+1]:
    s += 1
  elif B[i-1] < B[i] < B[i+1]:
    s+=1
    
print(s)

### FIXED CODE ###

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

for i in range(1, A-1):
  if B[i-1] > B[i] > B[i+1]:
    ans += 1
  elif B[i-1] < B[i] < B[i+1]:
    ans += 1
    
print(ans)
import heapq
n,m=map(int,input().split())
ab=[]
for i in range(m+1):
    ab.append([])
for i in range(n):
    a,b=map(int,input().split())
    ab[a].append(-b)
h = []
s=0
for i in range(1,m+1):
    for v in ab[i]:
        heapq.heappush(h,v)
    if len(h)!=0:
        s-=heapq.heappop(h)
print(s)

### FIXED CODE ###

import heapq
n,m=map(int,input().split())
ab=[]
for i in range(m+1):
    ab.append([])
for i in range(n):
    a,b=map(int,input().split())
    if a<=m:
        ab[a].append(b)
h = []
s=0
for i in range(1,m+1):
    for v in ab[i]:
        heapq.heappush(h,-1*v)
    if len(h)>0:
        s+=-1*heapq.heappop(h)
print(s)
A, B = list(map(int, input().split()))
B-=1
print((A+B-1)/B)

### FIXED CODE ###

A, B = list(map(int, input().split()))
for i in range(20):
    if B<=1+i*(A-1):
        print(i)
        break
a = int(input())
b = int(input())

print('a' + ' ' + 'b')

### FIXED CODE ###

x = input().split()
a = int(x[0])
b = int(x[1])
print(a*b, (a+b)*2)
a,b,c,d,e = [int(input) for i in range(6)]
print('Yay!' if e-a <= k else ':(')

### FIXED CODE ###

I =[int(input())for i in range(6)]

if I[4] - I[0] > I[5] :
	print(":(")
else :
	print("Yay!")
a,b = map(int,input().split())
q = list()
for i in range(1009):
  if int(i*0.08) == a and int(i*0.1) == b:
    q.append(i)

if len(q) == 0:
  print(-1)
print(min(q))

### FIXED CODE ###

a,b = map(int,input().split())
q = list()
for i in range(1009):
  if int(i*0.08) == a and int(i*0.1) == b:
    q.append(i)

if len(q) == 0:
  print(-1)
  exit()
print(min(q))
N, K = map(int, input().split())
p = list(map(int, input().split()))
ans = []
for i in range(K-1):
   T = p[i:i+K]      
   ans.append(sum(T)/2+0.5*K)
print(ans[-1])
    
      

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))
ans = [sum(p[:K])]
for i in range(N-K):
  ans.append(ans[-1]-p[i]+p[i+K])
print(max(ans)/2+K/2)
s = list(input())
n = int(input())
import numpy as np
import collections
s = np.array(s)
s = collections.deque(s)
L = []
for i in range(n):
    L = (list(map(str,input())))
    #print(L)
    if len(L) >1:
        if int(L[2]) == 1:
            #print(s)
            s = np.append(L[4],s)
        elif int(L[2]) == 2:
            s = np.append(s,L[4])
    
    elif len(L) ==1:
        s = np.flipud(s)
        
print("".join(s))

### FIXED CODE ###

from collections import deque
s = input()
s = deque(s)
n = int(input())
cnt = False
for i in range(n):
  L = input()
  if len(L) == 1:
    cnt  ^=1 
  else:
    a,b,c = L.split()
    if cnt:
      if b == "1":
        s.append(c)
      else:
        s.appendleft(c)
    else:
      if b == "1":
        s.appendleft(c)
      else:
        s.append(c)
if cnt:
    s = reversed(s)
    print("".join(s))
else:
    print("".join(s))
pair = [[1, 2], [2, 5], [3, 5], [4, 4], [5, 5], [6, 6], [7, 3], [8, 7], [9, 6]]
n, m = [int(x) for x in input().split()]
given = sorted([int(i) for i in input().split()])
given_pair = sorted([pair[x - 1] for x in given], reverse=True)

dp = (1 + n) * [0]
max_dp = 0
for i in range(n + 1):
    if i == 0:
        dp[i] = 0
    for j in range(m):
        if i - given_pair[j][1] >= 0:
            if dp[i - given_pair[j][1]] + 1 >= max_dp:
                max_dp = dp[i - given_pair[j][1]] + 1
    dp[i] = max_dp

print(given_pair)

print(dp)


def choice_list(x, index):
#    print("now_index", index)
#    print(given_pair[x][1])
#    print("now_dp_atai", dp[index - given_pair[x][1]])
    if dp[index - given_pair[x][1]] == dp[index] - 1:
        if dp[index - given_pair[x][1]] == 0:
            for j in given_pair:
                if index == j[1]:
                    return str(j[0])
            return ""
        elif index - given_pair[x][1] < 0:
            return "-1"
        else:
            return str(given_pair[x][0]) + choice_list(x, index - given_pair[x][1])

    else:
        return choice_list(x + 1, index)


print(choice_list(0, n))

### FIXED CODE ###

n, m = [int(i) for i in input().split()]
am = sorted([int(i) for i in input().split()],reverse=True)
c = [2, 5, 5, 4, 5, 6, 3, 7, 6]

dp = [-1 for i in range(n+1)]
dp[0]=0
for i in range(n+1):
    #max_tmp = -float("inf")
    for j in am:
        if i+c[j-1]<=n:
            dp[i+c[j-1]] = max(dp[i+c[j-1]], dp[i]+1)
#print(dp)
tmp_n = n
ans =""
for i in range(dp[n]):
    for j in range(m):
        if i==dp[n]-1 and tmp_n- c[am[j]-1] != 0:
            continue
        if tmp_n - c[am[j]-1] >= 0 and dp[tmp_n - c[am[j]-1]] == dp[tmp_n] -1:
            ans+=(str(am[j]))
            tmp_n -= c[am[j]-1]
            break


print(ans)
n=int(input())
a=[list(map(int,input().split())) for _ in range(n)]
x=input()
s=0
for i in range(n):
  if a[i][0]==x:
    p=i
    break
for i in range(p+1,n):
  s+=a[i][1]
print(s)

### FIXED CODE ###

n=int(input())
a=[list(input().split()) for _ in range(n)]
x=input()
s=0
for i in range(n):
  if a[i][0]==x:
    p=i
    break
for i in range(p+1,n):
  s+=int(a[i][1])
print(s)
x = int(input())
h = x // 3600 
a = x%3600
 m = a // 60
 

 b = a%60
 

 s = b
 
 print(str(h)+":"+str(m)+":"+str(s))
13:2:59

### FIXED CODE ###

x = int(input())
h = x // 3600 
a = x%3600
m = a // 60
s = a%60
print(str(h)+":"+str(m)+":"+str(s))
import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))
ans = 0
flag = True
nums = {}
for a in A:
    if a in nums:
        nums[a] += 1
    else:
        nums[a] = 1

if n % 2 == 1:
    if nums[0] != 1:
        flag = False
    for i in range(n//2):
        if nums[2*(i+1)] != 2:
            flag = False
            break
else:
    for i in range(n//2):
        if nums[2*i+1] != 2:
            flag = False
            break

if flag == True:
    ans = 2**(n//2) % (10**9 + 7)
    
print(ans)

### FIXED CODE ###

n = int(input())
nums = {0:0}

for i in list(map(int, input().split())):
    if i in nums:
        nums[i] += 1
        if nums[i] > 2:
            ans = 0
            break
    else:
        nums[i] = 1
        
if n % 2 == 0:
    if 1 in nums.values():
        ans = 0
    else:
        ans = 2**(n//2)
        
else:
    if nums[0] == 1:
        del nums[0]
        if 1 in nums.values():
            ans = 0
        else:
            ans = 2**((n-1)//2)
    else:
        ans = 0
        
print(ans % (10**9+7))
N, M = map(int, input().split())
data = []
for m in range(M):
  data.append(list(map(int, input().split())))

corresp = {}
for n in range(1, N+1):
    data_n = []
    for i in range(M):
        if data[i][0] == n:
            data_n.append(data[i])
    sort_n = sorted(data_n, key=lambda data_n_i: data_n_i[1])
    for k in range(len(sort_n)):
        corresp.update({str(sort_n[k]):k+1})
    

for i in range(M):
    print('{0:012d}'.format(data[i][0]*100000+corresp[str(data[i])]))


### FIXED CODE ###

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

print(X+(Y//2))
# B - Five Dishes

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

mini = 10
for y, x in enumerate(n):
    rest = x % 10 
    if rest != 0:
        if rest < mini:
            mini = rest
            mini_num = y 
            
time = n.pop(mini_num)
for x in n:
    if x % 10 != 0:
        item = x + (10-x%10)
        time += item
    else:
        item = x
        time += item
    
print(time)

### FIXED CODE ###

# B - Five Dishes

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

time = 0
mini = 10
for x in n:
    rest = x%10
    if rest != 0:
        mini = min(rest, mini)
    while x%10 != 0:
        x += 1
    time += x
print(time-10+mini)
from collections import deque
N,K = map(int,input().split())
P = list(map(int,input().split()))

upper = [1 for i in range(N)]
for i in range(1, N):
	x = N-i-1
	if P[x] < P[x+1]:
		upper[x] = upper[x+1] + 1

skip = [-1,-1]
flg = False
for i in range(N):
	if upper[N-i-1] >= K:
		skip.append(N-i-1)

skip.pop()
deq_min = deque([P[0]])
deq_max = deque([P[0]])
minlen = 1
maxlen = 1
for i in range(1, K):
	while minlen > 0 and deq_min[-1] > P[i]:
		deq_min.pop()
		minlen -= 1
	deq_min.append(P[i])
	minlen += 1
	while maxlen > 0 and deq_max[-1] < P[i]:
		deq_max.pop()
		maxlen -= 1
	deq_max.append(P[i])
	maxlen += 1

ans = 1
next_skip = skip.pop()
for i in range(1, N-K+1):
	new_i = i+K-1
	min_rem = (deq_min[0] == P[i-1])
	max_add = (deq_max[0] < P[new_i])
	if not (min_rem and max_add):
		if i != next_skip:
			ans += 1
	if i == next_skip:
		next_skip = skip.pop()
	if min_rem:
		deq_min.popleft()
	while minlen > 0 and deq_min[-1] > P[new_i]:
		deq_min.pop()
		minlen -= 1
	deq_min.append(P[new_i])
	minlen += 1
	while maxlen > 0 and deq_max[-1] < P[new_i]:
		deq_max.pop()
		maxlen -= 1
	deq_max.append(P[new_i])
	maxlen += 1
print(ans)

### FIXED CODE ###

from collections import deque
N,K = map(int,input().split())
P = list(map(int,input().split()))

upper = [1 for i in range(N)]
for i in range(1, N):
	x = N-i-1
	if P[x] < P[x+1]:
		upper[x] = upper[x+1] + 1

skip = [-1,-1]
flg = False
for i in range(N):
	if upper[N-i-1] >= K:
		skip.append(N-i-1)

skip.pop()
deq_min = deque([P[0]])
deq_max = deque([P[0]])
minlen = 1
maxlen = 1
for i in range(1, K):
	while minlen > 0 and deq_min[-1] > P[i]:
		deq_min.pop()
		minlen -= 1
	deq_min.append(P[i])
	minlen += 1
	while maxlen > 0 and deq_max[-1] < P[i]:
		deq_max.pop()
		maxlen -= 1
	deq_max.append(P[i])
	maxlen += 1

ans = 1
next_skip = skip.pop()
for i in range(1, N-K+1):
	new_i = i+K-1
	min_rem = (deq_min[0] == P[i-1])
	max_add = (deq_max[0] < P[new_i])
	if not (min_rem and max_add):
		if i != next_skip:
			ans += 1
	if i == next_skip:
		next_skip = skip.pop()
	if min_rem:
		deq_min.popleft()
		minlen -= 1
	if deq_max[0] == P[i-1]:
		deq_max.popleft()
		maxlen -= 1
	while minlen > 0 and deq_min[-1] > P[new_i]:
		deq_min.pop()
		minlen -= 1
	deq_min.append(P[new_i])
	minlen += 1
	while maxlen > 0 and deq_max[-1] < P[new_i]:
		deq_max.pop()
		maxlen -= 1
	deq_max.append(P[new_i])
	maxlen += 1
print(ans)