peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N = int(input())
lists = []
AC = 0
TLE = 0
WA = 0
RE = 0
for i in range(N):
    S = str(input())
    lists.append(S)
for o in lists:
    if o == "AC":
        AC +=1
    elif o == "TLE":
        TLE +=1
    elif o == "WA":
        WA +=1
    elif o == "RE":
        RE +=1
print("AC X "+str(AC))
print("WA X "+str(WA))
print("TLE X "+str(TLE))
print("RE X "+str(RE))
# Judge status: Accepted
N = int(input())

ans = 0
for i in range(1 , N + 1):
  # 2,4,6,8,...
  last = N // i * i
  # i , last = n * i
  ans += (i + last) * (last // i) // 2

print(ans)
# Judge status: Accepted
H, W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
else:
    ans = H*W
    if ans % 2:
        print(ans//2+1)
    else:
        print(ans//2)
# Judge status: Accepted
def digitsum(N):
    return sum(map(int,list(str(N))))
N = int(input())
m = 100000
for A in range(1,N//2+1):
    B = N-A
    m = min(m,digitsum(A)+digitsum(B))
print(m)
# Judge status: Wrong Answer
s = input()

s_u, s_l = int(s[:2]), int(s[2:])
if s_u > 12 and 1 <= s_l <= 12:
    print('YYMM')
elif 1 <= s_u <= 12 and s_l > 12:
    print('MMYY')
elif 1 <= s_u <= 12 and 1 <= s_l <= 12:
    print('AMBIGUOUS')
else:
    print('NA')
# Judge status: Wrong Answer
#バッファ使わない
w,h,n = map(int,input().split())
cnt = 0
X = 0
Y = 0
while(cnt < n):
    x,y,a = map(int,input().split())
    
    if(a == 1):
        X = max(X,x)
    elif(a == 2):
        w = min(w,x)
    elif(a == 3):
        Y = max(Y,y)
    elif(a == 4):
        h = min(h,y)
    #print(w,h,X,Y)
    cnt += 1
print(abs(w-X)*abs(h-Y))
# Judge status: Wrong Answer
x = int(input())
k = 360 / x
out = None
for l in range(1, 181):
  if (k * l).is_integer():
    out = k * l
    break
print(out)
# Judge status: Wrong Answer
N,M = map(int,input().split())
jobs = []
for _ in range(N):
  jobs.append(list(map(int,input().split())))
jobs.sort(key= lambda x: (-x[1],-x[0]))

res = 0
j = 0
for d in range(M):
  while j<N:
    i,s = jobs[j]
    if d+i <= M:
      res += s
      break
    j += 1
  j += 1

print(res)
# Judge status: Wrong Answer
A=[int(input()) for _ in range(5)]
ans=0
for i in range(4):
  if A[i]%10==0:
    ans+=A[i]
  else:
    ans+=((A[i]//10)+1)*10
print(ans+A[-1])
# Judge status: Wrong Answer
N, M = map(int, input().split())
ans = [0] * N
for i in range(M):
  a, b = map(int, input().split())
  ans[a - 1] += 1
  ans[b - 1] += 1
for i in range(N):
  print(ans)
# Judge status: Accepted
sset=set(input())

for i in range(ord('a'),ord('z')+1):
  if not chr(i) in sset:
    print(chr(i))
    break
else:
  print("None")
# Judge status: Accepted
import math

line = input()
money = int(line)
happy = 0

calc_500 = math.floor(money / 500)

if calc_500 >= 1:
  happy += calc_500 * 1000
  money -= calc_500 * 500
  calc_5 = math.floor(money / 5)
  
  if calc_5 >= 1:
      happy += calc_5 * 5
      print(str(happy))
  else:
      print(str(happy))
else:
    calc_5 = math.floor(money / 5)
    if calc_5 >= 1:
      happy += calc_5 * 5
      print(str(happy))
    else:
      print(str(happy))
# Judge status: Accepted
a, b, c = map(int, input().split())

if a < c < b or b < c < a:
    ans = "Yes"
else:
    ans = "No"

print(ans)
# Judge status: Accepted
import sys

n = input()
x = list(map(int, input().split()))
#x = [i for i in range(2, 10**5)]

MAXA = 10**6

used = [False for i in range(MAXA + 5)]
result = 0
counts = {}
for a in x:
	if a in counts:
		counts[a] += 1
	else: 
		counts[a] = 1

for x in range(MAXA + 1):
	if not used[x]:
		if x in counts:
			count = counts[x]		
			if count == 1:
				result += 1

			y = 2*x
			while y <= MAXA:
				used[y] = True
				y += x

print(result)
# Judge status: Wrong Answer
n, k = map(int, input().split())
s = input()
t = s[k-1]
ans = s[:k-1] + t.lower() + s[k:]
# Judge status: Wrong Answer
l=[list(map(int,input().split())) for i in range(3)]
l=sum(l,[])
n=int(input())
li=set([input() for ini in range(n)])
d=[0 for i in range(9)]
for g in range(9):
  if l[g] in li:d[g]=1
if set([1]) in [set(d[h::3])for h in range(3)]+[set(d[h:h+3])for h in range(3)]+[set([d[0],d[4],d[8]]),set([d[2],d[4],d[6]])]:
  print("Yes")
else:print("No")
# Judge status: Wrong Answer
N = int(input())
T,A =map(int, input().split())
H = list(map(int, input().split()))
dif = [float(A-i) for i in [float(T-h*0.006) for h in H]]
dif_min = dif.index(min(dif))
print(dif_min+1)
# Judge status: Accepted
n = int(input())
mod = 10**9 + 7

per = [1] * (n+1)
for i in range(1, n+1):
  per[i] = per[i-1] * i
  per[i] %= mod

inv = [1] * (n+1)
inv[-1] = pow(per[-1], mod-2, mod)
for j in range(2, n+2):
  inv[-j] = inv[-j+1] * (n-j+2)
  inv[-j] %= mod

def C(n, k):
  cmb = per[n] * inv[k] * inv[n-k]
  cmb %= mod
  return cmb

total = 0
for k in range(1, n+1):
  if n < 3*k:
    break
  total += C(n-2*k-1, k-1)
  total %= mod

print(total)
# Judge status: Accepted
# ABC 159 B
s = input()
n = len(s)
l = s[:((n-1)//2)]
r = s[((n+3)//2) -1:]
if s == s[::-1] and l == l[::-1] and r == r[::-1]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a=int(input())
b=int(input())
abc=[1,2,3]
abc.remove(a)
abc.remove(b)
print(abc[0])
# Judge status: Accepted
X, Y = list(map(int, input().split()))

if X % Y == 0:
    ans = -1
else:
    for i in range(1, 10**18):
        t = X * i
        if t % Y != 0:
            ans = t
            break

print(ans)
# Judge status: Accepted
print('ABD' if int(input())//1000 else 'ABC')
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
for i in range(n):
  if l[i]%2==0:
    if l[i]%3!=0 and l[i]%5!=0:
      print('DENIED')
      break
  elif i==n-1:
    print('APPROVED')
# Judge status: Accepted
x,y=map(int,input().split())
for i in range(1,1000000):
    x*=2
    if x>y:
        print(i)
        exit()
# Judge status: Accepted
k,s = map(int,input().split())
cnt=0

for i in range(min(k,s)+1):
    for j in range(min(k,s-i)+1):
        if s-i-j<=k:
            cnt+=1
print(cnt)
# Judge status: Accepted
A, B = (int(x) for x in input().split())
if A <= 5:
  print(0)
elif A>= 13:
  print(B)
else:
  print(B//2)
# Judge status: Accepted
N = int(input())
for i in range(N,1000):
    if len(set(list(str(i)))) == 1:
        print(i)
        break
# Judge status: Accepted
a,b,c=map(int,input().split())
if  a+b+c>21:
    print("bust")
else:
    print("win")
# Judge status: Accepted
import collections
N = int(input())
lsA = list(map(int,input().split()))
counterA = collections.Counter(lsA)
ans = 0
for i in counterA.keys():
    if i == counterA[i]:
        continue
    if i < counterA[i]:
        ans += counterA[i]-i
    elif i > counterA[i]:
        ans += counterA[i]

print(ans)
# Judge status: Accepted
N,K=map(int,input().split())
K-=1
S=input()
S=S[:K]+S[K].lower()+S[K+1:]
print(S)
# Judge status: Accepted
x, A, B = map(int,input().split())
a = abs(x-A)
b = abs(x-B)

if a > b:
    print("B")
else:
    print("A")
# Judge status: Accepted
a,b,c=map(int,input().split())
print(c,a,b)
# Judge status: Accepted
from collections import Counter
s = Counter(list(input()))
t = Counter(list(input()))
s,t = list(s.values()),list(t.values())

print("Yes" if sorted(s) == sorted(t) else"No")
# Judge status: Accepted
N=int(input())
i=0
while pow(2, i+1)<=N:
  i+=1
print(pow(2, i))
# Judge status: Wrong Answer
s, t = input().split()
print(s+t)
# Judge status: Accepted
import sys
readline = sys.stdin.readline

N,K = map(int,readline().split())
A = [0] + list(map(int,readline().split()))

now = 1
while K > 0:
  if K & 1:
    now = A[now]
  A = [A[A[i]] for i in range(len(A))]
  K >>= 1

print(now)
# Judge status: Accepted
A, B = map(int, input().split())

if A <= 9 and B <= 9:
    print(A * B)
else:
    print(-1)
# Judge status: Accepted
def fact(n,mod):
    ret=1
    for i in range(2,n+1):
        ret=(ret*i)%mod
    return ret

def pCq(p,q,mod):
  pCq=1
  for i in range(q):
    pCq*=p-i
    pCq=pCq%mod
  den=fact(q,mod)
  inv=pow(den,mod-2,mod)
  pCq=(pCq*inv)%mod
  return pCq

X,Y=map(int,input().split())
MOD=10**9+7
ans=0
n,m=2*X-Y,2*Y-X
if n%3==0 and m%3==0:
  n//=3
  m//=3
  ans=pCq(m+n,max(m,n),MOD)
print(ans)
# Judge status: Accepted
n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i in range(1,n-1):
    num = [p[i-1],p[i],p[i+1]]
    if p[i] != min(num) and p[i] !=max(num):
        count += 1
print(count)
# Judge status: Accepted
A, B = map(int, input().split())
K = 0
L = (A + B) 
if L % 2 == 1:
    print("IMPOSSIBLE")
else:
    print(L // 2)
# Judge status: Accepted
n = int(input())
w = [input() for i in range(n)]
if len(w) != len(set(w)):
    print("No")
    exit()
for i in range(n-1):
    if w[i][-1] != w[i+1][0]:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
from collections import deque
from bisect import bisect_left
N = int(input())
A = list(map(int, input().split( )))
B = list(map(int, input().split( )))
cnt = 0
for i in range(N):
  if A[i] >= B[i]:
    cnt += B[i]
  else:
    cnt += A[i]
    d = B[i] - A[i]
    if d <= A[i+1]:
      cnt += d
      A[i+1] -= d
    else:#つまり d > A[i+1]
      cnt += A[i+1]
      A[i+1] = 0
#  print('i=', i, cnt)

print(cnt)
# Judge status: Accepted
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))
for i in range(2):
    if c[i+1][0]-c[i][0]==c[i+1][1]-c[i][1] and c[i+1][1]-c[i][1]==c[i+1][2]-c[i][2] and c[0][i+1]-c[0][i]==c[1][i+1]-c[1][i] and c[1][i+1]-c[1][i]==c[2][i+1]-c[2][i]:
        flg=0
    else:
        flg=1
if flg==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
w=list(map(int,input().split()))

ans=10**9+7
for i in range(n):
    l=sum(w[:i])
    r=sum(w[i:])
    ans=min(ans,abs(l-r))
print(ans)
# Judge status: Accepted
n,ans,i = int(input()),0,1
while ans<n:
    ans+=i
    i+=1
#print("{},{}".format(ans,i))
if ans==n:
    for j in range(i-1):
        print(j+1)
else:
    i-=1
    while i>=1:
        if n==0:
            break
        if n>=i:
            print(i)
            n-=i
        i-=1
# Judge status: Accepted
n,l = map(int,input().split())
taste_all = 0
taste_remain = 0
taste_ans = 0
taste_select = 1000000

for i in range(n):
    taste_all += l + i

for i in range(n):
    for j in range(n):
        if i != j:
            taste_remain += l + j
    temp = abs(taste_remain-taste_all)
    if temp < taste_select:
        taste_ans = taste_remain
        taste_select = temp
    taste_remain = 0

print(taste_ans)
# Judge status: Accepted
n, a, b = [int(i) for i in input().split()]

count = 0

for number in range(n+1):
  string = str(number)
  total = sum([int(i) for i in string])
  if a <= total <= b:
    count += number
print(count)
# Judge status: Accepted
n, l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
print(''.join(s))
# Judge status: Wrong Answer
x,y=map(int,input().split())
if x>y:
  x,y=y,x
 
A=[1,3,5,7,8,10,12]
B=[4,6,9,11]
 
if x==2 or y==2:
  print('No')
elif (x in A and y in B):
  print('No')
else:
  print('Yes')
# Judge status: Wrong Answer
n=int(input())
a=(int(i) for i in input().split())
b=0
for i in a:b^=i
print(*(i^b for i in a))
# Judge status: Accepted

a, b, m = map(int, input().split())
a = list(map(int , input().split()))
b = list(map(int , input().split()))
xyc = [tuple(map(int, input().split())) for _ in range(m)]

amin = min(a)
bmin = min(b)
ans = amin + bmin
for x, y, c in xyc:
    ans = min(a[x-1] + b[y-1] - c, ans)
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Wed Sep  9 19:58:50 2020

@author: liang
"""
"""
【三角形の面積の公式】
S = 1/2 * a * b
"""
import math
a, b, x = map(int, input().split())
L = math.sqrt((x/a/b)**2 + b**2)
if x >= a**2*b/2:
    ans = math.degrees(math.atan((b-x/a**2)/a*2))
else:
    ans = math.degrees(math.atan((a*b**2)/x/2))
    #ans = math.degrees(math.asin(b/L))
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)]

li = []
for i in A:
  li.append(i)
for i in range(3):
  li.append([A[0][i], A[1][i], A[2][i]])
li.append([A[0][0], A[1][1], A[2][2]])
li.append([A[0][2], A[1][1], A[2][0]])

for i, j, k in li:
  if i in B and j in B and k in B:
    print("Yes")
    exit()
print("No")
# Judge status: Wrong Answer
A, B, C, X, Y = map(int, input().split())

if A*X + B*Y > 2*C*max(X, Y):
    print(2*C*max(X, Y))

elif A + B > 2 * C:
    C_num = min(X, Y)
    if X > Y:
        print(C_num*2*C + A*(X-C_num))
    else:
        print(C_num*2*C + B*(Y-C_num))
        
else:
    print(A*X + B*Y)
# Judge status: Accepted
n=int(input())
s=[input() for i in range(n)]
l=[0]*26
moji=[]
for i in range(26):
  mini=len(s[0])
  for j in range(n):
    if s[j].count(chr(97+i))<mini:
      mini=s[j].count(chr(97+i))
  l[i]+=mini
for i in range(26):
  for j in range(l[i]):
    moji.append(chr(97+i))
print("".join(moji))
# Judge status: Accepted
n = int(input())
s = input()
ans = 0
for i in range(1, n):
    tmp = 0
    dic = {}
    sl = list(set(s[:i]))
    sr = list(set(s[i:]))
    # print(sl, sr)

    for c in sl:
        if c not in dic:
            dic[c] = 0

    for c in sr:
        if c in dic:
            tmp += 1
    ans = max(ans, tmp)
print(ans)
# Judge status: Accepted
S = input()
a = sum([c=='a' for c in S])
b = sum([c=='b' for c in S])
c = [a,b,len(S)-a-b]
print('YES' if max(c)-min(c)<2 else 'NO')
# Judge status: Wrong Answer

n = raw_input()
mat =[ map(int,raw_input().split()) for i in range(2)]
def f(mat,i,j):
  if i<0 or j <0:
    return -float('inf')
  return mat[i][j] + max(f(mat,i-1,j),f(mat,i,j-1))
print f(mat,1,len(mat[0])-1)
# Judge status: Accepted
s = input()
flag = 1
for i in range(100):
        for j in range(100):
                if s[:j] + s[j+i:]=="keyence":
                        flag = 0
print("YNEOS"[flag::2])
# Judge status: Wrong Answer
X = int(input())
now = 0
i = 0
while True:
    i += 1
    if i == X - now:
        now += i
    elif i * 2 < X - now:
        now += i
    if now == X:
        print(i)
        break
# Judge status: Accepted
from collections import deque

S = deque(input())

Q = int(input())

c = False
for i in range(Q):
  *T, = map(str,input().split())
  if len(T) == 1:
    c = not c  
  elif (int(T[1]) == 1 and not c) or (int(T[1]) == 2 and c):
    S.appendleft(T[2])
  else:
    S.append(T[2])

print("".join(S) if not c else "".join(list(reversed(S))))
# Judge status: Accepted
n,c,k = map(int,input().split())
t_input = [int(input()) for i in range(n)]

t_s = sorted(t_input)

ans = 1
c_limit = 1
t_limit = t_s[0]+k
for i in range(1,n):
    t = t_s[i]
    #乗客が前の客の時間制限より大きいか、すでにバスが定員以上なら
    if t>t_limit or c_limit>=c:
        ans+=1
        c_limit=1
        t_limit = t+k
    else:
        c_limit+=1
print(ans)
# Judge status: Accepted
import sys
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
for i in range(n):
    h[i] = abs(a-(t - h[i]*0.006))
minh = min(h)
for i in range(n):
    if h[i] == minh:
        print(i+1)
        sys.exit()
# Judge status: Accepted
s = int(input())
a = []
i = 0
while True:
    if i == 0:
        a.append(s)
    elif a[i-1] % 2 == 0:
        a.append(a[i-1] / 2)
    else:
        a.append(a[i-1] * 3 + 1)
    if a[i] in a[:i]:
        print(i + 1)
        break
    i += 1
# Judge status: Accepted
n = int(input())
List = [list(map(int,input().split())) for i in range(n)]

dp = [[0, 0, 0] for _ in range(n+1)]
dp[0] = [List[0][0], List[0][1], List[0][2]]

for i in range(1, n):
    for j in range(3):
        for k in range(3):
            if j != k: dp[i][j] = max(dp[i][j], dp[i-1][k]+List[i][j])

print(max(dp[n-1]))
# Judge status: Accepted
N, K = map(int, input().split())

bucket = [0] * (10 ** 5 + 1)
for _ in range(N):
    a, b = map(int, input().split())
    bucket[a] += b

cnt = 0
for i, c in enumerate(bucket):
    if c == 0:
        continue
    cnt += c
    if cnt >= K:
        print(i)
        exit()
# Judge status: Wrong Answer
text = input()
if text == "AAA" or text == "BBB":
    print("NO")
else:
    print("YES")
# Judge status: Wrong Answer
import math
a, b = map(float,input().split())
ans = int(a * (100*b))
print(math.floor(ans/100))
# Judge status: Accepted
import sys
import math

class cin():
    def getInt():
        return int(sys.stdin.readline().rstrip())
    def getString():
        return sys.stdin.readline().rstrip()

N = cin.getInt()
A = [list(map(int,cin.getString().split())) for i in range(N - 1)]

for i in range(N):
    t = 0
    for j in range(i,N - 1):
        if t <= A[j][1]:
            t = A[j][1] + A[j][0]
        else:
            t = -(-t // A[j][2]) * A[j][2] + A[j][0]
    print(t)
# Judge status: Accepted
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
arui = [0] * (N + 1)
brui = [0] * (M + 1)
for i in range(N):
    arui[i + 1] = a[i] + arui[i]
for i in range(M):
    brui[i + 1] = b[i] + brui[i]


ans, j = 0, M
for i in range(N + 1):
    if arui[i] > K:
        break
    while brui[j] > K - arui[i]:
        j -= 1
    ans = max(ans, i + j)

print(ans)
# Judge status: Accepted
h=int(input())
w=int(input())
n=int(input())
a=0
ans=0
paint=max(h,w)
while a<n:
    a+=paint
    ans+=1
print(ans)
# Judge status: Accepted
s=input()
res="AC"
if s[0]!="A":res="WA"
elif s[2:-1].count("C")!=1:res="WA"
else:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)
# Judge status: Accepted
N,A,B=map(int,input().split())
t=N//(A+B)
if N%(A+B)==0:
  print(t*A)
else:
  if N%(A+B)<=A:
    print(t*A+N%(A+B))
  else:
    print(t*A+A)
# Judge status: Accepted
import sys
input=sys.stdin.buffer.readline
a,b,c,k=map(int,input().split())
if k % 2 ==0:
    print(a-b)
else:print(-a+b)
# Judge status: Accepted
s = input()
t = input()

cnt = 0

for i in range(len(s) - len(t)+1):
    tmp = 0
    for j in range(len(t)):
        if s[i+j] == t[j]:
            tmp += 1
    
    if cnt < tmp:
        cnt = tmp

print(len(t)-cnt)
# Judge status: Accepted
N,M=map(int,input().split())
H=list(map(int,input().split()))
Graph=[[] for i in range(N)]
isGood = [1]*N
for i in range(M):
  a,b=map(int,input().split())
  Graph[a-1].append(b)
  Graph[b-1].append(a)
# print(Graph)
for i in range(N):
  for j in Graph[i]:
    if H[i]<=H[j-1]:
      isGood[i]=0
# print(H)
print(sum(isGood))
# Judge status: Wrong Answer
N = int(input())
S = list(input())

upper = [chr(i) for i in range(65, 65+26)]
new_upper = []

for i in S:
    Index = upper.index(i) + N
    if Index >= 26:
        Index =- 26
        new_upper.append(upper[Index])
    else:
        new_upper.append(upper[Index])
        
print(''.join(new_upper))
# Judge status: Wrong Answer
N,K = map(int,input().split(" "))
print(N%K)
# Judge status: Accepted
S1 = list(input())
S2 = list(input())
S1.append(S2[-1])
if S1==S2:
    print("Yes")
else: print("No")
# Judge status: Accepted
s=input()
l=set([])
for i in s:
    l.add(i)
if l==set(['a','b','c']):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
#172D
#Sum of Divisors

n=int(input())
ans=0

for i in range(1,n+1):
    j=n//i
    ans+=j*(j+1)*i/2
print(int(ans))
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

while min(a) < n and k > 0:
  mark = [0] * (n + 1)
  for i in range(n):
    mark[max([0, i - a[i]])] += 1
    mark[min([n, i + a[i] + 1])] -= 1
  a = [mark[0]]
  for i in range(1, n):
    a.append(a[-1] + mark[i])
  k -= 1

print(' '.join(map(str, a)))
# Judge status: Accepted
n = int(input())

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


# a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


# a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)


ans = al[0]

for a in al:
    ans = gcd(a, ans)

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

A = sorted(A)[::-1]

print(sum(A[::2]) - sum(A[1::2]))
# Judge status: Accepted
n = int(input())
c = []
s = []
f = []
for _ in range(n-1):
    p,q,r = map(int,input().split())
    c.append(p)
    s.append(q)
    f.append(r)
a = [0]*n
for i in range(n-1):
    t = 0
    for j in range(i, n-1):
        if t <= s[j]:
            t = s[j]
        elif t%f[j] != 0:
            t += f[j]-t%f[j]
        t += c[j]
    a[i] = t
print('\n'.join(map(str, a)))
# Judge status: Accepted
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    x=int(readline())

    n=x//11
    m=x%11
    if m==0: print(2*n)
    elif 1<=m<=6: print(2*n+1)
    else: print(2*n+2)

if __name__=="__main__":
    main()
# Judge status: Accepted
X = int(input())
a = 100
ans = 0
while a < X:
	ans += 1
	a = int(a * 1.01)
print(ans)
# Judge status: Wrong Answer
O = input()
E = input()

K = len(E)

String = ""

for i in range(K):
    
    String += O[i]
    String += E[i]

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

if a>=k:
    print(a-k, b)
elif b>=k-a:
    print(0, b-k+a)
else:
    print(0, 0)
# Judge status: Accepted
x,y=map(int,input().split())
ans=[x]
while True:
    tmp=ans[-1]*2
    if tmp<=y:
        ans.append(tmp)
    else:
        break
print(len(ans))
# Judge status: Accepted
n, m, k = map(int, input().split())
for i in range(n + 1):
    for j in range(m + 1):
        if i * m + j * n - 2 * i * j == k:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
N = int(input())
p = list(map(int, input().split()))
isMatch = list(map(lambda x, y: x == y, p, sorted(p)))
result = 'YES' if isMatch.count(False) <= 2 else 'NO'
print(result)
# Judge status: Accepted
import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  c_list = c_list.tolist()
  print(a_list[c_list.index(0)])
# Judge status: Accepted
def main():
    x, k, d = map(int, input().split())
    if x >=0 and abs(x) >= k *d:
        print(x - k*d)
    elif x < 0 and abs(x) >= k *d:
        print(abs(x) - k*d)
    else:
        x = abs(x)
        t = x // d
        k -= t
        x -= t*d
        print(abs(x - (k%2)*d))

    
if __name__ == '__main__':
    main()
# Judge status: Accepted
n = input()
b = 0
for i in range(3):
  if n[i] == "1":
    b += 1
print(b)
# Judge status: Wrong Answer
N,M = map(int,input().split())
if(min(N,M)==1):
    print(max(max(N,M)-2,0))
else:
    print(max(N-2,0)*max(M-2,0))
# Judge status: Wrong Answer
n=int(input())
l_b=2
l=1
if n==1:
  print("2")
elif n==2:
  print("1")
else:
  for i in range(3,n+1):
    l_bb=l_b
    l_b=l
    l=l_b+l_bb
  print(l)
# Judge status: Accepted
x = int(input())
dp = [0]*(x + 105 + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x-105+50):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

def obj_func(v, base):
  return abs(v - base)

ai = aj = max(A)
base = ai / 2
min_obj = 10**10
for a in A:
  if a == ai:
    continue
  obj = obj_func(a, base)
  if obj < min_obj:
    min_obj = obj
    aj = a

print(ai, aj)
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
count = Counter(A)
keys = list(count.keys())
keys.sort(reverse = True)
a = 0
b = 0
for k in keys:
    if count[k] >= 4:
        a = b = k
        break
    elif count[k] >= 2:
        if a == 0:
            a = k
        else:
            b = k
            break
print(a * b)
# Judge status: Wrong Answer
import math
import numpy as np
A,B = list(map(int,input().split()))
if A == 0 or B == 0:
  print('0')
  exit()
C = A*B
D = []
for i in range(1,int(math.sqrt(C))):
  if A % i == 0 and B % i == 0:
    A = A // i
    B = B // i
    D.append(i)
    C = A*B
p = np.prod(D)
if p != 0:
  C = C*p
print(C)
# Judge status: Wrong Answer
a,b=map(int, input().split())
if a==2 or b==2:
  print('No')
elif (a-4)*(a-6)*(a-9)*(a-12)==0 and (b-4)*(b-6)*(b-9)*(b-12)==0:
  print('Yes')
elif (a-1)*(a-3)*(a-5)*(a-7)*(a-8)*(a-12)==0 and (b-1)*(b-3)*(b-5)*(b-7)*(b-8)*(b-12)==0:
  print('Yes')
else:
  print('No')