Harryxun/stf_run huggingface dataset:
from collections import deque
n = int(input())
c = deque(input())

cnt = 0
l = c.popleft()
r = c.pop()
while c:
    if l == 'R':
        l = c.popleft()
    if r == 'W':
        r = c.pop()
    if l == 'W' and r == 'R':
        cnt += 1
        l = c.popleft()
        if not c:
            break
        r = c.pop()

print(cnt)

### FIXED CODE ###

n = int(input())
c = input()

cnt = 0
i = 0
j = n-1
while i < j:
    while c[i] == 'R' and i < j:
        i += 1
    while c[j] == 'W' and i < j:
        j -= 1
    if c[i] != 'W' or c[j] != 'R':
        break
    i += 1
    j -= 1
    cnt += 1

print(cnt)
import functools
import operator

n,m= map(int,input().split())
li=[int(input()) for i in range(m)]
l=len(li)
a=0
b=0
c=[]
for i in range(l):
  b=li[i]-1
  c.append(b-a)
  a=li[i]+1
c.append(n-(li[-1]+1))
c2=[i for i in c if i<0]
if sum(c2)<0:
  print(0)
else:
  def fib(n):
    x,y=1,2
    if n==1 or n==0:
      return x
    elif n==2:
      return y
    else:
      for i in range(n-2):
        x, y = y,x+y
      return y
  ans=list(map(fib,c))

  result = functools.reduce(operator.mul, ans)
  print(result%1000000007)

### FIXED CODE ###

import functools
import operator

n,m= map(int,input().split())
def fib(n):
  x,y=1,2
  if n==1 or n==0:
    return x
  elif n==2:
    return y
  else:
    for i in range(n-2):
      x, y = y,x+y
    return y
if m==0:
  print(fib(n)%1000000007)
else:
  li=[int(input()) for i in range(m)]
  l=len(li)
  a=0
  b=0
  c=[]
  for i in range(l):
    b=li[i]-1
    c.append(b-a)
    a=li[i]+1
  c.append(n-(li[-1]+1))
  c2=[i for i in c if i<0]
  if sum(c2)<0:
    print(0)
  else:
    ans=list(map(fib,c))
    result = functools.reduce(operator.mul, ans)
    print(result%1000000007)
S,T = input.split()
A,B = map(int, input().split())
U = input()

if S == U:
  A -= 1
else:
  B -= 1
  
print(A,B)

### FIXED CODE ###

S,T = input().split()
A,B = map(int, input().split())
U = input()
 
if S == U:
  A -= 1
else:
  B -= 1
  
print(A,B)
if y % 2 == 1:
    print('No')
else:
    for i in range(x + 1):
        foot = i * 2 + (x - i) * 4
        if foot == y:
            print('Yes')
            break

print('No')


### FIXED CODE ###

x, y = map(int, input().split())
if y % 2 == 1:
    print('No')
else:
    if 2 * x <= y <= 4 * x:
        print('Yes')
    else:
        print('No')
from  math import factorial
N = int(input())
N2=math.factorial(N)

print((N2)%(10 ** 9 + 7))

### FIXED CODE ###

N = int(input())
sum = 800 * N
otsuri = (N // 15) * 200

print(sum - otsuri)
def dfs (i,depth):
    if i >= depth-1:
        return 'bpppb'
    else:
        s = dfs(i+1,depth)
        return 'b' + s + 'p' + s + 'b'
n,x = map(int,input().split())
r = dfs(0,n)
print(r.count('p',0,x))

### FIXED CODE ###

a = []
p = []

def dfs (x,i,depth):

    if i <= 1:
        #print(x)
        if x == 0:
            return 0
        elif x == 1:
            return 1
        elif x == 2:
            return 2
        elif x >= 3:
            return 3
    else:
        #print(a[i],a[i]//2,x)
        if a[i]//2 < x  :
            x = x - a[i]//2 - 1
            #print("right>>>",p[i-1] + 1,x)
            return (p[i-1] + 1) + dfs(x,i-1,depth)
        elif a[i]//2 == x :
            #print("<<<mid>>>",1,x)
            return (1 + dfs(x-1,i-1,depth))
        else:
            #print("left<<<",0,x)
            if x - 1 <= 0:
                return 0
            else:
                return dfs(x-1,i-1,depth)

def ddff (i,depth):
    if i >= depth-1:
        return 'bpppb'
    else:
        return 'b' + ddff(i+1,depth) + 'p' + ddff(i+1,depth) + 'b'
 
n,x = map(int,input().split())

for i in range(n+1):
    p.append(2**(i+1)-1)
    b = 2**(i+1)-2
    a.append(p[i] + b)
#print(a,p)

r = dfs(x-1,n,n)
print(r)
L,R = map(int,input().split())
 
ans = 2019
m = []
for i in range(L,R+1):
	m.append(i%2019)

for i in range(len(m)):
	for j in range(i+1,len(m)):
		tmp = (m[i]*m[j])%2019
		if ans> tmp:
			ans = tmp
		if tmp = 0:
			break				
print(ans)

### FIXED CODE ###

L,R = map(int,input().split())
 
ans = 2019
m = []
l = R-L+1
if l < 2019:
	for i in range(L,R+1):
		m.append(i%2019)
else:
	for i in range(L,L+2019):
		m.append(i%2019)

for i in range(len(m)):
	for j in range(i+1,len(m)):
		tmp = (m[i]*m[j])%2019
		if ans> tmp:
			ans = tmp
		if tmp == 0:
			break				
print(ans)
n = int(input())
a = list(map(int, input().split()))
count = 0
exist_odd = False

while exist_odd == False:
    for i in range(n):
        if a[i] % 2 != 0:
            exist_odd = True
            if n != i:
                count -= 1
            break
        else:
            a[i] = a[i] / 2
    count += 1
print(count)

### FIXED CODE ###

s = input()
print(s.count('1'))
dp=["","+"]
s=input()
su=0
for i in range(2**(len(s)-1)):
    val=""
    for j in range(len(s)-1):
        val+=s[j]
        val+=dp[int(bin(i)[j+2])]
    val+=s[len(s)-1]
    su+=eval(val)
print(su)


### FIXED CODE ###

dp=["","+"]
s=input()
su=0
for i in range(2**(len(s)-1)):
    val=""
    b=bin(i)[2:].zfill(len(s)-1)
    for j in range(len(s)-1):
        val+=s[j]+dp[int(b[j])]
    val+=s[len(s)-1]
    su+=eval(val)
print(su)
n, k = map(int, input())
if n % k == 0:
  print(0)
else:
  print(1)

### FIXED CODE ###

n, k = map(int, input().split())
if n % k == 0:
  print(0)
else:
  print(1)
A,B = int(input())

if 2*B >= A:
  print(0)
else:
  print(A-2*B)

### FIXED CODE ###

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

if 2*B >= A:
  print(0)
else:
  print(A-2*B)
a1 = int(input())
a2 = int(input())
a3 = int(input())

if a1 + a2 + a3 > 21:
  print('bust')
else:
  print('win')

### FIXED CODE ###

a1, a2, a3 = (int(x) for x in input().split(' '))

if a1 + a2 + a3 > 21:
  print('bust')
else:
  print('win')
import math
a,b,c,d=map(int,input().split())

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

def amari(x,y):
    return x//y if x%y==0 else x//y+1

cnum=b//c-amari(a,c)+1
dnum=b//d-amari(a,d)+1
cdnum=b//lcm(c,d)-amari(a,lcm(c,d))+1

print(b-a+1-cnum-dnum+cdnum)

### FIXED CODE ###

import fractions
a,b,c,d=map(int,input().split())

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

def amari(x,y):
    return x//y if x%y==0 else x//y+1

cnum=b//c-amari(a,c)+1
dnum=b//d-amari(a,d)+1
cdnum=b//lcm(c,d)-amari(a,lcm(c,d))+1

print(b-a+1-cnum-dnum+cdnum)
N , Q = map(int,input().split())
stack = []
graph = [[] for _ in range(N)]
point = [0] * N
for _ in range(N - 1):
    a , b = map(int,input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
for _ in range(Q):
    a , b = map(int,input().split())
    a = a - 1
    point[a] += b

def dfs(now , prev = -1):
    for next in graph[now]:
        if next == prev:
            continue
        #print(now , next)
        #print(point)
        point[next] += point[now]
        dfs(next , now)

#print(point)
dfs(0)
print(*point)

### FIXED CODE ###

import sys

sys.setrecursionlimit(5 * 10**5)
input=sys.stdin.readline

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

M = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = list(map(int, input().split()))
    M[a-1].append(b-1)
    M[b-1].append(a-1)

ans = [0] * N
for _ in range(Q):
    p, x = list(map(int, input().split()))
    ans[p-1] += x

Q = [0]

while Q:
    current = Q.pop()

    for i in M[current]:
        ans[i] += ans[current]
        M[i].remove(current)

    Q += M[current]

print(' '.join(map(str, ans)))
def get_keys(d, val):
    return [k for k, v in d.items() if v == val]
    
def main():
    read = lambda: sys.stdin.readline().rstrip()
    
    N, K  = map(int,read().split())
    A = list(map(int,read().split()))
    
    g = collections.defaultdict(int)
    for i, val in enumerate(A):
        g[i + 1] = val
        
    v = collections.defaultdict(int)
    cnt = 0
    cur = 1
    p = 0
    mp = 0
    while True:
        if v[cur] > 0:
            p = cnt - v[cur]
            mp = v[cur]
            break
        v[cur] = cnt
        cnt += 1
        cur = g[cur]
    
    print(get_keys(v, (K-mp)%p + mp)[0] if K >= mp else get_keys(v, K)[0])


 
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import collections
#import cython
def get_keys(d, val):
    return [k for k, v in d.items() if v == val]
    
def main():
    read = lambda: sys.stdin.readline().rstrip()
    
    N, K  = map(int,read().split())
    A = list(map(int,read().split()))
    
    g = collections.defaultdict(int)
    for i, val in enumerate(A):
        g[i + 1] = val
        
    v = collections.defaultdict(int)
    cnt = 0
    cur = 1
    p = 0
    mp = 0
    while True:
        if v[cur] > 0 or cnt > 2*10**5:
            p = cnt - v[cur]
            mp = v[cur]
            break
        v[cur] = cnt
        cnt += 1
        cur = g[cur]
    
    print(get_keys(v, (K-mp)%p + mp)[0] if K >= mp else get_keys(v, K)[0])


 
if __name__ == "__main__":
    main()
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
kotei=k
ans=0
cnt=0

if kotei>=sum(a):
  cnt+=len(a)
else:
  x=kotei
  i=0
  while x>=0:
    x-=a[i]
    i+=1
    cnt+=1
  n=i
  ans=max(ans,cnt-1)

for j in range(n):
  i=0
  x+=a[n-1-j]
  cnt-=1
  while x>=0:
    x-=b[i]
    i+=1
    cnt+=1
  ans=max(ans,cnt-1)
  
print(ans)

### FIXED CODE ###

n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0

A,B=[0],[0]
for i in range(n):
  A.append(a[i]+A[i])
for i in range(m):
  B.append(b[i]+B[i])

for j in range(n+1):
  K=k-A[j]
  if K<0:
    break
  left=0
  right=m+1
  while left<right:
    mid=(left+right)//2
    if B[mid]>K:
      right=mid
    else:
      left=mid+1
  ans=max(ans,j+left-1)
print(ans)
iN,iK = [int(x) for x in input().split()]
aD = [int(x) for x in input().split()]
aUnList = sorted([x for x in range(10) if  x not in aD])
sN = str(iN)
iF = int(sN[0])

def fCheckDigit(sTarget,iPoint,aUnList,aRet,bRev):
    iL = len(sTarget)
    iF = int(sTarget[iPoint])
    aUpper = [x for x in aUnList if x >= iF]
    if bRev: #遡ってきたとき
        #もうひとつ上があるかどうか
        if len(aUpper) == 1 and aUpper[0] == iF : #==のとき。もうひとつ上はない
            if iPoint == 0:
                if aUnList[0] == 0:
                    return [str(aUnList[1])] + ["0"] * iL
                else:
                    return [str(aUnList[0])] * iL
            else:
                return fCheckDigit(sTarget,iPoint -1 , aUnList,aRet,True)
        else: #上の桁がある
            return aRet[0:iPoint]+[str(aUpper[1])]+[str(aUnList[0])]*(iL-1-iPoint)
    else: #順向
        if aUpper == []: #大きい数字がない
            if iPoint == 0:
                if aUnList[0] == 0:
                    return [str(aUnList[1])] + ["0"] * iL
                else:
                    return [str(aUnList[0])]*(iL+1)
            else:
                return fCheckDigit(sTarget,iPoint-1,aUnList,aRet,False)
        else:
            if aUpper[0] != iF:
                return aRet[0:iPoint]+[str(aUpper[0])] + [str(aUnList[0])]*(iL-1- iPoint)
            else:
                aRet.append(str(iF))
                if iPoint  < iL -1 :
                    return fCheckDigit(sTarget,iPoint+1,aUnList,aRet,False)
                else:
                    return aRet



print( ''.join(fCheckDigit(sN,0,aUnList,[],False)))


### FIXED CODE ###

iN,iK = [int(x) for x in input().split()]
aD = [int(x) for x in input().split()]
aUnList = sorted([x for x in range(10) if  x not in aD])
aUnList.sort()
sN = str(iN)
iF = int(sN[0])

def fCheckDigit(sTarget,iPoint,aUnList,aRet,bRev):
    iL = len(sTarget)
    iF = int(sTarget[iPoint])
    aUpper = [x for x in aUnList if x >= iF]
    aUpper.sort()
    if bRev: #遡ってきたとき
        #もうひとつ上があるかどうか
        if len(aUpper) == 1 : #==のとき。もうひとつ上はない
            if iPoint == 0:
                if aUnList[0] == 0:
                    return [str(aUnList[1])] + ["0"] * iL
                else:
                    return [str(aUnList[0])] * (iL + 1)
            else:
                return fCheckDigit(sTarget,iPoint -1 , aUnList,aRet,True)
        else: #上の桁がある
            return aRet[0:iPoint]+[str(aUpper[1])]+[str(aUnList[0])]*(iL-1-iPoint)
    else: #順向
        if aUpper == []: #大きい数字がない
            if iPoint == 0:
                if aUnList[0] == 0:
                    return [str(aUnList[1])] + ["0"] * iL
                else:
                    return [str(aUnList[0])]*(iL+1)
            else:
                return fCheckDigit(sTarget,iPoint-1,aUnList,aRet,True) #逆行する
        else:
            if aUpper[0] != iF:
                return aRet[0:iPoint]+[str(aUpper[0])] + [str(aUnList[0])]*(iL-1- iPoint)
            else:
                aRet.append(str(iF))
                if iPoint  < iL -1 :
                    return fCheckDigit(sTarget,iPoint+1,aUnList,aRet,False) #順行する
                else:
                    return aRet

print( ''.join(fCheckDigit(sN,0,aUnList,[],False)))
a_total, b_total = 0,0
for k in range(N):
    m = max(a)
    if k%2==0:
        a_total += m
    else:
        b_total += m
    a.remove(max(a))
print(a_total-b_total)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
a_total, b_total = 0,0
for k in range(N):
    m = max(a)
    if k%2==0:
        a_total += m
    else:
        b_total += m
    a.remove(max(a))
print(a_total-b_total)
# coding:utf-8
import math
X = int(input())
c = 0
x2 = X%100
for i in range(100000):
  x = 0
  if x2/5 >= 1 :
    x = math.floor(x2/5)
    x2 -= 5*x
  elif x2 / 4 >= 1 :
    x = math.floor(x2/4)
    x2 -= 4*x
  elif x2 / 3 >= 1 :
    x = math.floor(x2/3)
    x2 -= 3*x
  elif x2 / 2 >= 1 :
    x = math.floor(x2/2)
    x2 -= 2*x
  elif x2 / 1 == 1 :
    x = math.floor(x2/1)
    x2 -= 1*x
  c += x
  if x2 == 0:
    break
if X > c*100:
  print("1")
else :
  print("0")

### FIXED CODE ###

# coding:utf-8
m1,d1 = list(map(int, input().split()))
m2,d2 = list(map(int, input().split()))
if m1 != m2:
  print("1")
else:
  print("0")
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
out = 0
if a[0] == 0:
    for i in range(1,n//2+1):
        if a[2*i-1] == a[2*i] == 2*i:
            None
        else:
            out = 1
elif a[0] == 1:
    for i in range(n//2):
        if a[2*i] == a[2*i+1] == 2*i+1:
            None
        else:
            out = 1
else:
    out = 1
if out:
    print(0)
else:
    print(2**(n//2))

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
a.sort()
out = 0
if n == 1:
    if a[0] != 0:
        out = 1
elif a[0] == 0:
    if n%2 == 0:
        out = 1
    else:
        for i in range(1,n//2+1):
            if a[2*i-1] == a[2*i] and a[2*i] == 2*i:
                None
            else:
                out = 1
elif a[0] == 1:
    if n%2 == 1:
        out = 1
    else:
        for i in range(n//2):
            if a[2*i] == a[2*i+1] == 2*i+1:
                None
            else:
                out = 1
else:
    out = 1
if out:
    print(0)
else:
    a = 1
    for i in range(n//2):
        a *= 2
        a = a%(10**9+7)
    print(a)
S = list(map(int, input().split()))
S.sort()
if S.sort()==[5,5,7]:
  return(YES)
else: return(NO)

### FIXED CODE ###

S = list(map(int, input().split()))
S.sort()
if S == [5,5,7]:
  print("YES")
else:
  print("NO")
import numpy as np
import sys

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

N = tmp[0]
K = tmp[1]


# i = N % K

if N < K:
    print(N)
elif N == K:
    print(0)    
else:



    solve = [0] * K

    for i in range(0, K-1):
        solve[i] = N % (K - i)

    solve.reverse()

    for iter in range(0,K-1):
        if solve[iter] == 0:
            continue
        else:
            print(solve[iter])
            break
    print(0)




    # print(solve[1])


    # if K == 1:
    #     print(solve[0])
    # else:
    #     print(solve[1])




### FIXED CODE ###

import numpy as np

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

N = tmp[0]
K = tmp[1]


# i = N % K


# if N > K:
#     N = N + K

# solve = [0] * (K+1)

# for i in range(0, K-1):
#     solve[i] = N % (K - i)

solve = N % K
if solve > abs(solve - K):
    solve = abs(solve - K)

print(solve)

# solve.reverse()

# for iter in range(0,K-1):
#     if solve[iter] == 0:
#         continue
#     else:
#         print(solve[iter])
#         break
# print(0)
import sys
 
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mod = pow(10, 9)+7
zero = 0
plus = []
minus = []
for i in range(n):
  if a[i] == 0:
    zero += 1
  elif a[i] > 0:
    plus.append(a[i])
  else:
    minus.append(a[i])
 
P, M = len(plus), len(minus)
plus.sort(reverse=True)
minus.sort()
ans = 1
if n == k:
  for i in range(n):
    ans *= a[i]
    ans %= mod
elif P+M < k:
  ans = 0
elif P == 0 and k%2 ==1 :
  if zero >= 1:
    ans = 0
  else:
    minus.sort(reverse=True)
    for i in range(k):
      ans *= minus[i]
      ans %= mod
else:
  q = 0
  if k%2 == 1:
    ans *= plus[0]
    ans %= mod
  q = 1
  judge = []
  for i in range((P-q)//2):
    judge.append(plus[2*i+q]*plus[2*i+q+1])
  for i in range(M//2):
    judge.append(minus[2*i]*minus[2*i+1])
  judge.sort(reverse=True)
  for i in range(k//2):
    ans *= (judge[i]%mod)
    ans %= mod
 
print(ans)

### FIXED CODE ###

a = int(input())
 
mod = a % 1000

if mod == 0:
  print(0)
else:
  b = mod -1000
  c = int(abs(b))
 
  print(c)
import sys
from datetime import datetime

def main():
    line = sys.stdin.readline()
    today = datetime.strptime(line, "%Y/%m/%d")
    TBD = datetime(2019, 5, 1)
    if today < TBD:
        print("HEISEI")
    else:
        print("TBD")
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
from datetime import datetime

def main():
    line = sys.stdin.readline().strip()
    today = datetime.strptime(line, "%Y/%m/%d")
    TBD = datetime(2019, 5, 1)
    if today < TBD:
        print("Heisei")
    else:
        print("TBD")

if __name__ == "__main__":
    main()
A, B, C, X, Y = map(int, input().split())
not_in_C = A*X + B*Y
if X > Y:
  cost = 2 * C * Y 
  if A < C:
    cost += A * (X - Y)
  else:
    cost += 2 * C * (X - Y)
elif X < Y:
  cost = 2 * C * X
  if B < C:
    cost += B * (Y - X)
  else:
    cost += 2 * C * (Y - X)
print(min(not_in_C, cost))

### FIXED CODE ###

A, B, C, X, Y = map(int, input().split())
cost = A*X + B*Y
new_cost = cost
plus = 0
for i in range(1, max(X, Y)+1):
  if i <= min(X, Y):
    plus = - A - B + 2*C
  else:
    plus = -A + 2*C if X > Y else -B + 2*C
  if plus < 0:
    new_cost += plus
  else:
    break
print(new_cost)
import numpy as np

def main():
  n=int(input())
  s=np.array([ord(i) for i in input()])
  dp=np.zeros((n+1,n+1),dtype=int)
  ans=0
  for i in range(n-1,-1,-1):
    for j in range(n-1,i,-1):
      if s[i]==s[j]:
        dp[i][j]=dp[i+1][j+1]+1
        now=dp[i][j] if dp[i][j]<j-i else j-i
        if ans<now:
          ans=now
        #ans=max(ans,min(dp[i][j],j-i))
  #for i in dp:
  #  print(i)
  print(ans)      
        

if __name__=='__main__':
  main()

### FIXED CODE ###

def main():
  n=int(input())
  s=input()
  dp=[[0]*(n+1) for i in range(n+1)]
  for i in range(n-1,-1,-1):
    for j in range(n-1,i,-1):
      if s[i]==s[j]:
        dp[i][j]=dp[i+1][j+1]+1
  #for i in dp:
  #  print(i)
  
  ans=0
  for i in range(n-1):
    for j in range(i+1,n):
      ans=max(ans,min(j-i,dp[i][j]))
  print(ans)      
        

if __name__=='__main__':
  main()
a=input()
input()
input()
input()
e=input()
k=input()
print('Yay!' if (e-a)<=k else ':(')

### FIXED CODE ###

a=int(input())
b=input()
c=input()
d=input()
e=int(input())
k=int(input())
print('Yay!' if (e-a)<=k else ':(')
def d170(n,a):
    count=0
    sa=sorted(a)
    dp=[True for i in range(n)]
        return dp.count(True)
    
n=int(input())
a= list(map(int, input().split()))    
print(d170(n,a))
            

### FIXED CODE ###

def d170(n,a):
    k=max(a)+1
    count=0
    dp=[0 for i in range(k)]
    for x in a:
        if dp[x]!=0:
                dp[x]=2
                
        else:
            for j in range(x,k,x):
                     dp[j]+=1
    for x in a:
        if dp[x]==1:
            count+=1
    return count
    
n=int(input())
a=list(map(int, input().split()))    
print(d170(n,a))
x = map(int, raw_input().split())
print x ** 3

### FIXED CODE ###

x = int(input())
print (x ** 3)
s=input()
c=0
if(s[0]=='o')c+=700
if(s[1]=='o')c+=100
if(s[2]=='o')c+=100
print(c)

### FIXED CODE ###

s=input()
ans=700
for i in s:
  if i=='o':
    ans+=100
print(ans)
# coding: utf-8
import sys


def solve(a, begin, end, queue):
    #print(begin, end)
    if begin >= end:
        return
    if end - begin == 1:
        return
    maxx = sorted(list(map(abs, a[begin:end + 1])), reverse=True)[0]
    if maxx in a:
        m = a.index(maxx)
    else:
        m = a.index(-1 * maxx)
        maxx = -1 * maxx
    if maxx == 0:
        return []
    if maxx > 0:
        solve(a, begin, m - 1, queue)
        for i in range(max(0, m - 1), end):
            if a[i + 1] >= a[i]:
                continue
            else:
                a[i + 1] += a[i]
                queue.append((i, i + 1))
                if a[i + 1] < a[i]:
                    a[i + 1] += a[i]
                    queue.append((i, i + 1))
        return queue
    if maxx < 0:
        solve(a, m + 1, end, queue)
        for i in reversed(range(begin, min(len(a) - 1, m + 1))):
            if a[i] <= a[i + 1]:
                continue
            else:
                a[i] += a[i + 1]
                queue.append((i + 1, i))
                if a[i] > a[i + 1]:
                    a[i] += a[i + 1]
                    queue.append((i + 1, i))
        return queue


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    queue = solve(a, 0, len(a) - 1, [])
    print(len(queue))
    for i in range(len(queue)):
        print(queue[i][0] + 1, queue[i][1] + 1)
    for i in range(len(a)):
        #print(i, a[i])


### FIXED CODE ###

# coding: utf-8
import sys


def solve(a, begin, end, queue, cnt):
    #print(begin, end)
    if begin >= end:
        return
    maxx = sorted(list(map(abs, a[begin:end + 1])), reverse=True)[0]
    # print(maxx)
    if maxx in a[begin:end + 1]:
        m = a[begin:end + 1].index(maxx) + begin
    else:
        m = a[begin:end + 1].index(-1 * maxx) + begin
        maxx = -1 * maxx
    #print(m, maxx)
    if maxx == 0:
        return []
    if maxx > 0:
        solve(a, begin, m - 1, queue, cnt + 1)
        for i in range(max(0, m - 1), end):
            if a[i + 1] >= a[i]:
                continue
            else:
                a[i + 1] += a[i]
                queue.append((i, i + 1))
                if a[i + 1] < a[i]:
                    a[i + 1] += a[i]
                    queue.append((i, i + 1))
        return queue
    if maxx < 0:
        solve(a, m + 1, end, queue, cnt + 1)
        for i in reversed(range(begin, min(len(a) - 1, m + 1))):
            if a[i] <= a[i + 1]:
                continue
            else:
                a[i] += a[i + 1]
                queue.append((i + 1, i))
                if a[i] > a[i + 1]:
                    a[i] += a[i + 1]
                    queue.append((i + 1, i))
        return queue


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    queue = solve(a, 0, len(a) - 1, [], 0)
    print(len(queue))
    for i in range(len(queue)):
        print(queue[i][0] + 1, queue[i][1] + 1)
N, K = inpl()
if K == 1:
    print(0)
else:
    print(N-K)

### FIXED CODE ###

def inpl(): return list(map(int, input().split()))
N, K = inpl()
if K == 1:
    print(0)
else:
    print(N-K)
A,B = map(int,input().split)

if A%2==1 and B%2==1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A,B = map(int,input().split())
 
if A%2==1 and B%2==1:
    print("Yes")
else:
    print("No")
W,H,x,y=map(int,input().split())

#case1
a=x*H
b=(W-x)*H

if a>=b:
    case1=b
else:
    case1=a

#case2
c=W*y
d=W*(H-y)

if c>=d:
    case2=d
else:
    case2=c

if case1==case2:
    z=1

else:
    z=0

print("{0:.6f}".format(max(case1,case2)),z)


### FIXED CODE ###

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

if x<a:
    print("0")

else:
    print("10")