Harryxun/stf_run huggingface dataset:
cards = [
    "{} {}".format(s, r) for s in ('S', 'H', 'C', 'D') for r in range(1, 13 + 1)
]

count = int(input()

for n in range(count):
    card = input()
    cards.remove(card)

for n in cards:
    print(n)


### FIXED CODE ###

n = int(input())
cards = [[ s+' '+str(n) for n in range(1,14)] for s in ['S','H','C','D']]
for _ in range(n):
   suit,num = input().split()
   if   suit=='S': cards[0][int(num)-1] = 0
   elif suit=='H': cards[1][int(num)-1] = 0
   elif suit=='C': cards[2][int(num)-1] = 0
   elif suit=='D': cards[3][int(num)-1] = 0
for s in cards:
   for n in s:
       if n!=0: print(n)
import math

def nCm(n,m):
    return math.factorial(n) / (math.factorial(m)*(math.facorial(n-m)))

n = int(input())
kinds = 4**n
a = 7 + 10**9
answer = 0
q = 0
r = 0

p = 3 * nCm(n-2, 1)
if n > 6:
    q = 3 * nCm(n-4, 2)
if n > 9:    
    r = nCm(n-6, 3)

answer = (kinds - p + q -r) % a

print(int(answer))

### FIXED CODE ###

a = input()

if a == "A":
    print("T")
elif a == "C":
    print("G")
elif a == "G":
    print("C")
else:
    print("A")
p = str(input())
s = list(p)
k = int(input())

ss = list(set(sorted(s)))
zis = []
for i in ss:
    zis.append(i)
    indexes = [p for p, x in enumerate(s) if x == i]            
    count = 0
    onedict = []
    
    for ii in range(len(indexes)):
        onedict.append(i)
        
    while count <= len(s)  + 1 and len(onedict) <= k + 5:
        count = count + 1
        
        if True:
            quint = indexes
            for sss in range(len(onedict)):
                try:
                    pppp = onedict[sss]
                    pppp = pppp + s[ int(quint[sss])+ count]
                    onedict.append(pppp)
                except:
                    pass
    for jj in onedict:
        zis.append(jj)


zissort = list(sorted(list(set(zis))))

print(zissort[k-1])
                


### FIXED CODE ###


s = str(input())
k = int(input())
kouho = [s]

for i in range(len(s)):
    for plus in range(k+1):
        st = s[i:i + plus]
        kouho.append(st)
so = list(sorted(set(kouho)))
if '' in so:
    so.remove('')
    
print(so[k-1])
n,k =  map(int,input().split())
A = list(map(int,input().split()))

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [  int((A[i]-0.1)//(m)) for i in range(len(A)) ] )
    
    # print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m+=1
            break
        l=m+1
        

        
print(m)

### FIXED CODE ###

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

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    if m==0:
        m=1
        break

    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [  int((A[i]-0.1)//(m)) for i in range(len(A)) ] )
    
    # print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m+=1
            break
        l=m+1
        

        
print(m)
while(1):
    [m,n]=[int(x) for x in raw_input().split()]
    if m==0:
        break
    else:
        truenum=0
        player=[x for x in range(1,m+1)]
        for i in range(n):
            if len(player)>1:
                shout=raw_input()
                pnow=player.pop(0)
                truenum=truenum+1
                if truenum%15==0:
                    if shout=="FizzBuzz":
                        player.append(pnow)
                elif truenum%5==0:
                    if shout=="Buzz":
                        player.append(pnow)
                elif truenum%3==0:
                    if shout=="Fizz":
                        player.append(pnow)
                else:
                    if shout==str(truenum):
                        player.append(pnow)
        print " ".join([str(x) for x in sorted(player)])

### FIXED CODE ###

while(1):
    [m,n]=[int(x) for x in raw_input().split()]
    if m==0:
        break
    else:
        truenum=0
        player=[x for x in range(1,m+1)]
        for i in range(n):
            shout=raw_input()
            if len(player)>1:
                pnow=player.pop(0)
                truenum=truenum+1
                if truenum%15==0:
                    if shout=="FizzBuzz":
                        player.append(pnow)
                elif truenum%5==0:
                    if shout=="Buzz":
                        player.append(pnow)
                elif truenum%3==0:
                    if shout=="Fizz":
                        player.append(pnow)
                else:
                    if shout==str(truenum):
                        player.append(pnow)
        print " ".join([str(x) for x in sorted(player)])
# -*- coding: utf-8 -*-
n = int(input())
l = [int(input()) for i in range(n)]
if n > 1:
  for j in range(n):
    if max(l[:j]) - min(l[j:]) >= 2:
      print('No')
      exit()
print('Yes')

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
li = [int(a) for a in input().split()]
ans = 'Yes'

if n > 1:
  for i in range(n-1):
    if li[-(i+2)] <= li[-(i+1)]:
      pass
    elif li[-(i+2)] - 1 <= li[-(i+1)]:
      li[-(i+2)] = li[-(i+2)] - 1
    else:
      ans = 'No'
      break

print(ans)
from collections import deque
n,m,k = map(int, input().split())
A = deque(map(int, input().split()))
B = deque(map(int, input().split()))

a,b = A.popleft(), B.popleft()
ans = 0
ok = False
while k > 0:
    if ok: break
    if a < b and k-a >= 0:
        k -= a
        ans += 1
        if A: a = A.popleft()
        else: a = float("INF")
    elif a > b and k-b >= 0:
        k -= b
        ans += 1
        if B: b = B.popleft()
        else: b = float("INF")
    elif a == b:
        for i in range(min(len(A), len(B))):
            if A[i] == B[i]:
                if k-A[i] >=0: 
                    k-= A[i]
                    ans += 1
                else: 
                    ok = True
                continue
            if A[i] < B[i] and k-A[i] >= 0:
                k -= A[i]
                ans += 1
                A = A[i+1:]
            elif A[i] > B[i] and k-B[i]>=0:
                k -= B[i]
                ans += 1
                B = B[i+1:]
            else: ok = True
    else: break
print(ans)

### FIXED CODE ###

import numpy
import bisect
n,m,k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]+list(numpy.cumsum(A))
b = [0]+list(numpy.cumsum(B))
ans = 0
# print(a,b)
for i in range(len(a)):
    x = k - a[i]
    if x >= 0:
        j = bisect.bisect_right(b,x)-1
        ans = max(ans, i+j)
print(ans)
s = input().split()
a = int(s[0])
b, c = map(int, s[1].split())
print(a * b + a * c // 100)

### FIXED CODE ###

from decimal import Decimal
a, b = map(str, input().split())
num = list(str(Decimal(a) * Decimal(b)))
ans = ''
for i in num:
    if i == '.':
        break
    ans += i
print(ans)
def fib_memo(n):
  memo = [0]*(n+1)
  def _fib(n):
    if n <= 1:
      return n
    if memo[n] != 0:
      return memo[n]
    memo[n] = _fib(n-1) + _fib(n-2)
    return memo[n]
  return _fib(n)
  
N, M = map(int, input().split())
# A = [int(input()) for _ in range(M)]
A = range(M)
B = range(M)
for i in range(M):
  diff = 0
  if i == 0:
    diff = A[i] - 1
    # B[0] = fib_memo(diff + 1)
  else if i == (M - 1):
    diff = N - A[M - 1] -1
    # B[M-1] = fib_memo(diff + 1)
  else:
    diff = A[i] - A[i-1]
    # B[i] = fib_memo(diff + 1)
# Ans = reduce(lambda a, b: a*b, B)
Ans = 10
print(Ans % 1000000007)
    

### FIXED CODE ###

N, M = map(int, input().split())
A = [True] * (N+1)
for _ in range(M):
  idx = int(input())
  A[idx] = False

step = [0] * (N+1)
step[0] = 1
for i in range(1, N+1):
  if A[i]:
    step[i] = step[i-1] + step[i-2]
  else:
    step[i] = 0
print(step[N]%(10**9+7))
from functools import lru_cache

def main(S):
    con = 10**9 + 7

    @lru_cache(maxsize=1024)
    def get_c(iii):
        return [mm13[iii][j] % 13 for j in l10]

    l10 = list(range(10))
    l13 = list(range(13))
    m13 = {i: {j: (i + j) % 13 for j in l13} for i in l13}
    mm13 = {i: {j: (i * j) % 13 for j in range(11)} for i in range(100)}
    c = []
    iii = 1
    for i in range(len(S)):
        s = S[len(S) - i - 1]
        if s != "?":
            c.append(mm13[iii][int(s)])
        else:
            c.append(get_c(iii))
        iii = mm13[iii][10]

    _tdp = {i: 0 for i in l13}
    it = iter(c)
    pdp = {i: 1 for i in next(it)}
    d = 1
    for v in it:
        tdp = _tdp.copy()
        for r in v:
            for _r, _v in pdp.items():
                tdp[m13[_r][r]] += _v
        if d == 0:
            for i in l13:
                tdp[i] = tdp[i] % con
        d = (d + 1) % 50
        pdp = tdp

    ans = pdp.get(5, 0)
    print(ans % con)

if __name__ == "__main__":
    S = input()
    main(S)

### FIXED CODE ###

S = input()
con = 10**9 + 7

T = [s if s != "?" else "0" for s in S]
T = int(''.join(T))
SS = T % 13

def get_mod(S):
    c = {}
    iii = 1
    for i in range(len(S)):
        if S[len(S) - i - 1] != "?":
            iii *= 10
            iii %= 13
            continue
        c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
        iii *= 10
        iii %= 13
    return c
c = get_mod(S)

def get_tdp(pdp):
    tdp = {i: 0 for i in range(13)}
    for r in v.keys():
        for _r, _v in pdp.items():
            tdp[(_r + r) % 13] += _v
    for i in range(13):
        tdp[i] %= con
    return tdp

pdp = {i: 0 for i in range(13)}
pdp[SS] += 1
for k, v in c.items():
    pdp = get_tdp(pdp)

ans = pdp[5]
print(ans)
n = int(input())
x = input()

MAX = 2*10**5+1
ppc = [0]*MAX

def popcount(n):
  if ppc[n]>0:
    ppc[n]  
  if n == 0:
    return 0
  b = bin(n).count('1')  
  tmp = n%b
  ppc[n] = popcount(tmp) + 1
  return ppc[n]

for i in range(2*10**5):
  popcount(i+1)
  
bit = int('0b'+x,0)
bn = x.count('1')
for i in range(n,0,-1):
  tmp = bit ^ (1 << (i-1))
  if bit & (1 << (i-1)):
    bt = bn-1
  else:
    bt = bn+1    
  print(ppc[tmp%bt]+1)
  

### FIXED CODE ###

n = int(input())
X = input()

def goes_to_zero(n):
  cnt = 0
  while(n > 0):
    n %= bin(n).count('1')
    cnt += 1
  return cnt
  
c1 = X.count('1')
xint = int(X,2)
xtp = xint % (c1 + 1)
if (c1 - 1) == 0:  
  xtm = 0
else:
  xtm = xint % (c1 - 1)
  
for i in range(n)  :
  if X[i] == '0':
    print(goes_to_zero( (xtp + pow(2,n-1-i,(c1+1))) % (c1+1) ) + 1)
  else:
    if (c1-1) == 0:
      print(0)
    else:
      print(goes_to_zero( (xtm - pow(2,n-1-i,(c1-1)) ) % (c1-1) ) +1)
N=int(input())
X=[]
U=[]
for i in range(N):
    x,u=input().split()
    X.append(float(x))
    U.append(u)
    if U[i]=='BTC':
        X[i]=380000*x
print(sum(X))

### FIXED CODE ###

N=int(input())
X=[]
U=[]
for i in range(N):
    x,u=input().split()
    X.append(float(x))
    U.append(u)
    if U[i]=='BTC':
        X[i]=380000*X[i]
print(sum(X))
n = int(input())
hs = [int(s) for s in input().split()]
dp = [0]*n
dp[0], dp[1] = 0, abs(hs[1]-hs[0])
for i in range(2, n):
  dp(i) = min(dp[i-1] + abs (hs[i] - hs[i-1]), dp[i-2] + abs(hs[i] - hs[i-2]))
print(dp[-1])

### FIXED CODE ###

n = int(input())
hs = [int(s) for s in input().split()]
dp = [0]*n
dp[0], dp[1] = 0, abs(hs[1]-hs[0])
for i in range(2, n):
  dp[i] = min(dp[i-1] + abs (hs[i] - hs[i-1]), dp[i-2] + abs(hs[i] - hs[i-2]))
print(dp[-1])
D = ["A","B","H","I","K","R"]
C = {a:0 for a in D}
C = {"X":0}
S = input().strip()
for i in range(len(S)):
    if S[i] in D:
        C[S[i]] += 1
    else:
        C["X"] += 1
if C["A"]<=4 and C["B"]==1 and C["H"]==1 and C["I"]==1 and C["K"]==1 and C["R"]==1 and C["X"]==0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

from itertools import product
S = input().strip()
x = ["","K","I","H","","B","","R",""]
y = [0,4,6,8]
flag=0
for z in product((0,1),repeat=4):
    x1 = x[:]
    for i in range(4):
        if z[i]==1:
            x1[y[i]] = "A"
    x1 = "".join(x1)
    if x1==S:
        flag=1
        break
if flag==1:
    print("YES")
else:
    print("NO")
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,k=mp()
a=sorted(lmp())
ans=10**10
l=1
r=a[-1]
while True:
    if x==l and y==r:
        print(r)
        exit()
    m=(l+r)//2
    c=0
    for i in a:
        c+=-(-i//m)-1
    if c>k:
        l=m
    else:
        r=m


### FIXED CODE ###

import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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

def ok(s):
    c=0
    for i in a:
        c+=-(-i//s)-1
    return c<=k


l=0
r=max(a)
while r>l+1:
    md=(r+l)//2
    if ok(md):
        r=md
    else:
        l=md
print(r)
h, w = map(int, input().split())

if h % 3 == 0 or w % 3 == 0:
    print(0)
    exit()

def solve2(h, w):
    if h % 2 == 0 or w % 2 == 0:
        return [h*w // 2]
    elif h < w:
        return [h * (w//2), h * (w//2 + 1)]

def solve1(h, w):
    ans = []
    ans.append(max([(h//3) * w] + solve2(h - h//3, w)) - min([(h//3) * w] + solve2(h - h//3, w)))
    ans.append(max([(h//3 + 1) * w] + solve2(h - h//3 -1, w)) - min([(h//3 + 1) * w] + solve2(h - h//3 -1, w)))
    return min(ans)

print(min([solve1(h, w), solve1(w, h)]))

### FIXED CODE ###

h, w = map(int, input().split())

if h % 3 == 0 or w % 3 == 0:
    print(0)
    exit()

def solve2(h, w):
    if h % 2 == 0 or w % 2 == 0:
        return [h*w // 2]
    elif h < w:
        return [h * (w//2), h * (w//2 + 1)]
    else:
        return [w * (h//2), w * (h//2 + 1)]

def solve1(h, w):
    ans = []
    ans.append(max([(h//3) * w] + solve2(h - h//3, w)) - min([(h//3) * w] + solve2(h - h//3, w)))
    ans.append(max([(h//3 + 1) * w] + solve2(h - h//3 - 1, w)) - min([(h//3 + 1) * w] + solve2(h - h//3 - 1, w)))
    return min(ans)

print(min([solve1(h, w), solve1(w, h)]))
N=input()
H=list(map(int,input().split()))

cnt=0

for i in range(0,N):
  if max(H[0:i+1] <= H[i]:
    cnt+=1
print(cnt)


### FIXED CODE ###

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

cnt=0

for i in range(0,N):
  if max(H[0:i+1]) <= H[i]:
    cnt+=1
print(cnt)
import numpy as np
n = int(input())
m = int(input())

A = [[input() for i in range(n)] for i in range(m)]
b = [input() for i in range(m)]

c = A.dot(b)
print(c)


### FIXED CODE ###

n, m = map(int, input().split())
a = [[] for _ in range(n)]
for i in range(n):
  a[i] = list(map(int, input().split()))
b = [0 for _ in range(m)]
for i in range(m):
  b[i] = int(input())
for i in range(n):
  c = 0
  for j in range(m):
    c += a[i][j]*b[j]
  print(c)
N,M = int(input())
S = [list(map(int, input().split())) for i in range(M)]
for i in range(M):
  print(S.count('i'))

### FIXED CODE ###

N,M = map(int, input().split())
x = [0]*N
for i in range(M):
  a,b = map(int, input().split())
  x[a-1] += 1
  x[b-1] += 1
for i in range(N):
  print(x[i])
def solve(n, x, l):
    ans = 1
    d = 0
    for i in range(n)
        d += l[i]
        if d <= x:
            ans += 1
    return ans
    
n, x = map(int, input().split())
l = list(map(int, input().split()))
print(solve(n, x, l))


### FIXED CODE ###

def solve(n, x, l):
    ans = 1
    d = 0
    for i in range(n):
        d += l[i]
        if d <= x:
            ans += 1
    return ans

n, x = map(int, input().split())
l = list(map(int, input().split()))
print(solve(n, x, l))
N,R = map(int,input())

if N >= 10:
  print(R)
else:
  print(R-100*(10-N))

### FIXED CODE ###

N,R = map(int,input().split())

if N >= 10:
  print(R)
else:
  print(R+100*(10-N))
A,B = map(input().split())

if A + B >= 10:
    print('error')
else:
    print(A + B) 

### FIXED CODE ###

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

if A + B >= 10:
    print('error')
else:
    print(A + B)
a, b, m = map(int, input().split())
a_s = list(map(int, input().split()))
b_s = list(map(int, input().split()))
m_s =[]

for _ in range(m):
    m_s.append(list(map(int, input().split())))

mini = min(a_s) + min(b_s)

for am, bm, sale in m_s:
    mini = min(mini, a_s[am]+b_s[bm]-sale)

print(mini)

### FIXED CODE ###

a, b, m = map(int, input().split())
a_s = list(map(int, input().split()))
b_s = list(map(int, input().split()))
m_s =[]

for _ in range(m):
    m_s.append(list(map(int, input().split())))

mini = min(a_s) + min(b_s)

for am, bm, sale in m_s:
    mini = min(mini, a_s[am-1]+b_s[bm-1]-sale)

print(mini)
Ken, New = map(int, input().split())
if (Ken * 500) - New >= 0:
    print("Yes")
elif (Ken * 500) - New < 0:
    print("No")
else:
    

### FIXED CODE ###

Ken, New = map(int, input().split())
if (Ken * 500) - New >= 0:
    print("Yes")
elif (Ken * 500) - New < 0:
    print("No")
else:
    print("")
a,b,c = map(int,raw_input().split())

d = a + b
e = b  + c
f = a + c
print(min(d,e,f))


### FIXED CODE ###

# -*- coding: utf-8 -*-

#お店にあるベルは 3 種類で、それぞれ a円、 b円、 c円です。
#この 3 つのうち、異なる 2 つのベルを選んで買うときの、値段の合計の最小値を求めて下さい。

x = input().split()
#x = [700, 600, 780]

y =[int(x[0]), int(x[1]), int(x[2])]

z = sorted(y)

ans = z[0] + z[1]

print(ans)
a = input().split()
if a == 'Sunny':
  print('Cloudy')
else if a == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')


### FIXED CODE ###

a = input()
if a == 'Sunny':
  print('Cloudy')
elif a == 'Cloudy':
  print('Rainy')
elif a == 'Rainy':
  print('Sunny')
kk = K
while True:
    if kk >= A and kk <= 600:
        ans = 'OK'
        break
    elif  kk > 600:
        ans = 'NG'
        break
    else:
        kk = kk+K
print(ans)

### FIXED CODE ###

K = int(input())
A , B = (map(int , input().split()))
kk = K
while True:
    if kk >= A and kk <= B:
        ans = 'OK'
        break
    elif  kk > B:
        ans = 'NG'
        break
    else:
        kk = kk+K
print(ans)
a=int(input())
result=[]
for i in range(1,a+1):
    for j in range(2,a+1):
        if j>=10:
            continue
        if i**j<=a:
            result.append(i**j)
print(max(result))

### FIXED CODE ###

a=int(input())
result=[]
for i in range(1,a+1):
    for j in range(2,a+1):
        if j>=10:
            continue
        if i**j<=a:
            result.append(i**j)
result.append(1)
print(max(result))
print('YES' if input() == ''.join([e for e in reversed(list(input()))] else 'NO')

### FIXED CODE ###

print('YES' if input() == ''.join([e for e in reversed(list(input()))]) else 'NO')
, m = list(map(int, input().split(' ')))


# 再帰処理：関数の中でその関数自身が呼び出されること。→ 繰り返し処理の実装が可能
def conversion(_n, _m):
    if int(_n / _m):
        return conversion(int(_n / _m), _m) + str(_n % _m)
    return str(_n % _m)


print(conversion(n, m))


### FIXED CODE ###

n, m = list(map(int, input().split(' ')))


# 再帰処理：関数の中でその関数自身が呼び出されること。→ 繰り返し処理の実装が可能
def conversion(_n, _m):
    if int(_n / _m):
        return conversion(int(_n / _m), _m) + str(_n % _m)
    return str(_n % _m)


digit = (conversion(n, m))
print(len(digit))
def main():
    h,w,n=map(int,input().split(' '))
    draw_list=[]
    for i in range(n):
        draw=tuple(map(int,input().split(' ')))
        for j in range(3):
            for k in range(3):
                if 0<draw[0]-j<=h-2 and 0<draw[1]-k<=w-2:
                    draw_list.append((draw[0]-j,draw[1]-k))
    ans = [0]*9
    sorted_draw = sorted(draw_list)
    for n,i in enumerate(sorted_draw):
        if not n:
            ans_num=0
            tmp = i
            continue
        if tmp == i:
            ans_num+=1
        else:
            ans[ans_num] += 1
            tmp = i
            ans_num = 0
    ans[ans_num] += 1
    print((h-2)*(w-2)-sum(ans))
    for i in ans:
        print(i)



if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    h,w,n=map(int,input().split(' '))
    if n==0:
        print((h-2)*(w-2))
        for i in range(9):
            print(0)
        exit()
    draw_list=[]
    for i in range(n):
        draw=tuple(map(int,input().split(' ')))
        for j in range(3):
            for k in range(3):
                if 0<draw[0]-j<=h-2 and 0<draw[1]-k<=w-2:
                    draw_list.append((draw[0]-j,draw[1]-k))
    ans = [0]*9
    sorted_draw = sorted(draw_list)
    for n,i in enumerate(sorted_draw):
        if not n:
            ans_num=0
            tmp = i
            continue
        if tmp == i:
            ans_num+=1
        else:
            ans[ans_num] += 1
            tmp = i
            ans_num = 0
    ans[ans_num] += 1
    print((h-2)*(w-2)-sum(ans))
    for i in ans:
        print(i)



if __name__ == '__main__':
    main()
n, p = map(int, input().split())

s = input()

if 10 % p == 0:
    ans = sum(i + 1 for i, x in enumerate(s) if int(x) % p == 0)
    print(ans)
else:
    li = [0] * (n + 1)
    counter = {}
    for i, x in enumerate(s[::-1]):
        li[i+1] = (li[i] + (int(x) * (10**(i+1)) % p)) % p
        counter[li[i+1]] = counter.get(li[i+1], 0) + 1
    ans = 0
    ans = sum(v * (v - 1) for v in counter.values()) // 2
    ans += counter[0]
    print(ans)


### FIXED CODE ###

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

s = input()

if 10 % p == 0:
    ans = sum(i + 1 for i, x in enumerate(s) if int(x) % p == 0)
    print(ans)
else:
    counter = [0] * p
    counter[0] = 1
    cur = 0
    p10 = 1
    ans = 0
    for x in s[::-1]:
        cur = (cur + int(x) * p10) % p
        ans += counter[cur]
        counter[cur] += 1
        p10 *= 10
        p10 %= p
    print(ans)
A,B = map(int,input().split())

for i in range 100:
  C = A*i - i
  if C >= B:
    break
print(i)



### FIXED CODE ###

a = [int(i) for i in input().split()]
ans=0
num=0

while True:
    if a[1]==1:
        break
    if (a[0]-1)*num+a[0] >= a[1]:
        ans = num+1
        break
    num += 1
print(ans)
ab = int(input().split())
print(a*b, a*2+b*2, sep=" ")


### FIXED CODE ###

a, b = map(int, input().split())
print(a*b, 2*(a+b))
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
sam = []
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
ab = a[0] + b[0]
ac = a[0] + c[0]
bc = b[0] + c[0]
sam.append(a[0] + b[0] + c[0])
if len(a) > k:
	A = k
else:
	A = len(b)
if len(b) > k:
	B = k
else:
	B = len(b)
if len(c) > k:
	C = k
else:
	C = len(C)
for i in range(1,C):
	    sam.append(ab + c[K])
for i in range(1,B):
    	sam.append(ac + b[K])
for i in range(1,A):
    	sam.append(bc + a[K])
sam.sort(reverse=True)
for K in range(k):
	print(sam[K])

### FIXED CODE ###

X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
asort,bsort,csort = sorted(A,reverse=True),sorted(B,reverse=True),sorted(C,reverse=True)
print(asort[0] + bsort[0] + csort[0])
already = [[0,0,0]]
x,y,z = 0,0,0
place_sum = []
check = []
for k in range(K - 1):
    if [x + 1,y,z] not in already and x + 1 < X:
        already.append([x + 1,y,z])
        place_sum.append([x + 1,y,z])
        check.append(asort[x + 1] + bsort[y] + csort[z])
    if [x,y + 1,z] not in already and y + 1 < Y:
        already.append([x,y + 1,z])
        place_sum.append([x,y + 1,z])
        check.append(asort[x] + bsort[y + 1] + csort[z])
    if [x,y,z + 1] not in already and z + 1 < Z:
        already.append([x,y,z + 1])
        place_sum.append([x,y,z + 1])
        check.append(asort[x] + bsort[y] + csort[z + 1])
    print(max(check))
    x,y,z = place_sum[check.index(max(check))][0],place_sum[check.index(max(check))][1],place_sum[check.index(max(check))][2]
    place_sum.pop(check.index(max(check)))
    check.remove(max(check))
a = int(input())
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)
N = int(input())
A = list(map(int, input().split()))

cnt = 0 
for x in A:
  if A%2 == 1:
    cnt += 1
    
if cnt % 2 == 0:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

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

cnt = 0 
for x in A:
  if x%2 == 1:
    cnt += 1
    
if cnt % 2 == 0:
  print("YES")
else:
  print("NO")