peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
A,B=map(int,input().split())
for i in range(20):
  if i==0 and A>=B:
    break
  if i>0 and (i+1)*A-1>=B:
    break
print(i+1)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

s=input()
l=[]
l.append(s.count("a"))
l.append(s.count("b"))
l.append(s.count("c"))

if max(l)-min(l)<=1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
s = list(input())
cnt = {
    "R": 0,
    "G": 0,
    "B": 0
}

for i, c in enumerate(s):
    cnt[c] += 1

ans = cnt["R"] * cnt["G"] * cnt["B"]
d = 0
for i in range(n-2):
    for j in range(i + 1, n - 1):
        k = j + (j - i)
        if (k < n):
            if (s[i] != s[j])and(s[j] != s[k]) and (s[k] != s[i]):
                d += 1

print(ans-d)
# Judge status: Wrong Answer
N=int(input())
s=[int(input()) for _ in range(N)]
s.sort()
ans=sum(s)

for i in range(N):
    if ans%10==0:
        ans-=s[i]
    else:
        print(ans)
        exit()

print(ans)
# Judge status: Wrong Answer
import itertools
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
x = [i+1 for i in range(n)]
ans = 0
c = 1
for j in itertools.permutations(x,n):
    y = list(j)
    if p == y:
       ans += c
    elif q == y:
        ans -= c
    
    c += 1

print(abs(ans))
# Judge status: Wrong Answer
D =int(input())
print("""'Christmas' if D==25 else 'Christmas Eve' if D==24 else 
'Christmas Eve Eve' if D==23 else 'Christmas Eve Eve Eve' if D==22""")
# Judge status: Accepted
n, l = map(int, input().split())
S = [input() for i in range(n)]
sorted_list = sorted(S)
print(*sorted_list, sep="")
# Judge status: Wrong Answer
s=input()
if s=="AAA" or "BBB":
  print("No")
else:
  print("Yes")
# Judge status: Accepted
n,k = map(int,input().split())
r,s,p = map(int,input().split())
a = list(input())

hand = {"r":p,"s":r,"p":s}
ans = 0
for i in range(n):
    if a[i-k] == a[i] and i-k >= 0:
        a[i] = "0"
    else:
        ans += hand[a[i]]
print(ans)
# Judge status: Wrong Answer
S = input()
S_r = S[::-1]

Ss = ["maerd","remaerd","esare","resare"]
for s in Ss:
    S_r = S_r.replace(s,"") 

if S_r == "":
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import math
a,b=input().split()
x=int(a+b)
y=int(math.sqrt(x))
print("Yes" if y*y==x else "No")
# Judge status: Accepted
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,a,b = map(int,input().split())
ans = ((n-1)*b + a) - (b + (n-1)*a) + 1
print(max(ans,0))
# Judge status: Accepted
n, k = map(int, input().split())
s = input()
cnt = 0
for i in range(n - 1):
    if s[i] == s[i + 1]:
        cnt += 1
print(min(cnt + 2 * k, n - 1))
# Judge status: Wrong Answer
n,m=map(int,input().split())
pre=[[] for _ in range(n)]
for _ in range(m):
    p,y=map(int,input().split())
    pre[p-1].append([y,_,p])
for p in range(n):
    pre[p].sort(key=lambda x:x[0])
    for i in range(len(pre[p])):
        pre[p][i].append(i)
lis=[]
for i in pre:
    for j in i:
        lis.append(j)
lis.sort(key=lambda x:x[1])
for i in lis: print("{:06}{:06}".format(i[3]+1,i[2]))
# Judge status: Accepted
from fractions import gcd
from functools import reduce
n = int(input())
a = [int(i) for i in input().split()]
print(reduce(gcd, a))
# Judge status: Wrong Answer
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3:
  print(1)
else:
  array = np.zeros(s+1)
  array[0] = 1
  for i in range(3, s+1):
    array[i] = np.sum(array[:i-2]) % mod
  print(array[s])
# Judge status: Wrong Answer
N,M=map(int,input().split())
u=0
A=[]
B=[]
for i in range(M):
  a,b=map(int,input().split())
  A.append(a)
  B.append(b)
for i in range(M):
  if A[i]==1:
    s=B[i]
    idxlist=[]
    for idx,val in enumerate(A):
      if val==s:
        idxlist.append(idx)
    for j in idxlist:
      if B[j]!=N:
        u+=1
if u==len(idxlist):
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")
# Judge status: Wrong Answer
N = int(input())
A = []

def remove_one(num, A):
    
    B = []
    N = len(A)

    if (num == 0):
        B = A[1:]
    elif (num == N):
        B = A[:N-1]
    else:
        B = A[:i-1] + A[i+1:]
    
    return(B)


for i in range(N):
    A.append(int(input()))

for i in range(N):
    B = remove_one(i+1,A)
    print(max(B))
# Judge status: Accepted
N,D=map(int, input().split())
X=list(list(map(int, input().split())) for _ in range(N))
import itertools
import math
tmp=0
ans=0
for x1,x2 in list(itertools.combinations(X,2)):
    for d in range(D):
        tmp+=(x1[d]-x2[d])**2
    tmp=math.sqrt(tmp)
    tmp1=math.ceil(tmp)
    if tmp==tmp1:
        ans+=1
    tmp=0
print(ans)
# Judge status: Accepted
from sys import exit
num = ["0","1","2","3","4","5","6","7","8","9"]
A, B = map(int,input().split())
S = input()
for i in range(A + B + 1):
  if i == A:
    if S[i] != "-": 
      print("No")
      exit()
  else: 
    if S[i] not in num:
      print("No")
      exit()
print("Yes")
# Judge status: Accepted
a, b, c, d = map(int, input().split())
if abs(a-b) <= d and abs(b-c) <= d:
    print('Yes')

elif abs(a-c) <= d:
    print('Yes')

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

for i in range(1,361):
  if (n*i)%360==0:
    print(i);exit()
# Judge status: Accepted
import sys

n, k = map(int, sys.stdin.readline().split())

def main():
    print((n + k - 3) // (k - 1))

if __name__ ==  '__main__':
    main()
# Judge status: Wrong Answer
s = input()
t = input()
ans = len(t)
len_t = len(t)
for i in range(len(s)-len(t)):
    cnt = len_t
    for j in range(len(t)):
        if s[i+j] == t[j]:
            cnt -= 1
    if ans > cnt:
        ans = cnt
print(ans)
# Judge status: Accepted
# solution
n, m = map(int, input().split())
strs = str(input())
count = 0
for i in range(n):
    if strs[i:i+2] == 'LL' or strs[i:i+2] == 'RR':
        count += 1
print(min((count + 2*m), n-1))
# Judge status: Accepted
#coding:utf-8
n, x = map(int, input().split())
a = list(map(int, input().split()))
child = sorted(a)

for i in range(n):
    x -= child[i]
    if x < 0:
        break
    elif x == 0:
        print(i+1)
        exit()

print(i)
# Judge status: Wrong Answer
def resolve():
    '''
    code here
    '''
    import sys
    N = int(input())
    S = sys.stdin.readline().strip()

    set_S = set([item for item in S])
    res = 1

    for s in set_S:
        cnt = 1
        for letter in S:
            if s == letter:
                cnt += 1
        res *= cnt

    print(res-1)

if __name__ == "__main__":
    resolve()
# Judge status: Accepted
a,b = map(int,input().split())
n = list(input())
 
if n[a] == '-' and '-' not in n[:a] and '-' not in n[a+1:]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n=int(input())

if 100<=n<=111:
            print(111)
a=0
for a in range(1,9):
            if 1+111*a<=n<=111*(a+1):
                        print(n)
                        print(111*(a+1))
# Judge status: Accepted
n = int(input())
f_dict = {}
s_dict = {}
cnt_all = 0
for i in range(n):
  moji = str(i+1)
  if not moji[0]+moji[-1] in f_dict:
    f_dict[moji[0]+moji[-1]] = 1
  else:
    f_dict[moji[0]+moji[-1]] += 1 
  if not moji[-1]+moji[0] in s_dict:
    s_dict[moji[-1]+moji[0]] = 1
  else:
    s_dict[moji[-1]+moji[0]] += 1
for mykey in f_dict.keys():
  if mykey in s_dict:
      cnt_all += f_dict[mykey] * s_dict[mykey]
print(cnt_all)
# Judge status: Accepted
S =input()
for i in range(len(S)-1):
    if S[i] == S[i+1]:
        print('Bad')
        exit()
print('Good')
# Judge status: Wrong Answer
n = int(input())
if n%2==0:
  a = int(n//2)
  print(a-1)
  print(a+1)
else:
  a = int(n//2)
  if a!=0:
    print(a)
  print(a+1)
# Judge status: Accepted
r, g, b = map(int, input().split())
print('YES' if (100 * r + 10 * g + b) % 4 == 0 else 'NO')
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if c>a and c<b:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N = int(input())
S = list(input())

ans = []
for i in S:
    s = int(ord(i)) + N
    if s > 90:
        ans.append(chr(s % 90 + 65))
    else:
        ans.append(chr(s % 65 + 65))

print(''.join(ans))
# Judge status: Wrong Answer
from sys import stdin
import math
import fractions
import heapq

n = int(stdin.readline().rstrip())

cnt = int((1 + (n-1)) * (n-1) / 2)

print(cnt)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n, m = map(int, input().split())
if n == 1 and m == 1:
    print(1)
    sys.exit(0)
if n == 1:
    print(m - 2)
    sys.exit(0)
if m == 1:
    print(n - 2)
    sys.exit(0)

print(n * m - (n * 2 + m * 2 - 4))
# Judge status: Accepted
n = int(input())
w = [''] * n
for i in range(n):
    w[i] = str(input())

flag = True
for i in range(1,n):
    a = list(w[i-1])
    b = list(w[i])
    if a[-1] == b[0]:
        pass
    else:
        flag = False

chk = list(set(w))
if len(w) == len(chk):
    pass
else:
    flag = False
        
if flag:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
#A - Takoyaki
N,X,T = map(int,input().split())
Time = (int(N / X ) ) * T
amari = N % X
if amari != 0 :
    Time += T
# 出力
print(Time)
# Judge status: Accepted
N=int(input())
A=[]
for i in range(N):
  A.append(int(input()))
A.sort(reverse=True)
ans=sum(A)
if ans%10!=0:
  print(ans)
  exit()
else:
  for i in range(N):
    tmp=ans-A[-(i+1)]
    if tmp%10!=0:
      print(tmp)
      exit()
print(0)
# Judge status: Accepted
s = input().rstrip()

r = 'Yes'
for i in range(len(s)):
	if (i + 1) % 2 == 0:
		if s[i] in 'LUD':
			pass
		else:
			r = 'No'
	else:
		if s[i] in 'RUD':
			pass
		else:
			r = 'No'

	if r != 'Yes':
		break

print(r)
# Judge status: Accepted
s = input()
print(s.rfind('Z')-s.find('A')+1)
# Judge status: Wrong Answer
A, B, C, K = map(int,input().split())
# 1 0 -1 Num
result = 0
if K <= A + B:
	print(A)
else:
	x = K-A-B
	print(A-x)
# Judge status: Accepted
def main():
    a, b, k = map(int, input().split())
    if k >= a and b >= k-a:
        print(0, b-(k-a))
    elif k >= a and b < k-a:
        print(0, 0)
    else:
        print(a-k, b)
        
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    maximum = sum(A)
    for i in reversed(range(N)):
        reduce2 = max(0, A[i + 1] - B[i])
        reduce1 = max(0, A[i] - B[i] + reduce2)
        A[i + 1] = reduce2
        A[i] = reduce1
    now = sum(A)

    print(maximum - now)


if __name__ == '__main__':
    solve()
# Judge status: Accepted
from sys import stdin

N, M = [int(x) for x in stdin.readline().rstrip().split()]

head = 1
tail = N

while head <= M:
    if (N % 2 == 0 and tail - head == N // 2) or (N % 4 == 0 and tail - head == N // 2 - 1):
        tail -= 1
    print(head, tail)
    head += 1
    tail -= 1
# Judge status: Accepted
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')

A, B, C = MI()
print('Yes' if A < C < B or B < C < A else 'No')
# Judge status: Accepted
s = input()
t = input()
ss = []

for i in range(len(s)-len(t)+1):
    for j in range(len(t)):
        if s[i+j] not in ('?', t[j]):
            break
    else:
        S = s[:i] + t + s[i+len(t):]
        ss.append(S.replace('?', 'a'))

if ss:
    print(min(ss))
else:
    print("UNRESTORABLE")
# Judge status: Accepted
import sys
input = sys.stdin.readline
s=list(input().strip())
b={}
for a in s:
    b[a]=1
if len(b)==len(s):
    print("yes")
else:
    print("no")
# Judge status: Accepted
import copy
N = int(input())
keta = 1
n = copy.deepcopy(N)
flag = True
while flag:
    if n-1 >= 26**keta:
        n -= 26**keta
        keta += 1
    else:
        flag = False
for i in range(1, keta):
    N -= 26**i
alph = 'abcdefghijklmnopqrstuvwxyz'
ans = []
ans.append(alph[(N%26)-1])
for i in range(1, keta):
    num = (N-1)//(26**i)
    if num ==0:
        ans.append("a")
    else:
        ans.append(alph[(num%26)])
ans.reverse()
print("".join(ans))
# Judge status: Wrong Answer
A, B = map(int, input().split())

if A <= 5:
  print(0)
elif A <= 12:
  C = B / 2
  print(C)
else :
  print(B)
# Judge status: Accepted
from decimal import Decimal
from math import pi, atan
a,b,x = map(Decimal, input().split())

thre = a*a*b / Decimal(2.0)
if x >= thre:
    d = 2*b - 2*x / (a*a)
    theta = 180.0 / pi * atan(d / a)
    print(theta)
else:
    d = 2* x / (a*b)
    theta = 180.0 / pi * atan(b / d)
    print(theta)
# Judge status: Accepted
#!/usr/bin/env python3
a, b, k = map(int, input().split())
ans = []
for i in range(1, 101):
    if a % i == 0 and b % i == 0: ans.append(i)
print(ans[-k])
# Judge status: Wrong Answer
d=int(input())
a=[]
for x in range(d+1):
  b=list(map(int,input().split()))
  a.append(b)
  
  

print(a[1][1])
sum1=sum(a[0][1:d])

ans=[0]*d

for n in range(d):
  ans[n]=(a[n+1][0])
  ans[n]=int(int(ans[n])-(sum1))
  try:
    ans[n]=ans[n]+ans[n-1]
  except:
    True
    
for y in range(d):
  print(ans[y])
# Judge status: Accepted
n = int(input())
s = "No"
for d in range(n // 7, -1, -1):
    if (n - 7 * d) % 4 == 0:
        s = "Yes"
        break
print(s)
# Judge status: Accepted
p, q, r = map(int, input().split())
print(min(p+q, p+r, q+r))
# Judge status: Accepted
import bisect


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


N = int(input())
L = LI()
L.sort()
ans = 0

for i in range(N-1, 1, -1):
    for j in range(i-1, 0, -1):
        xl = L[i]-L[j]
        ind = bisect.bisect_right(L, xl)
        if j > ind:
            ans += j-ind
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

for i in range(n - m + 1):
    for j in range(n - m + 1):
        check = [a[i + k][j:j + m] for k in range(m)]

        flag = True
        for x in range(m):
            if check[x] != b[x]:
                flag = False
                break

        if flag:
            print('Yes')
            exit()

print('No')
# Judge status: Wrong Answer
a,b,t=map(int,input().split());print((t+0.5)//a*b)
# Judge status: Accepted
s = input()
S = len(s)

for i in range(S-1):
    for j in range(i,S):
        if s[:i]+s[j:] == "keyence":
            print("YES")
            exit()

print("NO")
# Judge status: Accepted
x = int(input())
li = []
for i in range(x):
    l = list(map(int, input().split()))
    li.append(l)
dp = [[0]*3 for _ in range(x+1)]
for i in range(x):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i+1][j] = max(dp[i][k]+li[i][j], dp[i+1][j])
print(max(max(dp[x][0], dp[x][1]), max(dp[x][1], dp[x][2])))
# Judge status: Wrong Answer
S = input()

lis = ["Sunny","Cloudy","Rainy","Sunny"]

ans = lis[lis.index(S)]
print(ans)
# Judge status: Accepted
n = int(input())
s = input()

m = 0

for i in range(1, n):
    t = set(s[:i])
    u = set(s[i:])
    m = max(len(t & u), m)

print(m)
# Judge status: Accepted
from itertools import accumulate

N = int(input())
A = list(map(int, input().split()))
B = list(accumulate(A))
S = B[-1]

ans = float('inf')
for i in range(N-1):
  x = B[i]
  y = S - x
  ans = min(ans, abs(x - y))

print(ans)
# Judge status: Accepted
#ABC057-B
n,m = map(int,input().split())
students = [list(map(int,input().split())) for _ in range(n)]
points = [list(map(int,input().split())) for _ in range(m)]
def manhattan(s,points):
    lst = []
    for i in points:
        lst.append(abs(s[0] - i[0]) + abs(s[1] - i[1]))
    return lst.index(min(lst))+1

for i in students:
    print(manhattan(i,points))
# Judge status: Wrong Answer
n, d = map(int, input().split())
L = [list(map(int, input().split())) for i in range(n)]
for i in range(n-1):
    for j in range(i+1, n):
        ans = 0
        int_ = 0
        for k in range(d):
            int_ += (L[i][k]-L[j][k])**2
        if int(int_**0.5):
            ans += 1
print(ans)
# Judge status: Wrong Answer
N=int(input())
A=set(input().split())
print(len(A))
# Judge status: Wrong Answer
N = int(input())
P = [int(x) for x in input().split()]
ans = 1
for i in range(N-1):
    if P[i] > P[i+1]:
        ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
print(n+(n**2)+(n**2)*n)
# Judge status: Accepted


import collections


def solve():

    S = list(input())
    K = int(input())

    for i in range(K):
        if S[i] != "1":
            print(S[i])
            break
    else:
        print(1)


if __name__ == "__main__":
    solve()
# Judge status: Accepted
n = int(input())
print((1000-n%1000) % 1000)
# Judge status: Accepted

class gv:
    input = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

if __name__ == '__main__':
    build()
    solve()
# Judge status: Wrong Answer
import bisect

n = int(input())
a = list(map(int, input().split()))
a.sort()
M = max(a)
m = M // 2

left = bisect.bisect_left(a, m)
right = bisect.bisect_right(a, m)

if abs(m - a[left]) < abs(m - a[right]):
    print(M, a[left])
else:
    print(M, a[right])
# Judge status: Accepted
k,n=map(int,input().split())
a=list(map(int,input().split()))

tmp=a[0]+(k-a[n-1])

for i in range(n-1):
    cnt=a[i+1]-a[i]
    tmp=max(cnt,tmp)

print(k-tmp)
# Judge status: Wrong Answer
#AGC015-A
n,a,b = map(int,input().split())

mi = a * (n-2)
ma = b * (n-2)
result = ma - mi + 1
if a > b:
    print(0)
elif a == b and n != 1:
    print(0)
else:
    print(result)
# Judge status: Accepted
s = int(input())
ans = []

for i in range(2, 1000002):
  ans.append(s)
  if s % 2 == 0:
    s /= 2
  else:
    s = 3 * s + 1
  if s in ans:
    print(i)
    break
# Judge status: Accepted
def ABC_105_A():
    N,K = map(int, input().split())
    
    if N%K == 0:
        print(0)
    else:
        print(1)

if __name__ == '__main__':

    ABC_105_A()
# Judge status: Accepted
s = input().rstrip()
s = s[::-1]
n = len(s)
dp = [[0]*2 for _ in range(n+1)]
for i in range(1,n+1):
  if i == 1:
    dp[1][0] = int(s[0])
    dp[1][1] = 10-int(s[0])
  else:
    dp[i][0] = min(dp[i-1][0]+int(s[i-1]),dp[i-1][1]+int(s[i-1])+1)
    dp[i][1] = min(dp[i-1][0]+10-int(s[i-1]),dp[i-1][1]+9-int(s[i-1]))
print(min(dp[n][0],dp[n][1]+1))
# Judge status: Wrong Answer
from math import log

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

print(int(log(Y, 2) - log(X, 2)) + 1)
# Judge status: Accepted
import math
a,b = input().split()
B = int(str(b).replace(".",""))
A = int(a)
print(A*B//100)
# Judge status: Accepted
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

X = int(input())

n = X//100
if X <= 105 * n:
    print(1)
else:
    print(0)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(N):
    s ^= a[i]

ans = []
for i in range(N):
    ans.append(a[i] ^ s)
print(*ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())
sum = 1
for i in range(2,999):
	if a > sum:
		sum += i
	else:
		break
print(sum-a)
# Judge status: Accepted
#!/usr/bin/env python3
s = input()
for i in range(1,len(s)-1):
	if (len(s) - i) % 2 == 1: pass
	elif s[:(len(s) - i)//2] == s[(len(s) - i)//2:-i]:
		print(len(s) - i)
		#print(s[:-i])
		break
# Judge status: Accepted
a,b = map(int,input().split())
if a+ b >=24:
  print(a+b-24)
else:
  print(a+b)
# Judge status: Wrong Answer
x,y = map(int,input().split())

mod = 10**9 + 7

if (x+y)%3 != 0:
    print(0)
    
else:
    
    n=(x+y)//3
    
    r = min(x-n,y-n)
    
    p=1
    q=1
    for i in range(r):
       
        p *= n-i
        

        q *= (i+1)
            
    ans = p * pow(q,mod-2,mod)
    ans %= mod
        
    print(ans)
# Judge status: Accepted
def solve():
    S = int(input())
    MOD = 10**9+7

    dp = [0] * (S+1)
    dp[0] = 1

    for i in range(1,S+1):
        cnt = 0
        for j in range(i-2):
            cnt += dp[j]
        dp[i] = cnt % MOD
    
    print(dp[S])

if __name__ == '__main__':
    solve()
# Judge status: Accepted
n = int(input())
P = list(map(int, input().split()))

Cnt = []
cnt = 0
ans = 0
for idx, p in enumerate(P, 1):
    if idx == p:
        Cnt.append(idx)
        cnt += 1
    else:
        cnt = 0
    if cnt == 2:
        ans -= 1
        cnt = 0

ans += len(Cnt)
print(ans)
# Judge status: Wrong Answer
def main(cell):

    n=cell[0]
    k=cell[1]
    risk=int(abs(n/k))
    n=n-k*(risk-2)
    pren=n
    while 2>0:
        n=abs(n-k)
        if n >pren:
            break
        else:
            pren=n

    return pren
    


cell=list(map(int,input().split()))
pren=main(cell)
print(pren)
# Judge status: Wrong Answer
import math
A, B, H, M = map(int, input().split())

long = M * 6
short = (H*60 + M) * 0.5
k = short - long
if k > 180:
    k -= 180 
a = (A**2) + (B**2) - (2*A*B*math.cos(math.radians(k)))
print(a**(1/2))
# Judge status: Accepted
n,m=map(int,input().split())

ans=[]

re=[[] for _ in range(n)]



for _ in range(m):
  a=list(map(int,input().split()))
  re[a[0]-1].append(a[1])
  ans.append(a)
  
d={}
for f in re:
  new=sorted(f)
  
  for i in range(len(new)):
    d[new[i]]=i+1
  
for x in ans:
  p=x[0]
  q=d[x[1]]
  print(str('{:0=6}'.format(p))+str('{:0=6}'.format(q)))
# Judge status: Accepted
A,B=map(int,input().split())
ans=0
if A>B:
  ans+=A
  A-=1
else:
  ans+=B
  B-=1
ans+=max(A,B)
print(ans)
# Judge status: Accepted
Str = input().split()
A = int(Str[0])
B = int(Str[1])
import math 
amin = math.ceil(A/0.08)
amax = (A+1)/0.08
if amax == math.floor(amax):
  amax= amax-1
else:
  amax = math.floor(amax)

i = amin
ans = -1
while i <= amax:
  if int(i*0.1) == B:
    ans = i
    break
  i+=1

print(ans)
# Judge status: Accepted
N=int(input())
ca=0
cw=0
ct=0
cr=0
for _ in range(N):
  a=input()
  if a=='AC':
    ca+=1
  elif a=='WA':
    cw+=1
  elif a=='TLE':
    ct+=1
  elif a=='RE':
    cr+=1
    
print('AC x',ca)
print('WA x',cw)
print('TLE x',ct)
print('RE x',cr)
# Judge status: Wrong Answer
from sys import stdin

s = stdin.readline().rstrip()
key = "keyence"

for i in range(len(s)):
    for j in range(len(s)-i):
        if s[:i]+s[j:] == key:
            print("YES")
            exit()

print("NO")
# Judge status: Wrong Answer
def factorization(n):
    res = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n //= i
            res.append([i, cnt])

    if n != 1:
        res.append([n, 1])

    return res


x = int(input())

res = x
while True:
    if len(factorization(res)) == 1:
        print(res)
        break
    res += 1
# Judge status: Accepted
k = int(input())
a, b = map(int, input().split())

if a%k == 0 or b%k == 0 or (b//k) - (a//k) >= 1:
    print('OK')
else:
    print('NG')
# Judge status: Wrong Answer
def LI():
	return [ int(s) for s in input().split() ]
  
a,b = LI()

print('Yay') if a <= 8 and b <= 8 else print(':(')
# Judge status: Accepted
n,m=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
if n>=m:
  print(0)
else:
  dif_l=[]
  for i in range(m-1):
    dif_l.append(l[i+1]-l[i])
  dif_l.sort()
  sum=0
  for j in range(m-n):
    sum+=dif_l[j]
  print(sum)
# Judge status: Accepted
X, Y, A, B, C = map(int, input().split())
p = sorted(list(map(int, input().split())))
q = sorted(list(map(int, input().split())))
r = sorted(list(map(int, input().split())))[::-1]

pq = sorted(p[-X:] + q[-Y:])
ans = sum(pq)

if pq[0] < max(r):
    left = 0
    right = len(r)
    while left < right - 1:
        mid = (left + right) // 2
        if pq[mid] >= r[mid]:
            right = mid
        else:
            left = mid
    ans = ans + sum(r[:right]) - sum(pq[:right])

print(ans)