peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))

now = 1
temp_l = [0]*N
temp_count = [-1]*N
temp_count[0] = 0
for i in range(N):
    pre = now
    now = A[pre-1]
    if temp_l[now-1] == 1:
        end = now
        temp = i+1
        break
    else:
        temp_l[now-1] = 1
        temp_count[now-1] = i+1

s_index = temp_count[end-1]
repeat = temp - s_index
K -= s_index
K = K % repeat

print(temp_count.index(K+s_index)+1)
# Judge status: Accepted
s = input()
print("No" if s == "AAA" or s == "BBB" else "Yes")
# Judge status: Accepted
N,K=map(int,input().split())
*A,=map(int,input().split())

now=A[0]
i=K
while i<N:
    if A[i]>now:
        print('Yes')
    else:
        print('No')
    i+=1
    now=A[i-K]
# Judge status: Accepted
a , b , c , k = map(int,input().split())
if k % 2 == 0:
    ans = a-b
elif k % 2 == 1:
    ans = b-a

if abs(ans) > 10 **18:
    print("Unfair")
elif abs(ans) <= 10**18:
    print(ans)
# Judge status: Wrong Answer
s = input()
if s >= "2019/04/30":
    print("Heisei")
else:
    print("TBD")
# Judge status: Accepted
import sys
n = int(input())
INF = 10*n
dp = [INF]*(n+1)
dp[0] = 0
for i in range(1, n+1):
    tmp = dp[i-1] + 1
    for j in range(10):
        if i-6**j<0:
            break
        tmp = min(tmp, dp[i-6**j] + 1)
    for j in range(10):
        if i-9**j<0:
            break
        tmp = min(tmp, dp[i-9**j] + 1)
    dp[i] = tmp
print(dp[n])
# Judge status: Accepted
n = int(input())
ls = [0] * n
for i in range(n):
    a = int(input())
    ls[i] = a

ans = 0
for i in range(n-1):
    if ls[i] % 2 == 1 and ls[i+1] > 0:
        ls[i] += 1
        ls[i+1] -= 1
    ans += ls[i] // 2
ans += ls[-1] // 2
print(ans)
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))
sum_a = sum(a)

if a[0] > x:
  a[0] = x
for i in range(n - 1):
  if a[i] + a[i+1] > x:
    a[i+1] += x - (a[i] + a[i+1])
r = sum_a - sum(a)
    
print(r)
# Judge status: Accepted
n = int(input())
l = []

for i in range(n+1):
    if i == 0:
        l.append(2)
    elif i == 1:
        l.append(1)
    else:
        l.append(l[-1]+l[-2])

print(l[n])
# Judge status: Accepted
import re;print("YNEOS"[re.match("(erase(r)?|dream(er)?)+$",input())is None::2])
# Judge status: Accepted
def main():
    _ = input()
    A = list(map(int, input().split()))
    cnt = 0
    for i in range(len(A)-2):
        A_sub = sorted(A[i:i+3])
        a = A[i+1]
        if a == A_sub[1]:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
bbn=1000000007
	
#+++++
		
def main():
	a = int(input())
	for i in range(16):
		if 7 * i <= a and (a - (7*i))%4==0:
			return 'Yes'
	return 'No'
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)
# Judge status: Accepted
s=list(input())
t=list(input())
s.sort()
t.sort(reverse=True)
if s<t:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
c = input()
alphabet = [
    "a", "b", "c", "d", "e", "f", "g",
    "h", "i", "j", "k", "l", "m", "n",
    "o", "p", "q", "r", "s", "t", "u",
    "v", "w", "x", "y", "z"
]
x = alphabet.index(c)
print(
    alphabet[x+1]
)
# Judge status: Accepted
N = int(input())
D = [list(map(int, input().split())) for i in range(N)]
for i in range(N-2):
    if D[i][0] == D[i][1]:
        if D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
from collections import Counter as counter

ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########
def main(n,m,k):
    res = []
    a = []
    for i in k:
        a.extend(i[1:])
    c = counter(a)
    for i in range(1,m+1):
        if c[i] == n : res.append(i)
    return len(res)
    
n,m = mi()
k = mix(n)
print(main(n,m,k))
# Judge status: Accepted
# -*- coding: utf-8 -*-

def main():

    N = int(input())
    ans = 0

    for i in range(N + 1):
        ans = ans + i

    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
As = list(map(int, input().split()))
from collections import defaultdict
d = defaultdict(int)
for a in As:
    d[a] += 1
cnt = 0
for k in d.keys():
    if d[k]-k >= 0:
        cnt += d[k] - k
    else:
        cnt += d[k]
print(cnt)
# Judge status: Accepted
k,a,b=map(int,input().split())
if b<a+2:
    print(1+k)
else:
    if k<=a:
        print(1+k)
    else:
        if (k-a-1)%2==0:
            print(b+(b-a)*((k-a-1)//2))
        else:
            print(b+(b-a)*((k-a-1)//2)+1)
# Judge status: Wrong Answer
sa = input()
sb = input()
sc = input()

S = [sa, sb, sc]
d = {'a':0, 'b':1, 'c':2}

sidx = [0, 0, 0]
# 次の人
nxt = S[0][0]
sidx[d[nxt]] += 1
while True:
    try:
        nxt = S[d[nxt]][sidx[d[nxt]]]
    except:
        print(nxt.upper())
        break
    sidx[d[nxt]] += 1
# Judge status: Accepted
import sys
input = sys.stdin.readline


def main():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    ans = 1
    n -= k
    ans += (n+k-2) // (k-1)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

P=max(A)
I=A.index(P)
del A[I]
Q=min(A,key=lambda x:abs(2*x-P))
print(P,Q)
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())
h = max(h, w)
res = n // h
r = n % h
if r:
    res += 1
print(res)
# Judge status: Accepted
s = input()
n = len(s)
flag = 0
for i in range(n):
    for j in range(i, n):
        if s[:i] + s[j:] == 'keyence':
            print('YES')
            flag = 1
            break
    if flag == 1:
        break
else:
    print('NO')
# Judge status: Wrong Answer
# AtCoder
from collections import Counter
N, K = map(int, input().split())
A = list(map(int, input().split()))
u = list(set(A))[K:]
c = Counter(A)
ans = 0
for e in c.items():
    if e[0] in u:
        ans += e[1]

print(ans)
# Judge status: Accepted
X, N = map(int, input().split())
if N != 0:
  p = set(map(int, input().split()))
  for i in range(N):
    if X - i not in p:
      print(X - i)
      break
    elif X + i not in p:
      print(X + i)
      break
  else:
    print(X - i - 1)
else:
  print(X)
# Judge status: Accepted
import math
X,K,D =map(int,input().split())
X=abs(X)
a=X//D
b=X%D
if a >K:
  ans=(a-K)*D+b
else:
  ans=X-a*D-((K-a)%2)*D
print(abs(ans))
# Judge status: Wrong Answer
a,b = input().split()
a = int(a)
b = float(b)*100
ans = a*b // 100
print(int(ans))
# Judge status: Accepted
s = input()
if set(s[:int(input())])=={'1'}:
  print(1)
else:
  for i in s:
    if int(i) > 1:
      print(int(i))
      break
# Judge status: Accepted
x,y,z = map(int,input().split())

ans = 0

while y * ans + z * (ans+1) <= x:
    ans += 1

print(ans-1)
# Judge status: Accepted
N, A, B = map(int, input().split())
L = [0, 0]
S = input()

for i in S:
    if i == "a":
        if sum(L) < A + B:
            print("Yes")
            L[0] += 1
        else:
            print("No")
    elif i == "b":
        if sum(L) < A + B and L[1] < B:
            print("Yes")
            L[1] += 1
        else:
            print("No")
    else:
        print("No")
# Judge status: Accepted
N, M = [int(i) for i in input().split()]

cnt = min(N, M // 2)
N -= cnt
M -= cnt * 2

if M > 0:
  cnt += M // 4

print(cnt)
# Judge status: Wrong Answer
s = str(input())

n = len(s) - 1

for i in range(1 << n):
    f = ""
    f += s[0]

    for j in range(n):

        if 1 & (i >> j):

            f += "+"
            f += s[j + 1]
        else :

            f += "-"
            f += s[j + 1]

    print(eval(f))
# Judge status: Accepted
a, b, c, d = map(int, input().split())

while a > 0 and c > 0:
    c -= b
    if c <= 0:
        break
    a -= d
    if d <= 0:
        break

if c <= 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import numpy as np
n,m = map(int,input().split())
a = np.array([list(input()) for _ in range(n)])
b = np.array([list(input()) for _ in range(m)])
flg = 0
for i in range(n-m+1):
  for j in range(n-m+1):
    if (a[i:i+m,j:j+m] == b).all():
      flg = 1
print("Yes" if flg == 1 else "No")
# Judge status: Wrong Answer
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
  print(i)
  A = str(i)
  if A[0] == A[-1] and A[1] == A[-2]:
    count += 1
print(count)
# Judge status: Accepted
k=int(input())
a,b=map(int,input().split())
ans="NG"
for i in range(a,b+1):
    if i%k==0:
        ans="OK"
print(ans)
# Judge status: Accepted
N = int(input())
A = list()
for _ in range(N):
    A.append(int(input()))
ans = 0
now = 1
for _ in range(N):
    if now == 2:
        break
    now = A[now - 1]
    ans += 1
print(ans if ans != N else -1)
# Judge status: Accepted
N=int(input())
ls1=[1,2,3,4,5,6,7,8,9]
empty=[]
for i in ls1:
    for j in ls1:
        empty.append(i*j)
print('Yes' if N in empty else 'No')
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = []
b = []
for i in range(n):
  a_, b_ = map(int, input().split())
  a.append(a_)
  b.append(b_)

for i in range(n):
  k = k-b[i]
  if k <= 0:
    print(a[i])
    exit()
# Judge status: Wrong Answer
n=int(input())
print(800*n-n%15)
# Judge status: Accepted
s, t = input(), input()
ret = len(t)
for i in range(len(s)-len(t)+1):
    u = s[i:len(t)+i]
    count_diff = 0
    for j in range(len(u)):
        if u[j] != t[j]:
            count_diff += 1
    ret = min(ret, count_diff)
print(ret)
# Judge status: Wrong Answer
a, b = map(int, input().split())
print(sum(range(b - a)) - b)
# Judge status: Wrong Answer
N, K = map(int, input().split())
R, S, P = map(int, input().split())
d = [[] for _ in range(K)]

for i, s in enumerate(input()):
    score = R if s=="s" else S if s=="p" else P
    d[i%K].append(score)

ans = 0
for l in d:
    prev_value = 10**5
    for i in l:
        if i!=prev_value:
            ans += i
            prev_value = i
        else:
            prev_value = 10**5

print(ans)
# Judge status: Accepted
import collections as c
n,k=map(int,input().split());a=c.Counter(map(int,input().split()))
print([0,sum(sorted([i for i in a.values()])[:len(a)-k])][len(a)>k])
# Judge status: Accepted
n = int(input())
x = 1
for i in range(9):
    if n/(i+1) == int(n/(i+1)):
        if n/(i+1) <= 9:
            x = 0
print("Yes" if x == 0 else "No")
# Judge status: Accepted
s=int(input())
a=s//100
b=s%100
if a>0 and a<=12:
  if b>0 and b<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if b>0 and b<=12:
    print("YYMM")
  else:
    print("NA")
# Judge status: Accepted
def main():
    X = input_ints()

    print(10 - (X // 200))


def input_ints():
    line_list = input().split()

    if len(line_list) == 1:
        return int(line_list[0])
    else:
        return map(int, line_list)


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


def input_int_tuple_list(n: int):
    return [tuple(map(int, input().split())) for _ in range(n)]


main()
# Judge status: Accepted
from fractions import gcd
def check():
    A, B, C = map(int, input().split())
    if C%gcd(A,B)==0:
        return 'YES'
    return 'NO'
print(check())
# Judge status: Accepted
a,b,c,d = map(int,input().split())
ans = 'No'
if max(a,c)-min(a,c)<=d:
  ans = 'Yes'
if max(a,b)-min(a,b)<=d and max(b,c)-min(b,c)<=d:
  ans = 'Yes'
print(ans)
# Judge status: Accepted
H1,M1,H2,M2,K = map(int,input().split())
ans = 0
ans += (H2-H1) * 60
ans += M2 - M1
ans -= K
print(ans)
# Judge status: Accepted
n = int(input())
s = input()
r = s.count("R")
g = s.count("G")
b = s.count("B")
ans = r*g*b
for i in range(1,(n+1)//2):
    j = 0
    while j + 2*i <= n-1:
        if s[j] != s[j+i] and s[j] != s[j+2*i] and s[j+i] != s[j+2*i]:
            ans -= 1
        j += 1
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(str,input().split()))

frn = ["" for i in range((n+1)//2)]
bck = ["" for i in range(n//2)]

for i in range(n):
    if i%2 == 0:
        frn[i//2] = a[i]
    else:
        bck[i//2] = a[i]

if n%2 == 0:
    print(" ".join(bck[::-1]+frn))
else:
    print(" ".join(frn[::-1]+bck))
# Judge status: Wrong Answer
import collections
N = int(input())
S = input()
temp_list = []
minus = 0
for i in range(0, N-2):
    for j in range(1, N-2):
        if i+j*2 >= N:
            break
        temp_list.append([i, i+j, i+j+j])


for temp in temp_list:
    if S[temp[0]] != S[temp[1]]:
        if S[temp[0]] != S[temp[2]]:
            if S[temp[1]] != S[temp[2]]:
                minus += 1

count_dict = collections.Counter(S)
print(count_dict["R"]*count_dict["G"]*count_dict["B"]-minus)
# Judge status: Accepted
s_1 = input()
s_2 = input()
if s_1[0] == s_2[2] and s_1[1] == s_2[1] and s_1[2] == s_2[0]:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
N=int(input())
List = list(map(int, input().split()))
midList = [0]*(N-1)
mid = 0
for i in range(N-2,-1,-1):
  mid += List[i+1]
  midList[i] = mid
res=0
for i in range(N-1):
  a = List[i] % 1000000007
  b =  midList[i] % 1000000007
  res += a*b
print(res%1000000007)
# Judge status: Accepted
import math
x=int(input())
def is_prime(n):
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(n)) +1):
        if n % i == 0:
            return False
    return True
for i in range(x, 100003+1):
    if is_prime(i):
        print(i)
        exit()
# Judge status: Accepted
from itertools import accumulate
from collections import Counter
N = int(input())
S = list(input())
kuro = [0]*N
shiro = [0]*N
ans = N

for i in range(N):
    if S[i] == "#":
        kuro[i] = 1
    else:
        shiro[i] = 1
shiro.reverse()
shiro = list(accumulate(shiro))
kuro = list(accumulate(kuro))

for i in range(N-1):
    ans = min(ans, kuro[i]+shiro[N-i-2])

ans = min(ans, kuro[N-1])
S = Counter(S)
ans = min(ans, S["#"], S["."])
print(ans)
# Judge status: Wrong Answer
for a in range (1,11):
    print(str(a+a*a+a*a*a))
# Judge status: Accepted
N,K=(int(x) for x in input().split())
lists=[0]*N
while 1:
    try:
        tmp=int(input())
    except :
        break
    have_count=(int(x) for x in input().split())
    for i in have_count:
        lists[i-1]=1
print(lists.count(0))
# Judge status: Wrong Answer
N,K=map(int,input().split())
A=list(map(int,input().split()))
imos=[0 for i in range(N+1)]
zero=[0 for i in range(N+1)]
for t in range(K):
  for i in range(N):
    l=max(0,i-A[i])
    r=min(N,i+A[i]+1)
    imos[l]+=1
    imos[r]-=1
  for i in range(0,N):
    imos[i+1]+=imos[i]
    A[i]=imos[i]
  imos=zero
  if len(set(A))==1 and (N in set(A)):
    break
for i in range(N):
  A[i]=str(A[i])
ans=" ".join(A)
print(ans)
# Judge status: Accepted
n = int(input())
numlist = list(map(int, input().split(" ")))

import collections

numcount=collections.Counter(numlist)


sum = 0
for i in numcount.values():
    sum += int(i * (i - 1) / 2)

for i in numlist:
    print(sum - numcount[i] + 1)
# Judge status: Accepted
n,k=map(int,input().split())
L=sorted(list(int(input()) for i in range(n)))
num=10**9
for i in range(n-k+1):
    num=min(num,L[i+k-1]-L[i])
print(num)
# Judge status: Accepted
X = int(input())

count = 0
num = 1
jamp_count = 0
while count < X:
    count += num
    num += 1
    jamp_count += 1

print(jamp_count)
# Judge status: Accepted
n,m=list(map(int,input().split()))
pre=[[] for i in range(n)]
pre_num=[[] for i in range(n)]
city=[]

for i in range(m):
  #pの県に属してy年にできた
  p,y=map(int,input().split())
  pre[p-1].append(y)
  city.append(p-1)

from bisect import bisect_right

for i in range(n):
  town=sorted(pre[i])
  for j in range(len(town)):
    pre_num[i].append(bisect_right(town,pre[i][j]))

cnt=[0 for i in range(n)]
for i in city:
  print(str(i+1).zfill(6)+str(pre_num[i][cnt[i]]).zfill(6))
  cnt[i]+=1
# Judge status: Accepted
A=[[int(i) for i in input().split(" ")]for k in range(3)]
N=int(input())
for i in range(N):
    b=int(input())
    for x,y in [(x,y) for x in range(3) for y in range(3) if A[x][y]==b]:
        A[x][y]=0

M=1
for k in range(3):
    M*=sum(A[i][k] for i in range(3))
    M*=sum(A[k][i] for i in range(3))
M*=sum(A[i][i] for i in range(3))
M*=sum(A[i][2-i] for i in range(3))
if M==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x = int(input())
ans = x//11 * 2
ans += 0 if x%11==0 else 1 if x%11<=6 else 2
print(ans)
# Judge status: Accepted
n = int(input())
s = list(map(int,input().split()))
t = 0
for i in range(n):
  s.append(i)

for i in range(n):
  if(s[i] == i + 1):
    t += 0
  else:
    t += 1
if(t == 0 or t == 2):
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
x,y = map(int,input().split())
mod = 10**9+7
def comb(a,b):
  comb = 1
  chld = 1
  for i in range(b):
    comb = comb*(a-i)%mod
    chld = chld*(b-i)%mod
  return (comb*pow(chld,mod-2,mod))%mod
if (x+y)%3!=0:
  print(0)
else:
  nm = (x+y)//3
  n = y-nm
  m = x-nm
  print(comb(n+m,m))
# Judge status: Accepted
import itertools
n,m,q = map(int,input().split())
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
    a[i],b[i],c[i],d[i] = map(int,input().split())
ans = 0
for A in itertools.combinations_with_replacement(range(1,m+1),n):
    cnt = 0
    for i in range(q):
        if A[b[i]-1] - A[a[i]-1] == c[i]:
            cnt += d[i]
    ans = max(ans,cnt)
print(ans)
# Judge status: Accepted
N, x=map(int, input().split())
a=list(map(int, input().split()))
out=0
tmp=a[0]+a[1]
if tmp>x:
  if tmp-x>a[1]:
    out+=a[1]
    a[1]=0
    y=tmp-x-out
    out+=y
  else:
    out+=tmp-x
    a[1]-=tmp-x
    
for i in range(1, N-1):
  tmp=a[i]+a[i+1]
  if tmp>x:
    out+=tmp-x
    a[i+1]-=tmp-x
    
print(out)
# Judge status: Accepted
N=int(input())
alist=[0]+list(map(int,input().split()))

answer=0
for i in range(1,N):
  if alist[i]==i:
    alist[i],alist[i+1]=alist[i+1],alist[i]
    answer+=1
    
if alist[N]==N:
  print(answer+1)
else:
  print(answer)
# Judge status: Accepted
n = int(input())
s = input()
x = 0
ans = 0
for i in range(n):
    if s[i] == "I":
        x += 1
    else:
        x -= 1
    ans = max(ans, x)
print(ans)
# Judge status: Accepted
N=list(map(int,input().split()))
N.append(N[0]-1)
N.append(N[1]-1)
N.sort(reverse=True)

print(sum(N[0:2]))
# Judge status: Accepted
import math
h = int(input())
w = int(input())
n = int(input())
if h < w:
    print(math.ceil(n/w))
else:
    print(math.ceil(n/h))
# Judge status: Accepted
import collections
n,s=int(input()),list(input())
l=(collections.Counter(s)).values()
ans=1
for x in l:
  ans*=(x+1)
print((ans-1)%(10**9+7))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
S = list(set(A))

if len(A) == len(S):
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
X = int(input())
 
a = X // 500
b = (X % 500) // 5
 
print(a + b)
# Judge status: Accepted
N,A,B,C,D=map(int,input().split())
str=input()

str_ac = str[A-1:C]
str_bd = str[B-1:D]
str_bd2 = str[B-2:D+1]
#print(str_bd)
#print(str_ac)
#print(str_bd2)

if C<D:
  if str_bd.find("##")!=-1 or str_ac.find("##")!=-1:
    print("No")
  else:
    print("Yes")
else:
  if str_bd.find("##")!=-1 or str_ac.find("##")!=-1:
    print("No")
  else:
    if str_bd2.find("...")!=-1:
      print("Yes")
    else:
      print("No")
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

At = [0]*(N+1)
Bt = [0]*(M+1)

for i in range(N):
  At[i+1] = At[i] + A[i]
for i in range(M):
  Bt[i+1] = Bt[i] + B[i]

j = M
ans = 0
for i in range(N+1):
  if At[i] > K:
    break
  while At[i] + Bt[j] > K:
    j = j - 1
  if ans < i + j:
  	ans = i+j 

print(ans)
# Judge status: Accepted
a=input()
b=input()

memo = []

def swap(word,x,y):
	word=word.replace(x,'+')
	word=word.replace(y,'-')
	word=word.replace('+',y)
	word=word.replace('-',x)
	return word
	
for i in range(len(a)):
	if a[i] != b[i]:
		if a[i] in memo or b[i] in memo:
			print('No')
			break
		else:
			a=swap(a,a[i],b[i])
			memo.append(a[i])
			memo.append(b[i])
	
else:
	if a==b:
		print('Yes')
	else:
		print('No')
# Judge status: Accepted
R=[0]
L=list()
N=int(input())
for i in range(N):
  k=int(input())
  L.append(k)
  if k==0:
    R.append(len(L))
S=sum(L)
R.append(N)
for i in range(len(R)-1):
  if sum(L[R[i]:R[i+1]])%2==1:
    S=S-1
print(S//2)
# Judge status: Accepted
n,m = map(int,input().split())
if n == m == 1:
    print(1)
elif n == 1 or m == 1:
    print((max(1,n-2))*(max(1,m-2)))
else:
    print((n-2)*(m-2))
# Judge status: Wrong Answer
X,Y=map(int,input().split())
print(X+Y/2)
# Judge status: Accepted
S = input()

if "L" in S[::2] or "R" in S[1::2]:
 print("No")
else:
 print("Yes")
# Judge status: Accepted
N, M = map(int, input().split())
a = [0] * N
b = [0] * N
c = [0] * M
d = [0] * M
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(M):
    c[i], d[i] = map(int, input().split())

for i in range(N):
    d1 = float('inf')
    for j in range(M):
        d2 = abs(a[i] - c[j]) + abs(b[i] - d[j])
        if d1 > d2:
            d1 = d2
            check = j + 1
    print(check)
# Judge status: Accepted
import heapq
N, M = map( int, input().split() )
A = list( map( int, input().split() ))
A = list( map( lambda x: -x, A ))
heapq.heapify( A )

for i in range( M ):
  a = - heapq.heappop(A) // 2
  heapq.heappush( A, - a )
  
print( - sum( A ))
# Judge status: Accepted
N,M=map(int,input().split())
*X,=sorted(map(int,input().split()))
print(sum(sorted([abs(X[i+1]-X[i]) for i in range(M-1)],reverse=True)[N-1:]))
# Judge status: Accepted
import sys
import math
import itertools
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]
#a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


n = ni()
a = na()

ans = a[0]

for ai in a[1:]:
    ans = gcd(ans, ai)
print(ans)
# Judge status: Accepted
f=lambda:map(int,input().split())
n,m,x=f()
lc,ll=[],[]
for _ in range(n):
  c,*l=f()
  lc.append(c)
  ll.append(l)
a=10**9
for i in range(2**n):
  lm=[0]*m
  t=0
  for j in range(n):
    if i>>j&1:
      for k in range(m):
        lm[k]+=ll[j][k]
      t+=lc[j]
  if all(s>=x for s in lm):
    a=min(a,t)
print(a if a<10**9 else -1)
# Judge status: Accepted
n=int(input())
s=sorted([int(input()) for i in range(n)])
S=sum(s)
if S%10!=0:
    print(S)
else:
    flag=False
    for i in s:
        tmp=S-i
        if tmp%10!=0:
            flag=True
            break
    print(tmp if flag else 0)
# Judge status: Accepted
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n#ペナ数
rig=[0]*n#ACorWA

for i in range(m):
    if ps[i][1]=="AC":
        rig[int(ps[i][0])-1]=1
    else:
        if rig[int(ps[i][0])-1]==0:
            pen[int(ps[i][0])-1]+=1
cnt1,cnt2=0,0
for i in range(n):
    if rig[i]==1:
        cnt1+=rig[i]
        cnt2+=pen[i]

print(str(cnt1)+" "+str(cnt2))
# Judge status: Wrong Answer
a,b = map(str,input().split())
for i in range(100):
    if int(a+b) == i**2:
        print('Yes')
        exit()

print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
dict = {}
b = [0,0]
c = [0,0]
for i in a:
	if i in dict:
		dict[i] += 1
	else:
		dict[i] = 1
	if dict[i] == 2:
		b.append(i)
	if dict[i] == 4:
		c.append(i)
b.sort(reverse=True)
c.sort(reverse=True)
print (max(b[0] * b[1],c[0]**2))
# Judge status: Wrong Answer
x=int(input())
a=0
b=0
for i in range(-500,500):
  for j in range(-100,100):
    if i**5-j**5==x:
      a=i
      b=j
      break
  else:
    continue
  break
print(a,b)
# Judge status: Accepted
# input
N = int(input())

# check
if N == 0:
    print(0)
    exit(0)

r_bits = ""
p = 0
d = 0
while N + p:
    if (N & 1) ^ p:
        r_bits += '1'
        if d ^ p:
            p ^= 1
    else:
        r_bits += '0'
    N >>= 1
    d ^= 1

print(r_bits[::-1])
# Judge status: Accepted
x = int(input())
q, r = divmod(x, 11)
if r == 0:
    print(2*q)
elif 0 < r <= 6:
    print(2*q+1)
else:
    print(2*q+2)