Harryxun/stf_run huggingface dataset:
n,k=map(int,input().split())
s=list(input())
s=list(map(int,s))
stack=[]
tmp=1
for i in range(1,len(s)):
  if s[i]!=s[i-1]:
    stack.append(tmp)
    tmp=1
  else:
    tmp+=1
stack.append(tmp)
if s[0]==1:
  if len(s)//2<=k:
    print(len(s))
    exit()
if s[0]==0:
  if (len(s)+1)//2<=k:
    print(len(s))
    exit()
acc=[]
acc2=[]
ans=0
if s[0]==1:
  Acc=stack[0]
  Acc2=0
  acc.append(Acc)
  acc2.append(0)
  for i in range(1,len(stack)-len(stack)%2,2):
    Acc+=stack[i]
    Acc+=stack[i+1]
    acc.append(Acc)
    Acc2+=stack[i-1]
    Acc2+=stack[i]
    acc2.append(Acc2)
  if len(stack)%2==1:
    Acc+=stack[-1]
    acc.append(Acc)
    Acc2+=stack[-2]
    Acc2+=stack[-1]
    acc2.append(Acc2)
  for i in range(len(acc)-k-1):
    ans=max(ans,acc[i+k]-acc2[i])
if s[0]==0:
  Acc=stack[0]
  Acc2=0
  acc.append(0)
  acc.append(Acc)
  acc2.append(0)
  for i in range(1,len(stack)-len(stack)%2,2):
    Acc+=stack[i]
    Acc+=stack[i+1]
    acc.append(Acc)
    Acc2+=stack[i-1]
    Acc2+=stack[i]
    acc2.append(Acc2)
  if len(stack)%2==1:
    Acc+=stack[-1]
    acc.append(Acc)
    Acc2+=stack[-2]
    Acc2+=stack[-1]
    acc2.append(Acc2)
  for i in range(len(acc)-k-1):
    ans=max(ans,acc2[i+k]-acc[i])
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
s=list(input())
s=list(map(int,s))
stack=[]
tmp=0
now=1
for i in range(n):
  if s[i]==now:
    tmp+=1
  else:
    stack.append(tmp)
    tmp=1
    now=1-now
stack.append(tmp)
if len(stack)%2==0:
  stack.append(0)
Acc=[0]*(len(stack)+1)
for i in range(len(stack)):
  Acc[i+1]=Acc[i]+stack[i]
ans=0
for i in range(0,len(stack),2):
  left = i
  right = min(i+k*2+1,len(stack))
  ans=max(ans,Acc[right]-Acc[left])
print(ans)
import math as m
N = int(input())
F_ab = 0
for i in range(1, int(sqrt(N))+1):
    if N%i != 0:
        continue
    if i == 1:
        F_ab = len(str(N//i))
    else:
        F_ab = min(F_ab, max(len(str(i)), len(str(N//i))))

print(F_ab)

### FIXED CODE ###

import math as m
N = int(input())
F_ab = 0
for i in range(1, int(m.sqrt(N))+1):
    if N%i != 0:
        continue
    if i == 1:
        F_ab = len(str(N//i))
    else:
        F_ab = min(F_ab, max(len(str(i)), len(str(N//i))))

print(F_ab)
n=int(input())
nlist=make_divisors(n)
n1list=make_divisors(n-1)
# print(nlist)
# print(n1list)
answer=len(n1list)-1#1を除きます
for i in nlist[1:len(nlist)]:
    pra=n
    while (pra%i==0):
        pra=pra/i
    if pra%i==1:
        answer+=1
print(answer)


### FIXED CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
n=int(input())
nlist=make_divisors(n)
n1list=make_divisors(n-1)
# print(nlist)
# print(n1list)
answer=len(n1list)-1#1を除きます
for i in nlist[1:len(nlist)]:
    pra=n
    while (pra%i==0):
        pra=pra/i
    if pra%i==1:
        answer+=1
print(answer)
X = int(input())

p = [0]*1000

flag = False
for i in range(1000):
    p[i] = i**5

for i in range(1,1000):
    for j in range(1,1000):
        if p[i]-p[j] == X or flag:
            a = i
        
            b = j
            flag=True
        if p[i] + p[j] ==X or flag:
            a=i
            b=-j
            flag=True
        if flag:
            break
    if flag:
        break

print(str(a)+" "+str(b))


### FIXED CODE ###

X=int(input())
A=0
B=0
flag = False
for a in range(120):
    for b in range(120):
        if a**5 - b**5 == X:
            A=a
            B=b
            flag = True

        if a ** 5 + b**5 == X:
            A=a
            B=-b

        if -a**5 + b**5 ==X:
            A =-a
            B = b

        if flag:
            break
    if flag:
        break
print(str(A)+" "+str(B))
for j in range(N):
    if N == 1:
       break
 
    if H[j] >= H[j+1]:
        count += 1
    else:
        if count > ans:
            ans   = count
            count = 0
        else:
 
 
    if j == N-2:
        if count > ans:
            ans   = count
        break

print(ans)


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))

ans   = 0
count = 0


for j in range(N):
    if N == 1:
       break
 
    if H[j] >= H[j+1]:
        count += 1
    else:
        ans   = max(count, ans)
        count = 0
 
    if j == N-2:
        if count > ans:
            ans   = count
        break

print(ans)
A,B,K = map(int,input().split())

if k <= A:
    print(A - k, B)
elif k <= (A + B):
    print(0, B - (k - A))
else:
    print(0, 0)

### FIXED CODE ###

A,B,K = map(int,input().split())

if K <= A:
    print("{} {}".format(A - K, B))
elif K <= (A + B):
    print("{} {}".format(0,B - (K - A)))
else:
    print("{} {}".format(0, 0))
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
L = []
for i in range(M):
	b, c = map(int, input().split())
	for j in range(b):
		L.append(c)
list.sort(L, reverse = True)
if len(L) >= N:
	L = L[:N]
else:
	L.append(0 * (N - len(L)))
i = 0
while L[i] >= A[i] and i < N:
	i += 1
x = sum(L[:i]) + sum(A[i:])
print(x)

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
L = []
for i in range(M):
	b, c = map(int, input().split())
	L.append((c, b))
L = sorted(L, reverse = True)
L.append((0, N))
temp = 0
sum = 0
for i in range(M + 1):
	for j in range(L[i][1]):
		if A[temp] < L[i][0]:
			sum += L[i][0]
			temp += 1
		else:
			sum += A[temp]
			temp += 1
		if temp == N:
			break
	if temp == N:
		break
print(sum)
# coding: utf-8
import math
A, B = [int(x) for x in input().split(" ")]

print((A*B) // math.gcd(A, B))

### FIXED CODE ###

# coding: utf-8
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

 #最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)
 
A, B = [int(x) for x in input().split(" ")]
 
print(lcm(A, B))
n,m=map(int,input().split())
a=[input() for _ in range(n)]
b=[input() for _ in range(m)]
ans='No'
for i in range(n-m+1):
    for j in range(n-m+1):
        if a[i][j]==b[0][0] and a[i][j+1]==b[0][1] and a[i+1][j]==b[1][0] and a[i+1][j+1]==b[1][1]:
            ans='Yes'
            break
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())

a=[input() for _ in range(n)]
b=[input() for _ in range(m)]
ans='No'
for i in range(n-m+1):
    for j in range(n-m+1):
        flag=True
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l]!=b[k][l]:flag=False
        if flag:
            ans='Yes'
            break
print(ans)
n=int(input())
h=list(map(int,input().split()))
max_n=10**5
DP=[-1 for i in range(max_n)] #計算のメモ、-1は未計算
def dp(i): #足場i+1までにかかる最小のコスト
    if DP[i]!=-1: #メモがあれば使う
        return DP[i]
    if i==0: #初期条件が足場1より0
        return 0
    elif i==1: #足場2へは1から2への一通りしかない
        return abs(h[0]-h[1])
    res1=abs(h[i-1]-h[i])+dp(i-1) #1つジャンプして足場i+1につくときの最小コスト
    res2=abs(h[i-2]-h[i])+dp(i-2) #2つジャンプして足場i+1につくときの最小コスト
    DP[i]=min(res1,res2) #二つのうち小さいほうが足場i+1につく最小コスト
    return DP[i]

print(dp(n-1))

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
max_n=10**5

dp=[-1]*max_n #dp[i-1]が足場iまでのコストの最小値
dp[0]=0
dp[1]=abs(h[0]-h[1])
for i in range(2,n):
    res1=dp[i-1]+abs(h[i]-h[i-1]) #1ジャンプして足場iの時の最小値
    res2=dp[i-2]+abs(h[i]-h[i-2]) #2ジャンプして足場iの時の最小値
    dp[i]=min(res1,res2)

print(dp[n-1])
import numpy as np

H, W = map(int, input().split())
b = []
for _ in range(W):
    b.append(list(map(int, input().replace('.', '0').replace('#', '1'))))
a = np.array(b)
num = 0

while (a == 0).any():
    ne = a.copy()
    ne[1:, :] += a[:-1, :]
    ne[:-1, :] += a[1:, :]
    ne[:, 1:] += a[:, :-1]
    ne[:, :-1] += a[:, 1:]
    num += 1
    a = ne

print(num)

### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())
a = [[0] * W for _ in range(H)]
q = deque([])
for i in range(H):
    s = input()
    for j in range(W):
        if s[j] == '#':
            a[i][j] = 1
            q.appendleft((i, j, 0))

while True:
    try:
        i, j, val = q.pop()
        if i > 0 and a[i - 1][j] == 0:
            q.appendleft((i - 1, j, val + 1))
            a[i - 1][j] = 1
        if i < H - 1 and a[i + 1][j] == 0:
            q.appendleft((i + 1, j, val + 1))
            a[i + 1][j] = 1
        if j > 0 and a[i][j - 1] == 0:
            q.appendleft((i, j - 1, val + 1))
            a[i][j - 1] = 1
        if j < W - 1 and a[i][j + 1] == 0:
            q.appendleft((i, j + 1, val + 1))
            a[i][j + 1] = 1
    except:
        print(val)
        break
def DFS(add,next):
    global cnt
    x,y=add
    for i,j in [[1,0],[-1,0],[0,1],[0,-1]]:
        X,Y=x+i,y+j
        if 0<=X<h and 0<=Y<w:
            if S[X][Y]==next and color[X][Y]=="white":
                color[X][Y]="black"
                DFS([X,Y],"." if next=="#" else "#")
                if next==".":cnt +=1


h,w=map(int,input().split())
S=[list(input()) for _ in range(h)]
cnt=0

for i in range(h):
    for j in range(w):
        if S[i][j]=="#":
            color=[["white" for _ in range(w)] for _ in range(h)]
            color[i][j]="black"
            DFS([i,j],".")

print(cnt)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline


def DFS(add,next,cnt):
    x,y=add
    for i,j in [[1,0],[-1,0],[0,1],[0,-1]]:
        X,Y=x+i,y+j
        if 0<=X<h and 0<=Y<w:
            if S[X][Y]==next and color[X][Y]=="white":
                color[X][Y]=str(cnt)
                DFS([X,Y],"." if next=="#" else "#",cnt)


h,w=map(int,input().split())
S=[list(input()) for _ in range(h)]
cnt=0

color=[["white" for _ in range(w)] for _ in range(h)]
for i in range(h):
    for j in range(w):
        if S[i][j]=="#" and color[i][j]=="white":
            cnt +=1
            DFS([i,j],".",cnt)

dictionary={str(i+1):[0,0] for i in range(cnt)}
for i in range(h):
    for j in range(w):
        if color[i][j]!="white":
            if S[i][j]==".":dictionary[color[i][j]][0] +=1
            else:dictionary[color[i][j]][1] +=1

ans=0
for v,m in dictionary.values():
    ans +=v*m
print(ans)
root = [i for i in range(N + 1)]
comp_size = [1] * (N+1)
 
def root_find(x):
  y = root[x]
  if x == y:
    return x
  else:
    z = root_find(y)
    root[x] = z
    return z

def merge(x, y):
  #print(x, y)
  rx = root_find(x)
  ry = root_find(y)
  sx = comp_size[rx]
  sy = comp_size[ry]
  if rx == ry:
    return 0
  else:
    if sx >= sy:
      root[ry] = rx
      comp_size[rx] = sx + sy
    else:
      root[rx] = ry
      comp_size[ry] = sx + sy
    return sx * sy

### FIXED CODE ###

A,B,C=map(int,input().split())
print(min(C,B//A))
n=int(input())
a=list(map(int,input().split()))
sn=[0]*n
mi2=0
mi=0
for i in range(0,n):
    if sn[a[i]]==1:
        mi2=1-mi2
    else:
        sn[a[i]]=1
        mi+=1
print(mi-mi2)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
kjn=0
b=0
mi=0
mi2=0
for i in range(0,n):
    if a[i]==kjn:
        b=3-b
    else:
        if b==2:
            mi2+=1
        b=1
        kjn=a[i]
        mi+=1
if b==2:
    mi2+=1
print(mi-mi2%2)
D, G = map(int, input().split())
Ci = [list(map(int, input().split())) for _ in range(D)]


MAX_BIT = (1 << D)
# 各ビットが1のとき全部解く
def calc(patternBit):
    if patternBit >= MAX_BIT:
        return None
    p = patternBit
    score = 0
    ans1 = 0
    use_c = None
    for i, c in enumerate(Ci):
        s = (i + 1) * 100 #1問のスコア
        if p % 2 > 0:
            score += s * c[0] + c[1]
            ans1 += c[0]
        else:
            use_c = c + [s]
        p = p // 2
    if score < G:
        if use_c == None:
            return calc(patternBit + 1)
        remain = G - score
        add_count = remain // use_c[2]
        if remain % use_c[2] > 0:
            add_count += 1
        if add_count > use_c[0]:
            return calc(patternBit + 1)
        ans1 += add_count
    ans2 = calc(patternBit + 1)
    if ans2 != None:
        return min(ans1, ans2)
    return ans1
    
print(calc(0))    


### FIXED CODE ###

D, G = map(int, input().split())
Ci = [list(map(int, input().split())) for _ in range(D)]


MAX_BIT = (1 << D)
minimum = 1000000000
# 各ビットが1のとき全部解く
for patternBit in range(MAX_BIT):
    if patternBit >= MAX_BIT:
        continue
    p = patternBit
    score = 0
    ans1 = 0
    use_c = None
    for i, c in enumerate(Ci):
        s = (i + 1) * 100 #1問のスコア
        if p % 2 > 0:
            score += s * c[0] + c[1]
            ans1 += c[0]
        else:
            use_c = c + [s]
        p = p // 2
    if score < G:
        remain = G - score
        add_count = remain // use_c[2]
        if remain % use_c[2] > 0:
            add_count += 1
        if add_count > use_c[0]:
            continue
        ans1 += add_count
    minimum = min(minimum, ans1)
    
print(minimum)
S=list(input())
K=int(input())
l=[1]
for i in range(len(S)-1):
    if S[i]==S[i+1]:l[-1]+=1;
    else:l.append(1)
if len(l)==1:ans = len(S)*K/2;
else:
    l2=[i/2 for i in l]
    if S[0]==S[-1]:
        ht=l(l[0]+l[-1])//2
        ans=ls2.pop(0)
        ans+=l2.pop(-1)
        ans+=sum(l2)*K
        ans+=ht*(K-1)
    else:
        ans=sum(ls)*K
print(ans)
    


### FIXED CODE ###

S=list(input())
K=int(input())
l=[1]
for i in range(len(S)-1):
    if S[i]==S[i+1]:l[-1]+=1;
    else:l.append(1)
if len(l)==1:ans = len(S)*K//2;
else:
    l2=[i//2 for i in l]
    if S[0]==S[-1]:
        ht=(l[0]+l[-1])//2
        ans=l2.pop(0)
        ans+=l2.pop(-1)
        ans+=sum(l2)*K
        ans+=ht*(K-1)
    else:
        ans=sum(l2)*K
print(int(ans))
a=int(input())
print(round((a*(a-(-1+math.sqrt(3)*(1j))/2)*(a-(-1-math.sqrt(3)*(1j))/2)).real))

### FIXED CODE ###

a=int(input())
print(a+a**2+a**3)
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    C = [set() for _ in range(N)]
    E = [[] for _ in range(N)]
    E2 = []
    for _ in range(N-1):
        a, b = map(int, input().split())
        E[a-1].append(b-1)
        E[b-1].append(a-1)
        E2.append([a-1, b-1])
#    print(E)
#    print(E2)
    K = 0
    for e in E:
        K = max(K, len(e))
    print(K)
    S = []
    for _ in range(N):
        s = set()
        for i in range(1, K+1):
            s.add(i)
        S.append(s)
    for a, b in E2:
        s = s[a]
        s -= C[a]
        s -= C[b]
        c = s.pop()
        print(c)
        C[a].add(c)
        C[b].add(c)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline


def main():
    N = int(input())
    G = [[] for _ in range(N)]
    for i in range(N-1):
        a, b = map(int, input().split())
        G[a-1].append((b-1, i))
        G[b-1].append((a-1, i))

    V = [[-1, -1] for _ in range(N)]  # 頂点の[親, 親への辺の色]
    ans = [-1]*(N-1)
    import collections
    Q = collections.deque()
    Q.append(0)
    while Q:
        i = Q.popleft()
        color = 0
        for c, ei in G[i]:
            if c == V[i][0]:
                continue
            V[c][0] = i
            color += 1
            if color == V[i][1]:
                color += 1
            V[c][1] = ans[ei] = color
            Q.append(c)
    print(max(ans))
    print('\n'.join(map(str, ans)))


if __name__ == '__main__':
    main()
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c
     
    c=a%b
    
    if c==0:
     return b
    else:
     return gcd(b,c)
 
def lcm(a,b):
    c=gcd(a,b)
    return a/c*b
 
 
 
n=int(input())
t=[0]*n
 
for lop2 in range(n):
    t[lop2]=int(input())
 
ans=t[0]
 
for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

### FIXED CODE ###

'''
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c

    c=a%b

    if c==0:
     return b
    else:
     return gcd(b,c)
'''

def gcd(a,b):
    return a if b == 0 else gcd(b,a%b)

def lcm(e,f):
    c=gcd(e,f)
    g=e*f
    return g//c



n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))
x,y = int(input())
flag = 0
for i in range(x+1):
  if (y - 2*i)%4 == 0 and (y -  2 * i)//4 == x - i:
    flag += 1
    print("Yes")
    break
if flag == 0:
  print("No")

### FIXED CODE ###

x,y = map(int,input().split())
flag = 0
for i in range(0,x+1):
    #鶴だけ固定
    now = y - 2 * i
    #亀の足の数 = y - 2×鶴の足の数
    if now % 4 == 0:
        #足の数が4で割り切れたら
        if now //4 == (x - i):
            #足の数の商が (x - i)と一致したら
            print("Yes")
            flag += 1
            break
if flag == 0:
    print("No")
import math

def lcm(x,y):
    return x*y/math.gcd(x,y)

A,B=map(int,input().split())
print(int(lcm(A,B)))

### FIXED CODE ###

def gcd(x,y):
    while y!=0:
        x,y=y,x%y
    return x

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

A,B=map(int,input().split())
print(int(lcm(A,B)))
s = input()
K = int(input())
L = len(s)
cand = []

if L > 5:
    c = []
    order = sorted(list(s))
    for i in range(L):
        if order[i] in c:
            pass
        else:
            c.append(order[i])
            if len(c) == 3; #5:
                break
else:
    c = list(s)

for i in range(L):
    if s[i] in c:
        for j in range(i+1,min(i+K+1,L+1)):
            cand.append(s[i:j])
cand.sort()

i = 0
if len(cand) == 1:
    print(cand[0])
    exit()
while True:
    if cand[i] == cand[i+1]:
        i+=1
        continue
    K-=1
    i+=1
    if K == 0:
        print(cand[i-1])
        break


### FIXED CODE ###

s = input()
K = int(input())
L = len(s)
cand = []

if L > 5:
    c = []
    order = sorted(list(s))
    for i in range(L):
        if order[i] in c:
            pass
        else:
            c.append(order[i])
            if len(c) == 5:
                break
else:
    c = list(s)

for i in range(L):
    if s[i] in c:
        for j in range(i+1,min(i+K+1,L+1)):
            cand.append(s[i:j])
cand.sort()

i = 0
if len(cand) == 1:
    print(cand[0])
    exit()

i = 0
while True:
    K -= 1
    if K == 0:
        print(cand[i])
        break
    i += 1
    while(cand[i] == cand[i-1]):
        cand.pop(i)
N = int(input())

[int(N) for c in str(N)]

if 7 in N:
    print('Yes')
else:
    print("No")

### FIXED CODE ###

n=input()
for c in n:
 if c=='7': #与えられた数に7が1つでも含まれていればYesを返す
   print('Yes')
   break
else: #1つも含まれていなければNoを返す
 print('No')
a=list(map(int,input().split()))
b= [a[2], a[0], a[1]]
print (f"{b[0]} {b[1]} {b[2]}")

### FIXED CODE ###


A = list(map(int,input().split()))
n = A[0]
A[0] = A[2]
A[2] = A[1]
A[1] = n
print(A[0], A[1], A[2])
N = int(input())
S = input()
x = [0]*N

if S[0] == 'I':
        x[0] += 1
else:
    x[0] -= 1

for i in range(1,N):
    if S[i] == 'I':
        x[i] = x[i-1] + 1
    else:
        x[i] = x[i-1] - 1

print(max(x,0))

### FIXED CODE ###

N = int(input())
S = input()
x = [0]*N

if S[0] == 'I':
        x[0] += 1
else:
    x[0] -= 1

for i in range(1,N):
    if S[i] == 'I':
        x[i] = x[i-1] + 1
    else:
        x[i] = x[i-1] - 1

print(max(x) if max(x) > 0 else 0)
import copy
n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
if n == 1:
    if m == 1:
        print(0)
    else:
        print(1)
else:
    if 1 == a[0]:
        if 2 in a:
            a1 = 0
            a2 = 0
        else:
            a1 = 0
            a2 = 1
    else:
        if 2 in a:
            a1 = 1
            a2 = 0
        else:
            a1 = 1
            a2 = 2
    if n == 2:
        print(a2)
    else:
        for i in range(3,n+1):
            if i in a:
                a1 = copy.copy(a2)
                a2 = 0
            else:
                an = a1 + a2
                a1 = copy.copy(a2)
                a2 = copy.copy(an)
        print(a2 % 1000000007)

### FIXED CODE ###

import copy
n,m = map(int,input().split())
a00 = 0
a0 = 1
if m > 0:
    ann = 0
    for i in range(m):
        an = int(input())
        if an != ann:
            for x in range(an-ann-1):
                ak = copy.copy(a00 + a0)
                a00 = copy.copy(a0)
                a0 = copy.copy(ak)
            ann = copy.copy(an)
            a00 = copy.copy(a0)
            a0 = 0
        else:
            ann = copy.copy(an)
    for j in range(n-an):
        ak = copy.copy(a00+a0)
        a00 = copy.copy(a0)
        a0 = copy.copy(ak)
else:
    for i in range(n):
        ak = copy.copy(a00 + a0)
        a00 = copy.copy(a0)
        a0 = copy.copy(ak)
print(a0 % 1000000007)
k = int(input())
ans = k%2 == 0 ? (k/2)**2 : (k+1)/2 * ((k+1)/2 - 1)
print(ans)


### FIXED CODE ###

k = int(input())
ans = (k/2)**2 if k%2==0 else (k+1)/2 * ((k+1)/2 -1)
print(int(ans))
a,b,c = map(int, raw_input().split())
value = [a,b,c]
value.sort()
value_str = map(str, value)
print " ".join(value_str)

### FIXED CODE ###

a,b,c = map(int, raw_input().split())
value = [a,b,c]
value.sort()
value_str = map(str, value)
print " ".join(value_str)
import numpy as np

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

request_arr = np.zeros((M, N-1),dtype=np.int)

for i in range(M):
    a,b = map(int, input().split())
    request_arr[i][a-1:b-1] = 1




for counter in range(1,100000):
    max_index = np.argmax(request_arr.sum(axis=0))
    delete_raw = []
    for i in range(len(request_arr)):    
        if request_arr[i][max_index] == 1:
            delete_raw.append(i)
    request_arr = np.delete(request_arr,delete_raw,0)
    
    if len(request_arr) == 0:
        ans=counter
        break

print(ans)


### FIXED CODE ###

# Youtubeをみて作りましょう


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

request_list = []

for i in range(M):
    request_list.append(list(map(int,input().split())))
    
request_list.sort(key=lambda x: x[1])

ans = 0
f = False

while True:
    ans += 1
    end_point = request_list[0][1]
    for i in range(len(request_list)):
        if request_list[0][0] < end_point:
            del request_list[0]
            if len(request_list) == 0:
                f = True
                break
        else:
            break
            
            
    
    if f:
        break
    
print(ans)
N=int(input())
a=[]
for _ in range(N):
  a_=int(input())
  a.append(a_)
x=max(a)
if a.count(x)>=2:
  for i in range(N):
    print(x)
else:
  for i in range(N):
    if a[i]==x:
      print(a.sort(-2))
    else:print(x)

### FIXED CODE ###

N=int(input())
a=[]
b=[]
for _ in range(N):
  a_=int(input())
  a.append(a_)
  b.append(a_)
x=max(a)
b.sort()
if a.count(x)>=2:
  for i in range(N):
    print(x)
else:
  for i in range(N):
    if a[i]==x:
      print(b[-2])
    else:print(x)
k = int(input())
if k % 2 == 0:
    print((k//2) * (k//2))
else:
    print((k//2) * (k//2+1))


### FIXED CODE ###

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

flag = False
for c in range(1,4):
    if a*b*c % 2 == 1:
        flag = True

if flag:
    print('Yes')
else:
    print('No')
dish = [int(input()) for x in range(5)]
hitoketa = list(map(int, [str(x)[-1] for x in dish]))

last = 999
for i in hitoketa:
    if not i % 10 == 0:
        last = min(last, i)

last = dish[hitoketa.index(last)]
ans = last
skip = False
for i in dish:
    if i == last and not skip:
        skip = True
    elif i % 10 == 0:
        ans += i
    else:
        ans += (i // 10 + 1) * 10

print(ans)


### FIXED CODE ###

dish = [int(input()) for x in range(5)]
hitoketa = list(map(int, [str(x)[-1] for x in dish]))

last = 999
for i in hitoketa:
    if not i % 10 == 0:
        last = min(last, i)

if last != 999:
    last = dish[hitoketa.index(last)]
else:
    last = dish[0]

ans = last
skip = False

for i in dish:
    if i == last and not skip:
        skip = True
    elif i % 10 == 0:
        ans += i
    else:
        ans += (i // 10 + 1) * 10

print(ans)