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

def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    # スコアの累積和
    l = list(itertools.accumulate(A))

    score = sum(A[:M])
    for i in range(1, N-M):
        score = max(score, l[i+M] - l[i])
        
    ans = (M + score) / 2

    return ans

print(solve())
# Judge status: Accepted
n = int(input())
arr = list(map(int, input().split()))
r = 0
cols = [0] * 8
for i in arr:
  color = i // 400
  if color <= 7:
    cols[color] = 1
  else:
    r += 1
c = sum(cols)
print(max(1, c), r+c)
# Judge status: Wrong Answer
import math
n = int(input())
if n == 0:
    print(0)
if n == 1:
    print(0)
else:
    if n % 2 ==1:
        print(0)
    else:
        ans = 0
        l = 5
        while n>=l:
            ans += n//(l*2)
            l *= 5
        print(ans)
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

    print(b//x - (a-1)//x)

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

if n == 100:
    ans = (100**d)*(n+1)
else:
    ans = (100**d)*n
print(ans)
# Judge status: Accepted

#イコールは＝＝とすることVBA特別する

s = input()

if s == "ABC":
    print("ARC")
else:
    print("ABC")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

ans = 1
up = dn = False
for a,b in zip(A,A[1:]):
    if a < b:
        if up: continue
        up = True
        if dn:
            ans += 1
            up = dn = False
    elif a > b:
        if dn: continue
        dn = True
        if up:
            ans += 1
            up = dn = False
print(ans)
# Judge status: Accepted
N = int(input())

if N >= 1999: # 不等号は=の手前に
    print('The contest has not been held')

elif N < 1000:
    print('ABC')

elif N >= 1000:
    print('ABD')
# Judge status: Accepted
import math

def main():
    n=int(input())
    print(math.ceil(n/2)/n)
                
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n,k,*h=map(int,open(0).read().split())
print(sum(sorted(h)[:min(n,n-k)]))
# Judge status: Accepted
N, M = map(int, input().split())
counter = [0]*N
for _ in range(M):
    a, b = map(int, input().split())
    counter[a-1] += 1
    counter[b-1] += 1

for c in counter:
    print(c)
# Judge status: Wrong Answer
def main():
    N = int(input())
    x_line = list(map(int, input().split(' ')))
    max_x = max(x_line)
    min_x = min(x_line)
    result = 10000
    for i in range(min_x, max_x + 1):
        hash_result = 0
        for x in x_line:
            hash_result += (x - i) ** 2
        if hash_result < result:
            result = hash_result
    print(result)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np
S = list('abcdabc')#input())
print(float(np.sum([1 for a, b in zip(S[:int(np.floor(len(S)/2))], list(reversed(S[int(np.ceil(len(S)/2)):]))) if not a == b])))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n,m=map(int,input().split())
    X=[int(_) for _ in input().split()]
    if m<=n:
        print(0)
    else:
        X.sort()
        XX=[0]*(m-1)
        for i in range(m-1):
            XX[i]=X[i+1]-X[i]
        XX.sort(reverse=True)
        print(X[-1]-X[0]-sum(XX[:n-1]))

if __name__=='__main__':
    main()
# Judge status: Accepted
s = int(input())
a = [0]*(s+5)
a[0] = 1
mod = 10**9 + 7
for i in range(3 , s+1):
    if i < 3 :
        continue

    a[i] = (a[i-1] + a[i-3]) % mod

print(a[s])
# Judge status: Accepted
n, k = map(int, input().split())
ans = 0
for i in range(1, n+1):
    x = 1/n
    while i<k:
        i *= 2
        x /= 2
    ans += x
print(ans)
# Judge status: Accepted
import queue
k = int(input())
q = queue.Queue()
for i in range(1,10):
    q.put(i)
for i in range(k):
    x = q.get()

    if x%10 != 0:
        q.put(10*x+x%10-1)
    q.put(10*x+x%10)
    if x%10 != 9:
        q.put(10*x+x%10+1)
print(x)
# Judge status: Wrong Answer
N=int(input())

if N<=999:
  print("ABC"+str(N))
else:
  print("ABD"+str(N-1000+1))
# Judge status: Accepted
n, m = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(m)]

next_node = [[] for _ in range(n)]
for a, b in edge:
    next_node[a-1].append(b)
    next_node[b-1].append(a)

q = [1]
visit = [1]  + [0] * (n-1)
prev = [0] * n
while q:
    now = q.pop(0)
    for i in next_node[now-1]:
        if visit[i-1] == 0:
            q.append(i)
            visit[i-1] = 1
            prev[i-1] = now
print('Yes')
print(*prev[1:], sep='\n')
# Judge status: Accepted
import math

N = int(input())
ans = math.factorial(N) % (10**9 + 7)
print(ans)
# Judge status: Wrong Answer
import math
def main():
  A, B = map(int, input().split())
  
  #Nは最大でも１２５０
  
  for n in range(1, 2000):
    if math.floor(n * 0.08) == A and math.floor(n * 0.1) == B:
      print(n)
      return
  print(-1)
  
  print(math.floor(25 * 0.08))
  print(math.floor(25 * 0.1))
    
  
main()
# Judge status: Wrong Answer
import sys
S = input()
T = input()
s = len(S)
t = len(T)
if s < t:
    print('UNRESTORABLE')

for i in range(s - t, -1, -1):
    OK = True
    for j in range(t):
        if S[i + j] != T[j] and S[i + j] != '?':
            OK = False
    if OK:
        for j in range(t):
            SS = S[:i] + T + S[i + j + 1:]
            SS = SS.replace('?', 'a')
        print(SS)
        sys.exit()

print('UNRESTORABLE')
# Judge status: Accepted
n = int(input())

def normal_form(x):
    if x == 1:
        return ['a']
    temp = normal_form(x-1)
    res = []
    for s in temp:
        for k in range(ord(max(s))-97+2):
            res.append(s+chr(k+97))
    return res

print('\n'.join(normal_form(n)))
# Judge status: Accepted
import math
N, D = map(int, input().split())
 
# 前から最適に配置せよ
# 一人目は, 1,...,D, D+1, D+2,...,2D+1 を監視
# 二人目は, 2D+2,..., 3D+2, ...,4D+2 を監視
# x人まで繰り返すと、1,...,x(2D+1)まで監視できる
 
# x(2D+1) > N を満たす最小のxは？
# x_min = ceil(N/(2D+1))
 
print(math.ceil(N/(2*D+1)))
# Judge status: Accepted
def answer(a: int, b: int, c: int, d: int) -> int:
    return len(set(range(a, b)) & set(range(c, d)))


def main():
    a, b, c, d = map(int, input().split())
    print(answer(a, b, c, d))


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b=map(int,input().split())

if (a+b)%2==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
N = int(input())
dp = [1000000] * (N + 1)
dp[0] = 0
for i in range(1, N + 1):
    dp[i] = dp[i - 1] + 1
    x = 6
    while i - x >= 0:
        dp[i] = min(dp[i], dp[i - x] + 1)
        x *= 6
    x = 9
    while i - x >= 0:
        dp[i] = min(dp[i], dp[i - x] + 1)
        x *= 9

print(dp[N])
# Judge status: Accepted
k, x = map(int, input().split())
num = [x]

for i in range(1, k):
  num.append(x + i)
  num.append(x * 2 - (x + i))

print(' '.join(map(str, sorted(num))))
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S, T = readline().strip().split()
    print(T + S)

    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
readline = sys.stdin.readline
a, b, m = map(int, readline().split())
a = list(map(int, readline().split()))
b = list(map(int, readline().split()))
xyc = [list(map(int, readline().split())) for _ in range(m)]

ans = min(a) + min(b)
for x, y, c in xyc:
    price = a[x-1] + b[y-1] - c
    if price < ans:
        ans = price
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
if A <= 12:
    B //= 2
if A < 6:
    B = 0
print(B)
# Judge status: Accepted
def resolve():
	w = ['dream', 'dreamer', 'erase', 'eraser']
	for i in range(len(w)):
		w[i] = w[i][::-1]
	s = input()[::-1]
	t = ''
	for i in s:
		t += i
		if t in w:
			t = ''
	if len(t):
		print("NO")
	else:
		print("YES")
resolve()
# Judge status: Accepted
N = int(input())
n=0
ans = 0
ans2 =0
for i in range(1,N+1):
    n=i
    res = 0
    while n % 2 ==0:
        n=n//2
        res = res + 1
        if ans < res:
            ans = res
            ans2 =i
if ans2==0:
	print(1)
else:
	print(ans2)
# Judge status: Accepted
N = int(input())
X_list = list(map(int, input().split()))
tmp = X_list.copy()

tmp.sort()
a = tmp[int(N/2)-1]
b = tmp[int(N/2)]
for i in range(N):
    if(X_list[i] <= a):
        print(b)
    else:
        print(a)
# Judge status: Wrong Answer
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
print(sum(H[:N-K]))
# Judge status: Wrong Answer
n, m = map(int, input().split())
 
a = []
 
for i in range(m):
  a1, a2 = map(int, input().split())
  a.append(a1)
  a.append(a2)
 
for s in range(n):
  print(a.count(s))
# Judge status: Accepted
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))

A_cs = A.cumsum()
A_cs = A_cs - A_cs[-1]/2
div = np.abs(A_cs).argmin()

print(abs(A[:div+1].sum() - A[div+1:].sum()))
# Judge status: Accepted
# A - Candy Distribution Again
N,x = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
ans = 0
for a in A:
    x -= a
    if x<0 or (ans==N-1 and x!=0):
        break
    ans += 1
print(ans)
# Judge status: Accepted
import fractions


def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    mul = a[0]
    for i in range(1, n):
        mul = mul * a[i] // fractions.gcd(mul, a[i])
    for i in a:
        if mul // i % 2 == 0:
            print(0)
            exit()
    if m >= mul // 2:
        ans = (m - mul // 2) // mul + 1
        print(int(ans))
    else:
        print(0)


if __name__ == '__main__':
    main()
# Judge status: Accepted
#print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
from collections import Counter
def resolve():
    w=input()
    a=Counter(w)
    for j in a.values():
        if j%2:print("No");return
    print("Yes")
#%%submit!    
resolve()
# Judge status: Accepted
N, A, B = map(int, input().split())
S = input()

import sys

T = A + B
Ta = B

for p in S:
  if p == "c":
    print("No")
    continue
    
  elif p == "a":
    if T > 0:
      print("Yes")
      T -= 1
    else:
      print("No")
      
  else:
    if T > 0 and Ta > 0:
      print("Yes")
      Ta -= 1
      T -= 1
    else:
      print("No")
# Judge status: Wrong Answer
S,T = input(),input()
num = len(T)
ans = num
for i in range(num):
    for j in range(i+1,num+1):
        str = T[i:j]
        if str in S[i:-(num-j)]:
            ans = min(ans,num - len((T[i:j])))
        # print(i,j,ans,T[i:j])

print(ans)
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
b=sum(i<0 for i in a)%2
a=list(map(abs,a))
print(sum(a)-min(a)*2*b)
# Judge status: Accepted
#ABC116

s = int(input())

l = [s]
for i in range(1000000):
    if l[-1] % 2 == 0:
        if l[-1] // 2 in l:
            print(len(l) + 1)
            break
        l.append(l[-1] // 2)
    else:
        if 3 * l[-1] + 1 in l:
            print(len(l)+1)
            break
        l.append(3 * l[-1] + 1)
# Judge status: Accepted
import sys
import math
A,B=map(int,input().split())
for i in range(1,10001):
    if int(i*0.08)==A:
        if int(i*0.1)==B:
            print(i)
            sys.exit()
print(-1)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,m=map(int, input().split())
    if n==1:
        ans=max(0,m-2)
    elif m==1:
        ans=max(0,n-2)
    else:
        ans=(n-2)*(m-2)
    print(ans)
resolve()
# Judge status: Accepted
l=input().split()
print(list(l[0])[0]+list(l[1])[0]+list(l[2])[0])
# Judge status: Accepted
s = list(input())
t = list(input())

min = len(t)

for i in range(len(s) - len(t) + 1):
    
    diff = 0
    
    for j in range(len(t)):
        if t[j] != s[i + j]:
            diff += 1
    
    if diff < min:
        min = diff
    
    
print(min)
# Judge status: Accepted
#!/usr/bin/env python3
import math
a,b,c = map(int,input().split())
# a + b + 2r(ab) < c
# a + b - c < -2r(ab)
# c - a - b > 2r(ab)
# (c - a - b)**2 > 4ab
if c - a - b > 0 and (c - a - b)**2 > 4*a*b:
    print("Yes")
    exit()
print("No")
# Judge status: Accepted
s=[]
yoko=[]
ans="Yes"
for i in range(3):
  a, b, c=map(int, input().split())
  s.append([a,b,c])
  yoko.append([a-b, b-c, c-a])
if yoko[0]!=yoko[1] or yoko[1]!=yoko[2]:
  ans="No"
tate=[]
for i in range(3):
  tate.append([s[i][0]-s[i][1], s[i][1]-s[i][2], s[i][2]-s[i][0]])
if tate[0]!=tate[1] or tate[1]!=tate[2]:
  ans="No"
print(ans)
# Judge status: Accepted
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
Sx,Sy,Tx,Ty = map(int,input().split())

dx = Tx - Sx
dy = Ty - Sy
 
ans1 = "U"*dy + "R"*dx
ans2 = "D"*dy + "L"*dx
ans3 = "L" + "U"*(dy+1) + "R"*(dx+1) + "D"
ans4 = "R" + "D"*(dy+1) + "L"*(dx+1) + "U"
 
print(ans1 + ans2 + ans3 + ans4)
# Judge status: Wrong Answer
# from math import 

s = input()
t = input()

def distance(s, t):
    assert(len(s) == len(t))
    return len(s) - sum([c1 == c2 for c1, c2 in zip(s, t)])


min_d = len(s)

for i in range(len(s) - len(t)):
    min_d = min(min_d, distance(s[i:i+len(t)], t))

print(min_d)
# Judge status: Accepted
#入力値の格納
a1,a2,a3 = map(int, input().split())

#判別
if a1 + a2 + a3 <= 21:
    text = "win"
else:
    text = "bust"

#表示
print(text)
# Judge status: Accepted
cube = list(map(int, input().split()))
cube.sort()
if any([i % 2 == 0 for i in cube]):
    print(0)
else:
    print(cube[0] * cube[1])
# Judge status: Accepted
A, B, T = map(int, input().split())

cnt = 0
while T >= A:
  cnt += B
  T -= A
print(cnt)
# Judge status: Wrong Answer
s, t = map(str, input().split())
print(s+t)
# Judge status: Wrong Answer
temp = set(input())

judgment1 = 'A' in temp
judgment2 = 'B' in temp

if judgment1 == True:
    if judgment2 == True:
        print("Yes")
else:
    print('No')
# Judge status: Accepted
n=int(input())
ans=""
while n!=0:
  if (n%2)!=0:
    n-=1
    ans="1"+ans
  else:
    ans="0"+ans
  n/=-2
if ans=="":
  ans="0"
print(ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = Counter([int(input()) for i in range(n)])
print(sum([v%2 == 1 for v in a.values()]))
# Judge status: Accepted
N = int(input())
if N % 2 == 1:
	print(0)
else:
	ans = 0
	for i in range(1, 26):
		ans += N // (5 ** i) // 2
	print(ans)
# Judge status: Accepted
import sys

n = int(input())
work = [list(map(int, input().split())) for i in range(n)]
work = sorted(work, key=lambda x:x[1])

sum = 0

for i in range(n):
  sum += work[i][0]
  if sum > work[i][1]:
      print('No')
      sys.exit()

print('Yes')
# Judge status: Accepted
n = int(input())
a = []
for i in range(2):
    aa = list(map(int, input().split()))
    a.append(aa)

ans = 0
for i in range(n):
    ans = max(ans, sum(a[0][:i+1])+sum(a[1][i:n]))

print(ans)
# Judge status: Wrong Answer
from collections import defaultdict

data = defaultdict()
for i in range(3):
    s = input()
    data[chr(ord("a") + i)] = s

cnt = [0] * 3
cnt[0] = 1
turn = "a"
while 1:
    if cnt[ord(turn) - ord("a")] == len(data[chr(ord(turn))]):
        ans = ord(turn) - (ord("a") - ord("A"))
        break

    turn = data[chr(ord(turn))][cnt[ord(turn) - ord("a")]]
    cnt[ord(turn) - ord("a")] += 1
print(chr(ans))
# Judge status: Wrong Answer
M = input()
print("A" if M.islower else "a")
# Judge status: Accepted
A, B, C, D = list(map(int, input().split()))
c1 = (A - 1) // C
c2 = B // C
d1 = (A - 1) // D
d2 = B //D
import math
E = (C * D) // math.gcd(C, D)
e1 = (A - 1) // E
e2 = B //E

print(B - A + 1 -(c2 - c1 + d2 - d1 - (e2 - e1)))
# Judge status: Wrong Answer
N = int(input())
a = [int(x) for x in input().split()]
is_2 = len(list(filter(lambda x : x == 2, a)))
multiple_of_4 = len(list(filter(lambda x : x % 4 == 0, a)))
not_4 = N - multiple_of_4

if is_2 + multiple_of_4 == N:
  print('Yes')
else:
  print('Yes' if 2 * multiple_of_4 >= not_4 else 'No')
# Judge status: Wrong Answer
c = input()

if c == "a" or c == "e" or c == "i" or c == "o" or c == "o":
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
def f(n):
    if n%2 == 0:
        return n//2
    return 3*n+1

s = int(input())
ans = 1
used = set()
while True:
    if s in used:
        break

    used.add(s)
    ans += 1
    s = f(s)
print(ans)
# Judge status: Accepted
x  = int(input())
if x % 11 == 0:
    print((x//11) * 2)
elif x % 11 <= 6:
    print((x//11) * 2 + 1)
else:
    print((x//11) * 2+2)
# Judge status: Accepted
n = int(input())
card_list = list(map(int,input().split(" ")))

card_list_ex = sorted(card_list, reverse=True)


alice,bob = 0,0
for i,j in enumerate(card_list_ex):
    if i % 2 == 0:
        alice += j
    else:
        bob += j
res = alice - bob
print(res)
# Judge status: Wrong Answer
a=int(input())
b=int()
if a>=3200:
  print("red")
else:
  print(b)
# Judge status: Accepted
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[i])
# Judge status: Accepted
a = input()
dic = {}
for i in a:
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1
for i in dic:
    if dic[i] % 2 != 0:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
h, n = map(int, input().split())
a = list(map(int, input().split()))

sm = 0

for tmp in a:
    sm+=tmp

if sm >=h:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,y=map(int,input().split())
ans=[]
flag=False
for i in range(0,n):
  for j in range(0,n):
    if (9000*i+4000*j)==(y-1000*n) and n>=(i+j):
      ans=[i,j,n-i-j]
      flag=True
      break
if flag:
  print(*ans)
else:
  print(-1,-1,-1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = sorted([A[i]-(i+1) for i in range(N)])
b = B[N//2]
print(sum([abs(B[i]-b) for i in range(N)]))
# Judge status: Wrong Answer
X = int(input())

yen = 100
ret = 0
while yen<X:
  yen = 101*yen/100
  ret += 1
print(ret)
# Judge status: Wrong Answer
N=int(input())
A=[int(x) for x in input().split()]
num={i:0 for i in range(N)}
for i in A:
    num[i-1]+=1
def set(k):
    if k >= 2:
        return (k)*(k-1)/2
    else:
        return 0
def selfset(k):
    if k >= 2:
        return (k-1)*(k-2)/2
    else:
        return 0

setnum={i:set(num[i]) for i in range(N)}
a=sum(setnum.values())
print(setnum,A)

selfsetnum={i:selfset(num[i]) for i in range(N)}


for i in range(N):
    print(int(a-setnum[A[i]-1]+selfsetnum[A[i]-1]))
# Judge status: Accepted
N=int(input())
ans = 0
 
for i in range(1, N+1):
    num = N // i
    if num == 1:
        ans += i
    else:
        ans += num * (i + num * i) / 2
 
print(int(ans))
# Judge status: Wrong Answer
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]

x = y = t = 0
for i in range(n):
    dx, dy, dt = l[i][1], l[i][2], l[i][0]
    dist = abs((dx - x) + (dy - y))

    if abs(dt - t) < dist or dt - dist % 2:
        print("No")
        exit()

    x, y, t = dx, dy, dt
print("Yes")
# Judge status: Accepted
a, b, c = map(int, input().split())
aa, bb, cc = a, b, c
p = 0
q = 1
k = int(input())

for i in range(1,k + 2):
    a, b, c = aa, bb, cc
    b = b * (2 ** (k - i + 1))
    c = c * (2 ** (i - 1))
    if c <= 0:
        c = cc
    if b <= 0:
        b = bb
    if a < b and b < c:
        p += 1

if p != 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = list(input())
data = [0] * (len(s) + 1)
for i in range(len(s)):
    if s[i] == "<":
        data[i + 1] = data[i] + 1

for i in range(len(s) - 1, -1, -1):
    if s[i] == ">":
        data[i] = max(data[i], data[i + 1] + 1) 
print(sum(data))
# Judge status: Accepted
s = input()
is_a = False
cnt_c = s[2:-1].count("C")
cnt_l = 0
if s[0] == "A":
    is_a = True
else:
    pass
for letter in s:
    if letter.isupper():
        cnt_l += 1
    else:
        continue
if is_a == True and cnt_c == 1 and cnt_l == 2:
    print("AC")
else:
    print("WA")
# Judge status: Accepted
x = int(input())
while any(x % i < 1 for i in range(2, x)): 
    x += 1
print(x)
# Judge status: Accepted
str1 = str(input())
if str1[2] == str1[3] and str1[4] == str1[5]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
x,y=map(int,input().split())
if x==y:
    print('YES')
else:
    print("NO")
# Judge status: Wrong Answer
s = list(str(input()))
t = list(str(input()))
s.sort()
t.reverse()
S = str()
T = str()
for i in s:
    S += i
for k in t:
    T += k
print('Yes' if S<T else 'No')
# Judge status: Accepted
n = int(input())
sum = int((n*(n+1))/2)
print(sum)
# Judge status: Wrong Answer
N, M = map(int, input().split())
from bisect import bisect_right
dic = [[] for i in range(N)]

shi = {}
for i in range(M):
    p, y = map(int, input().split())
    dic[p-1].append(y)
    shi[i] = (p, y)

for j in range(M):
    p, y = shi[j]
    print('{:06}{:06}'.format(p, bisect_right(dic[p-1], y)))
# Judge status: Wrong Answer
import sys
from itertools import groupby
def input(): return sys.stdin.readline().rstrip()
 
def main():
    n=int(input())
    c=list(input())
    ans=0
    white=0
    for key, value in groupby(c):
        if key=='W':
            white=len(list(value))
        else:
            ans+=min(white,len(list(value)))
    print(ans)   
 
 
 
if __name__=='__main__':
    main()
# Judge status: Accepted
N, M = map(int, input().split())
A  = list(map(int, input().split()))

sum_ = sum(A)

a = N - sum_

if a >= 0:
    print(a)
else:
    print(-1)
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int,input().split()))
ans = 0

h = sorted(h,reverse=True)

for i in range(k,n):
    ans += h[i]

print(ans)
# Judge status: Wrong Answer
N = int(input())
def su(n):
    s = 0
    for i in range(1,n+1):
        s += i
    return s

if N == 1:
    print(1)

else:
    for i in range(N):
        if N - su(i) <= i:
            j = i-1
            k = N-su(i-1)
            break

    for i in range(1,j+1):
        print(i)
    print(k)
# Judge status: Wrong Answer
import sys


def getN():
    return int(input())


def getNM():
    return map(int, input().split())


def getList():
    return list(map(int, input().split()))


def input():
    return sys.stdin.readline().rstrip()


#############
# Main Code #
#############

n, m = getNM()
ords = []
for _ in range(m):
    s = input()
    ords.append([[ord(x) for x in s]])
    ords[-1].append(s)

ords.sort(key=lambda x: x[0])

for _, s in ords:
    print(s, end='')
# Judge status: Accepted
n, k = map(int, input().split())
P = list(map(int, input().split()))


E = [0] * 1001

total = 0
for i in range(1, 1001):
    total += i
    e = total / i
    E[i] = e

P_to_E = [E[p] for p in P]


candidate = sum(P_to_E[:k])
candidates = [candidate]

for i in range(n-k):
    drop = P_to_E[i]
    add = P_to_E[i+k]
    candidate += add - drop
    candidates.append(candidate)

print(max(candidates))
# Judge status: Accepted
def solve(string):
    i, c = 0, 100
    while c < int(string):
        i += 1
        c = c * 1.01 // 1
    return str(i)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
print("YES" if a+b>=x else "NO")
# Judge status: Wrong Answer
n = int(input()) // 2
print(n)
# Judge status: Accepted
o = list(input())
e = list(input())
oe = []
for i in range(len(e)):
         oe.append(o[i])
         oe.append(e[i])
if len(o) != len(e):
         oe.append(o[len(o)-1])
ans = ''.join(oe)
print(ans)