Harryxun/stf_run huggingface dataset:
R, C, K = map(int, input().split())
rcvs = [list(map(int, input().split())) for _ in range(K)]

rcvs = rcvs

for i in range(len(rcvs)):
    rcvs[i][0] -= 1
    rcvs[i][1] -= 1

rewards = [[0 for _ in range(C)] for _ in range(R)]


for rcv in rcvs:
    rewards[rcv[0],rcv[1]] = rcv[2]

dp = [[[0 for _ in range(4)] for _ in range(C+1)] for _ in range(R+1)]
answer = 0

for i in range(R):
    for j in range(C):
        reward = rewards[i][j]
        dp[i+1,j+1,0] = max(dp[i,j+1])
        dp[i+1,j+1,1] = dp[i+1,j+1,0] + reward
        
        for k in range(4): # move downside without selecting
            candidate = dp[i+1,j,k]
            dp[i+1,j+1,k] = max(dp[i+1,j,k], dp[i+1,j+1,k])
        if reward > 0:
            for k in range(3):
                dp[i+1,j+1,k+1] = max(dp[i+1,j,k]+reward,dp[i+1,j+1,k+1])
print(max(dp[-1,-1]))


### FIXED CODE ###

import sys
import numpy as np
import numba
from numba import njit, b1, i4, i8, f8
import sys

R, C, K = map(int, input().split())
rcvs = [list(map(int, input().split())) for _ in range(K)]
rcvs = np.array(rcvs, dtype=np.int64)

@njit(i8(i8[:,:]), cache=True)
def main(rcvs):
    rewards = np.zeros((R, C), dtype=np.int64)
    
    for i in range(len(rcvs)):
        rewards[rcvs[i][0]-1][rcvs[i][1]-1] = rcvs[i][2]
    
    dp = np.zeros((R+1, C+1, 4), dtype=np.int64)
    
    for i in range(R):
        for j in range(C):
            reward = rewards[i][j]
            dp[i+1][j+1][0] = max(dp[i][j+1])
            dp[i+1][j+1][1] = dp[i+1][j+1][0] + reward
            
            for k in range(4): # move downside without selecting
                dp[i+1][j+1][k] = max(dp[i+1][j][k], dp[i+1][j+1][k])
            if reward > 0:
                for k in range(3):
                    dp[i+1][j+1][k+1] = max(dp[i+1][j][k]+reward,dp[i+1][j+1][k+1])
    return max(dp[-1][-1])

print(main(rcvs))
n = input()
for i in range(0, n-1):
   R = map(int, raw_input().split())
minv = R[0]
maxv = R[1] - R[0]
for j in range(1, n-1):
   maxv = max(maxv, R[j] - minv) 
   minv = min(minv, R[j])
print maxv - minv

### FIXED CODE ###

n = input()
R = []
for i in range(0, n):
   R.append(int(raw_input()))

maxv = R[1] - R[0]
minv = R[0]

for v in range(1, n):
   if minv > R[v]:
      minv = R[v]
   elif maxv < R[v] - minv:
      maxv = R[v] - minv
print maxv
n=int(input())
s=list(input())
#前処理
for i in range(0,2*n,2):
    if s[i]=='W':
        s[i]='B'
    else:
        s[i]='W'

#Lの数を数えてRとマッチング
countL=0
ans=1
for i in range(2*n):
    if s[i]=='W':
        countL+=1
    else:
        ans*=countL
        if countL==0:
            print(0)
            exit()
        countL-=1
# 答えはansの階乗
ans=ans%(10**9+7)
for i in range(1,n+1):
    ans*=i
    ans%(10**9+7)
print(ans)




### FIXED CODE ###

m,d=map(int, input().split())
count=0
for i in range(1,m+1):
    for j in range(1,d+1):
        if j>=20 and j%10>=2:
            if (j%10)*((j-j%10)//10)==i:
                count+=1
print(count)
n,k = map(int,input().split())
A = list(map(int,input().split()))
B = []
B.append(A[0])
b = 1
ans = 1
while ans:
  a = b
  b = A[a-1]
  B.append(b)
  if len(B) == len(A):
    ans = 0

print(B[k])


### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
pos = 0
visit = [0] * N
move = []
roop = []
while visit[pos]!=2:
    if visit[pos]==0:
        move.append(pos)
    else:
        roop.append(pos)
    visit[pos] += 1
    pos = A[pos] - 1
if len(move)>K:
    print(move[K]+1)
else:
    print(roop[(K-(len(move)-len(roop)))%len(roop)]+1)
from collections import Counter
import sys
sys.setrecursionlimit(1000000)
N,M = map(int, input().split())
 
# 隣接リスト
l = [[] for i in range(N+1)] 
for i in range(M):
    ab = list(map(int, input().split()))
    a = min(ab)
    b = max(ab)
    l[a].append(b)

nodes_color = {node:0 for node in range(1, N+1)}#set([a for ab in ab_list for a in ab])}

def func(v,c):
    if nodes_color[v] == c:
        return True
    if nodes_color[v] == -c:
        return False
    
    if nodes_color[v] == 0:
        nodes_color[v] = c
    for node in l[v]:
        if not func(node, -c):
            return False
    
    return True

chk = func(1,1)

if chk:
    b,w = Counter(nodes_color.values()).values()
    print(int(b*w-M))
else:
    print(int(N*(N-1)/2-M))

### FIXED CODE ###

from collections import Counter
import sys
sys.setrecursionlimit(1000000)
N,M = map(int, input().split())
 
# 隣接リスト
l = [[] for i in range(N+1)] 
for i in range(M):
    a, b = list(map(int, input().split()))
    l[a].append(b)
    l[b].append(a)

nodes_color = {node:0 for node in range(1, N+1)}#set([a for ab in ab_list for a in ab])}

nibu = True
stack = [1]

nodes_color[1] = 1

while stack:
    node = stack.pop()
    for next_node in l[node]:
        if nodes_color[next_node]==0:
            stack.append(next_node)
            nodes_color[next_node] = - nodes_color[node]
        else:
            if nodes_color[next_node]==nodes_color[node]:
                nibu = False
                break
    if not nibu:
        break

if nibu:
    b,w = Counter(nodes_color.values()).values()
    print(int(b*w-M))
else:
    print(int(N*(N-1)/2-M))
from bisect import bisect_left

n,k=map(int,input().split())

l=[]
for i in range(n):
  a,b=nii()
  l.append([a,b])

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

a_l=[]
b_l=[]
for a,b in l:
  a_l.append(a)
  b_l.append(b)

b_rui=[0]
for i in range(1,n+1):
  b_rui.append(b_rui[i-1]+b_l[i-1])
b_rui=b_rui[1:]

inx=bisect_left(b_rui,k)
print(a_l[inx])

### FIXED CODE ###

n,k=map(int,input().split())
d={}
for i in range(n):
    a,b=map(int,input().split())
    if a in d.keys():
        d[a]+=b
    else:
        d[a]=b
l=sorted(d.keys())
cnt=0
for i in l:
    cnt+=d[i]
    if cnt>=k:
        print(i)
        exit()
s=list(map(str, input()))
s_=s.copy()
s.reverse()
a=s_[:int((len(s_)-1)/2)]
a_=a.copy()
a.reverse()
b=s_[int((len(s_)+3)/2)-1:]
b_=b.copy()
b.reverse()
if s_==s and a_==a and b_==b:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s=list(map(str, input()))
s_=s.copy()
s.reverse()
a=s_[:int((len(s_)-1)/2)]
a_=a.copy()
a.reverse()
b=s_[int((len(s_)+3)/2)-1:]
b_=b.copy()
b.reverse()
if s_==s and a_==a and b_==b:
    print('Yes')
else:
    print('No')
N, M = [int(nm) for nm in input().split()]
A = [-1]
for m in range(M):
  A.append(int(input()))
A.append(N+1)

import math
total_case = 1
for m in range(M+1):
  a1 = A[m]
  a2 = A[m+1]
  safe_stairs = a2 - a1 - 1
  if safe_stairs == 0:
    print(0)
    break
  howmany_jump1 = safe_stairs - 1
  mx_jump2 = howmany_jump1 // 2
  #２のジャンプは０回～（mx_jump2）回
  case = 0
  for j2 in range(mx_jump2 + 1):
    jump2 = j2
    jump1 = howmany_jump1 - (j2 * 2)
    c = math.factorial(jump1 + jump2) / (math.factorial(jump1) * math.factorial(jump2))
    case += c
  total_case *= case
else:
  ans = int(total_case % (10**9 + 7))
  print(ans)

### FIXED CODE ###

N, M = [int(nm) for nm in input().split()]
if M != 0:
  a = int(input())

C = [1, 0] # [-2段目, -1段目]
C += [0]*(N+10) # C = [-2段目, -1段目, 0段目, 1段目, 2段目, ...]
for n in range(0, N+1):
  if M == 0:
    C[n+2] = (C[n] + C[n+1]) % 1000000007
  else: # M > 0:
    if n != a:
      C[n+2] = (C[n] + C[n+1]) % 1000000007
    else: # n == a:
      C[n+2] = 0
      M -= 1
      if M > 0:
        a = int(input())

ans = C[N+2]  % 1000000007
print(ans)
import sys

S = input()

# S = 'akasaka'

N = len(S)

S_rev = S[::-1]
if S != S_rev:
    print('No')
    sys.exit(1)

sub_S = S[:int((N - 1)/2)]
sub_S_rev = S[int((N + 3)/2)-1:]
if sub_S != sub_S_rev:
    print('No')
    sys.exit(1)

print('Yes')

### FIXED CODE ###

import sys

S = input()

# S = 'akasaka'

N = len(S)

S_rev = S[::-1]
if S != S_rev:
    print('No')
    sys.exit(0)

sub_S = S[:int((N - 1)/2)]
sub_S_rev = S[int((N + 3)/2)-1:]
if sub_S != sub_S_rev:
    print('No')
    sys.exit(0)

print('Yes')
s=input()
n=int(input())
ans=0
flg=0
if len(s) == 1:
  print(-(-n//2))
else:
  for i in range(1,len(s)):
    if flg == 0 and s[i] == s[i-1]:
      flg = 1
    elif flg != 0 and s[i] == s[i-1]:
      flg += 1
    elif flg != 0:
      ans += -(-flg//2)
      flg = 0
ans += -(-flg//2)
ans *= n
if s[-1] != s[-2] and s[0] == s[-1]:
  ans += -(-n//2)
print(ans)

### FIXED CODE ###

s=input()
n=int(input())
ans=0
tmp=1
for i in range(len(s)-1):
  if s[i]==s[i+1]:
    tmp+=1
  else:
    ans+=tmp//2
    tmp=1
if tmp!=0:
  ans+=tmp//2
ans*=n
if len(s)!=1 and s[0]==s[-1]:
  top=0
  bottom=0
  for i in range(len(s)):
    if s[:i].count(s[0])==i:
      top=i
    if s[-i:].count(s[-1])==i:
      bottom=i
  if top!=len(s)-1:
    ans-=(top//2+bottom//2-(top+bottom)//2)*(n-1)
  elif len(s)%2==1:
    ans+=n//2
if len(s)==1:
  print(n//2)
else:
  print(ans)
n = int(input())
ary = [int(_) for _ in input().split()]
q = int(input())
qs = [int(_) for _ in input().split()]


def search(ind, s, q):

    if ind == n:
        return False

    else:
        tmp = ary[ind]

        if s + tmp == q:
            return True
        else:
            return search(ind + 1, s, q) or search(ind + 1, s + tmp, q)


for q in qs:
    if search(0, 0, q):
        print('yes')
    else:
        print('no')



### FIXED CODE ###

n = int(input())
ary = [int(_) for _ in input().split()]
q = int(input())
qs = [int(_) for _ in input().split()]


def search_rec(ind, s, q):
    if ind == n:
        return False
    else:
        tmp = ary[ind]
        if s + tmp == q:
            return True
        else:
            return search(ind + 1, s, q) or search(ind + 1, s + tmp, q)


def search(q):
    sum_ary = [0]

    for i in ary:
        for s in sum_ary:
            if s + i == q:
                return True
        sum_ary += [i + _ for _ in sum_ary]

    else:
        return False


for q in qs:
    if search(q):
        print('yes')
    else:
        print('no')
S = input()

# 1 <= |S| <= 26
# lowercase

import sys
import copy

if len(S) == 26:
    if S == "zyxwvutsrqponmlkjihgfedcba":
        ans = "-1"
        print(ans)
        sys.exit()

    else:
        original = copy.copy(S)
        np = ""
        for i in range(0, len(S)-2):
            print(i)
            if S[i] < S[i+1]:
                np += S[i]

            else:
                i = i - 1
                for j in reversed(range(i, len(S))):
                    # print("checking:", j)
                    # print("S[i], S[j]", S[i], ",", S[j])
                    if S[i] < S[j]:
                        np = np[:-1] + S[j]
                        tmp = S[i]
                        S = S[:i-1] + S[j] + S[i+1:]
                        S = S[:j-1] + tmp + S[j+1:]
                        # S[i+1:] = S[:i] + "".join(list(reversed(S[i+1:])))
                        # S = S[:i] + 
                        np += "".join(list(reversed(S[i+1:])))
                        break

        # print("np", np)
        for b in range(0, 27):
            if np[b] != original[b]:
                print(np[:b+1])
                exit()

        print(S)

            
else:
    hist = set(S)
    for c in range(0, 27):
        cand = chr(c+ord('a'))
        if cand not in hist:
            print(S+cand)
            sys.exit()

### FIXED CODE ###

S = input()

# 1 <= |S| <= 26
# lowercase

import sys
import copy

def next_permutation(a):
    for i in reversed(range(len(a) - 1)):
        if a[i] < a[i + 1]:
            break
    else:
        return False

    j = next(j for j in reversed(range(i + 1, len(a))) if a[i] < a[j])
    a[i], a[j] = a[j], a[i]
    a[i + 1:] = reversed(a[i + 1:])
    return True

if len(S) == 26:
    sl = list(S)
    if next_permutation(sl):
        np = "".join(sl)
        for b in range(0, 26):
            if np[b] != S[b]:
                print(np[:b+1])
                exit()

    else:
        print(-1)
        exit()
else:
    hist = set(S)
    for c in range(0, 27):
        cand = chr(c+ord('a'))
        if cand not in hist:
            print(S+cand)
            sys.exit()
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min(5,k-i+1)):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

### FIXED CODE ###

d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min({6,k-i+1})):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])
n = int(input())
s, t = input()
l = []
m = []
r = ""
for i in s:
  l.append(i)
for i in t:
  m.append(i)

for i in range(n):
  r += (l[i] + m[i])
print(r)

### FIXED CODE ###

n = int(input())
s, t = input().split(' ')
l = []
m = []
r = ""
for i in s:
  l.append(i)
for i in t:
  m.append(i)
 
for i in range(n):
  r += (l[i] + m[i])
print(r)
N=int(input())
s = [input() for i in range(N)]
M=int(input())
t = [input() for i in range(M)]
tmp=[0]
for i in range(N):
    point=0
    point+=s.count(s[i])
    point-=t.count(s[i])
    tmp.append(point)
print(max(tmp))

### FIXED CODE ###

A,B,C=map(int,input().split())
print('Yes'if A+B>=C else "No")
N, A, B = map(int, input().split())

print(sum(i for i in range(1,N+1)) if A<= sum(map(int, str(i))) <= B)

### FIXED CODE ###

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

print(sum(i for i in range(1,N+1) if A<= sum(map(int, str(i))) <= B))
n,k=map(int,input().split())
if k>((n-2)*(n-1))//2:
  print(-1)
else:
  ans=[]
  for a in range(1):
    for b in range(a+1,n):
        ans.append([a+1,b+1])
  i,j,cnt=2,3,0
  while cnt<((n-2)*(n-1))//2-k:
    while j<=n:
      ans.append([i,j])
      j+=1
      cnt+=1
      if cnt==((n-2)*(n-1))//2-k:
        break
    i+=1
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])

### FIXED CODE ###

s=input()
for i in range(3):
  if s[i]==s[i+1]:
    print('Bad')
    exit()
print('Good')
def test():
    k = int(input())
    if (k%2==0):
        n = (k//2)**2
        print(n)
    else :
        n = ((k//2)**2)+(k//2)
        print(n)
 
 
pair()

### FIXED CODE ###

k = int(input())
if k % 2 == 0:
    print((k // 2)**2)
else:
    print((k - (k // 2)) * (k // 2))
l=[]
r=[]
for i in range(m):
    a,b=map(int,input().split())
    l.append(a)
    r.append(b)

p=[]
q=[]    
for i in range(Q):
    c,d=map(int,input().split())
    p.append(c)
    q.append(d)
    
for i in range(Q):
    answer=0
    for j in range(m):
        if p[i]<=l[j] and r[j]<=q[i]:
            answer+=1
    print(answer)

### FIXED CODE ###

n,m,Q=map(int,input().split())

l=[]
r=[]
for i in range(m):
    a,b=map(int,input().split())
    l.append(a)
    r.append(b)

p=[]
q=[]    
for i in range(Q):
    c,d=map(int,input().split())
    p.append(c)
    q.append(d)

grid=[[0]*(n+1) for i in range(n+1)]

for i in range(m):
    grid[l[i]][r[i]]+=1

for i in range(1,n+1):
    for j in range(1,n+1):
        grid[i][j]+=grid[i-1][j]
        grid[i][j]+=grid[i][j-1]
        grid[i][j]-=grid[i-1][j-1]
    
for i in range(Q):
    print(grid[q[i]][q[i]]-grid[q[i]][p[i]-1]-grid[p[i]-1][q[i]]+grid[p[i]-1][p[i]-1])
from collections import defaultdict
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))
def inpl_str():
    '''
    一行に複数の文字
    '''
    return list(input().split())

n=inp()
a = inpl()
sorted_a = sorted(a,reverse=True)
place=defaultdict(lambda: [])
for i in range(n):
    place[a[i]].append(i+1)
ans = 0
dp=[[-INF]*(n+1) for i in range(n+1)]
dp[0][0] = 0
for i in range(n):
    if i!=0 and sorted_a[i] == sorted_a[i - 1]:
        index += 1
    else:
        index = 0
    for j in range(n):
        _place = place[sorted_a[i]][index]
        #右
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j] + sorted_a[i] * abs(n - (i - j) - _place))
        #左
        dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + sorted_a[i] *  abs(_place - j - 1))

print(max(dp[n]))

### FIXED CODE ###

INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))
def inpl_str():
    '''
    一行に複数の文字
    '''
    return list(input().split())

n=inp()
a = inpl()
sorted_a = sorted(a,reverse=True)
place=dict()
for i in range(n):
    if a[i] not in place:
        place[a[i]]=[i+1]
    else:
        place[a[i]].append(i+1)
ans = 0
dp=[[-INF]*(n+1) for i in range(n+1)]
dp[0][0] = 0
for i in range(n):
    if i!=0 and sorted_a[i] == sorted_a[i - 1]:
        index += 1
    else:
        index = 0
    for j in range(n):
        _place = place[sorted_a[i]][index]
        #右
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j] + sorted_a[i] * abs(n - (i - j) - _place))
        #左
        dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + sorted_a[i] *  abs(_place - j - 1))

print(max(dp[n]))
N,Q=map(int,input().split())
d={i:[] for i in range(1,N+1)}

ans=[0]*N
for i in range(1,N):
    a,b=map(int,input().split())
    d[a].append(b)

def f(n,x):
    if d[n]==[]:
        return 0
    for m in d[n]:
        ans[m-1]+=x
        f(m,x)

for i in range(Q):
    p,x=map(int,input().split())
    ans[p-1]+=x
    hoge=f(p,x)

for a in ans:
    print(a,end=' ')

### FIXED CODE ###

N,Q=map(int,input().split())
d=[[] for _ in range(N+1)]

ans=[0]*(N+1)
for i in range(1,N):
    a,b=map(int,input().split())
    d[a].append(b)
    d[b].append(a)

for i in range(Q):
    p,x=map(int,input().split())
    ans[p]+=x

from collections import deque
flag=[0]*(N+1)
q=deque([1])
while q:
    k=q.popleft()
    flag[k]=1
    for v in d[k]:
        if flag[v]==1:
            continue
        ans[v]+=ans[k]
        q.appendleft(v)

print(*ans[1:])
import collections

N = int(input())
a = list(map(int, input().split()))
if (len(a) != N or N > 100 or N < 1 or max(a) > 4800 or min(a < 1):
    exit()

sort=sorted(a, key=int)

for i in range(N):
    sort[i]=sort[i] // 400

normal=[i for i in sort if i < 8]
incredible=[i for i in sort if i >= 8]

min=len(collections.Counter(normal))
max=len(collections.Counter(normal)) + len(incredible)

min=1 if min < 1 else min
max=8 if max > 8 else max

print(min, max)


### FIXED CODE ###

import collections

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

for i in range(N):
    sort[i] = sort[i] // 400

normal = [i for i in sort if i < 8]
incredible = [i for i in sort if i >= 8]

min = len(collections.Counter(normal))
max = len(collections.Counter(normal)) + len(incredible)

min = 1 if min < 1 else min


print(min, max)
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a:
  s += 1 / a
print(1 / s)
  

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a:
  s += 1 / i
print(1 / s)
a,b,c = map(int,input().split())
def w(a,b):
    li=[]
    d = max(a,b)
    for i in range(d//2):
        if a%(i+1) == 0 and b%(i+1)==0:
            li.append(i+1)
    #print(li)
    print(li[c-1])
w(a,b)

### FIXED CODE ###

a,b,k = map(int,input().split())
c = []
for i in range(min(a,b)+1):
  if a%(i+1) == 0 and b%(i+1) == 0:
    c.append(i+1)
c.sort(reverse = True)
print(c[k-1])
import sys                                                   
l1 = list(map(int, input().split()))                         
N = l1[0]                                                    
M = l1[1]                                                    
                                                             
dat = []                                                     
                                                             
per_dis = [ [] for n in range(N+1)]                          
                                                             
for n in range(M):                                           
    x = list(map(int, input().split()))                      
    dat.append(x)                                            
                                                             
def bfs(start, goal):                                        
    visited = []                                             
    unvisited = [(start, 0)]                                 
    while unvisited:                                         
        now = unvisited[0]                                   
        unvisited = unvisited[1:]                            
        for next in per_dis[now[0]]:                         
            if next[0] not in visited:                       
                if next[0] == goal:                          
                    return now[1] + next[1]                  
                unvisited.append((next[0], now[1] + next[1]))
                visited.append(next[0])                      
    return None                                              
                                                             
for x in dat:                                                
    tmp = bfs(x[0], x[1])                                    
    if None == tmp:                                          
        per_dis[x[0]].append((x[1],x[2]))                    
        per_dis[x[1]].append((x[0],-x[2]))                   
    elif  x[2] != tmp:                                       
        print("No")                                          
        break;                                               
else:                                                        
    print("Yes")                                             

### FIXED CODE ###

a = int(input())   
b = int(input())   
c = int(input())   
                   
print((a-b)%c)
s = inpit()
ans = 0

for c in s:
  if c == "+":
    ans += 1
  else:
    ans -= 1

print(ans)

### FIXED CODE ###

s = input()
ans = 0

for c in s:
  if c == "+":
    ans += 1
  else:
    ans -= 1

print(ans)
def main():
    N,K,Q=map(int,input().split())
    sum2=[]
    score=[]
    for i in range(Q):
        num=int(input())
        comp[i][:num-1]=[-1]*[num-1]
        comp[i][num-1]=[0]
        comp[i][num:N]=[-1]*[N-num]
    for i in range(N):
        sum2.append(sum(comp[i]))
    for i,j in score,sum2:
        score.append(i+j)
    for s in score:
        if s>0:
            print('Yes')
        else:
            print('No')

if __name__=='__main__':
    main()


### FIXED CODE ###

n, k, q = map(int, input().split())
points = [k] * n
a = []
for i in range(q):
    a.append(int(input())-1)
for cand in a:
    points[cand] += 1
points = [i-q for i in points]
ans = ["Yes" if i > 0 else "No" for i in points]
print(*ans, sep="\n")
import sympy
N = int(input())
A = [int(i) for i in input().split()]
ans = [x*2]

x = sympy.Symbol('x')
s = x
for i in range(1, N):
    s = A[i-1]-s
    ans.append(s*2)
    
sol = sympy.solve(A[N-1]-s-x)[0]
for i in range(N):
    ans[i] = ans[i].subs(x, sol)
print(ans)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
s = 0

for i in range(N):
    s = A[i]-s
    
s = s//2
ans = [s*2]
for i in range(1,N):
    s = A[i-1] - s
    ans.append(s*2)
    
for i in range(N):
    print(ans[i], end = " ")
n = input()
m = n.split()
print(m)
a = [input() for l in range(0,1)]
b = a[0].split()
print(b)

for i in range(0, len(b)):
    b[i] = int(b[i])

c = sorted(b, reverse=True)
print(c)
p = 0
for i in range(int(m[0]) - int(m[1])+1,int(m[0])+1):
    p = p + int(c[i])
print(int(p))

### FIXED CODE ###

n = input()
m = n.split()
a = [input() for l in range(0,1)]
b = a[0].split()
for i in range(0, len(b)):
    b[i] = int(b[i])
c = sorted(b, reverse=True)
p = 0
for i in range(int(m[0]) - int(m[1]),int(m[0])):
    p = p + int(c[i])
print(p)
[a,b]=[int(i) for i in input().split()]

print(int(a+b/2)


### FIXED CODE ###

[a,b]=[int(i) for i in input().split()]

print(int(a+b/2))
A=10000
B=5000
C=1000
x,y=map(int,input().split())
for a in range(x):
  for b in range(x-a):
    for c in range(x-a-b):
      if a*A+b*B+c*C=y:
        ans_A=a
        ans_B=b
        ans_C=c
        break
print(ans_A,ans_B,ans_C)
      

### FIXED CODE ###

A=10000
B=5000
C=1000
ans_A=-1
ans_B=-1
ans_C=-1
x,y=map(int,input().split())
for a in range(x+1):
  for b in range(x-a+1):
    c=x-a-b
    if a*A+b*B+c*C==y:
      ans_A=a
      ans_B=b
      ans_C=c
print(ans_A,ans_B,ans_C)