Harryxun/stf_run huggingface dataset:
import sys


def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            c[k] = 0
        elif db in k:
            print('yes')
        else:
            print('no')


main()

### FIXED CODE ###

import sys


def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no')


main()
w, h, x, y, r = map(int, raw_input().split())
if x>=r and y>=r and x+r<=w an y+r<=h:
	print "Yes"
else:
	print "No"

### FIXED CODE ###

w, h, x, y, r = map(int, raw_input().split())
if x>=r and y>=r and x+r<=w and y+r<=h:
	print "Yes"
else:
	print "No"
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    s = S()
    a = s.count("-")
    b = s.count("+")
    print(b-a)
    return

#B
def B():
    n = S()
    num = sum(map(int, n))
    n = int("".join(n))
    print(["Yes", "No"][n % num > 0])
    return

#C
def C():
    n, k = LI()
    a = LI()
    one = a.index(a, 1)
    if k == n:
        print(1)
        return
    ans = 0
    i = one
    while i < n:
        ans += 1
        i += k - 1
    i = one
    while i >= 0:
        ans += 1
        i -= k - 1
    print(ans)
    return

#D
def D():
    return


#Solve
if __name__ == '__main__':
    C()

### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    s = S()
    a = s.count("-")
    b = s.count("+")
    print(b-a)
    return

#B
def B():
    n = S()
    num = sum(map(int, n))
    n = int("".join(n))
    print(["Yes", "No"][n % num > 0])
    return

#C
def C():
    n, k = LI()
    LI()
    print((n - k) // (k - 1) + 1 + bool((n - k) % (k - 1)))
    return

#D
def D():
    return


#Solve
if __name__ == '__main__':
    C()
n=int(input())
ans = 0
for i in range(1, n+1):
    ans += (n//i) * (int(n/i)+1))//2*i;
print(ans)

### FIXED CODE ###

n=int(input())
ans = 0
for i in range(1, n+1):
    ans += (n//i) * ((n//i)+1)//2*i;
print(ans)
n, a b = map(int, input().split())
ans = n// (a + b)
rem = n % (a + b)
ans += min(rem, A)
prnit(ans)

### FIXED CODE ###

n , a, b = map(int, input().split())
ans = n//(a + b) * a
rem = n % (a + b)
ans += min(rem, a)
print(ans)
import numpy as np
from numba import njit
MOD = 10**9 + 7

def main():
 
    N = int(input())
    aff = np.array([list(map(int, input().split())) for i in range(N)], dtype='int32')
    dpt = np.zeros((N+1, 1<<N), dtype='int64')
    dpt[0][0] = 1

    print(solve(N, aff, dpt))

@njit('i8(i8,i4[:,:],i8[:,:])', cache=True)
def solve(N, aff, dpt):
    for i, row in enumerate(aff):
        for idx, v in enumerate(row):
            if v == 1:
                dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
        dpt[i+1] %= MOD
    return dpt[N][(1<<N)-1]

if __name__ == '__main__':
    main()

### FIXED CODE ###

import numpy as np

MOD = 10**9 + 7
 
N = int(input())
aff = np.array([map(int, input().split()) for i in range(N)])
dpt = np.zeros((N+1, 1<<N), dtype='int64')
dpt[0][0] = 1

for i, row in enumerate(aff):
    for idx, v in enumerate(row):
        if v == 1:
            dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
    dpt[i+1] %= MOD

print(dpt[N][(1<<N)-1])
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()

x = min(a, b, c, d, e)
y = max(a, b, c, d, e)
if (y - x) <= k:
  print('Yay!')
else:
  print(':(')

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

x = min(a, b, c, d, e)
y = max(a, b, c, d, e)
if (y - x) <= k:
    print('Yay!')
else:
    print(':(')
h, n = [int(x) for x in input().split()]
listk = [int(x) for x in input().split()]
listk.sort()
count = 0
for i in range(0,n):
    listk.pop()
print(sum(listk))

### FIXED CODE ###

h, n = [int(x) for x in input().split()]
listk = [int(x) for x in input().split()]
listk.sort()
if n <= h:
    for i in range(0,n):
        listk.pop()
else:
    for i in range(0,h):
        listk.pop()
print(sum(listk))
import math
A, B, C, D = map(int, input().split())

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

C_comp = B//C - (A-1)//C
D_comp = B//D - (A-1)//D
CD_comp = B//lcm(C,D) - (A-1)//lcm(C,D)

print((B - A + 1) - (C_comp + D_comp - CD_comp))


### FIXED CODE ###

import fractions
A, B, C, D = map(int, input().split())

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

C_comp = (B//C) - ((A-1)//C)
D_comp = (B//D) - ((A-1)//D)
CD_comp = (B//lcm(C,D)) - ((A-1)//lcm(C,D))

print((B - A + 1) - (C_comp + D_comp - CD_comp))
N = int(input())
S = input()

#for i in range(0,N-2):
#    for j in range(i+1,N-1):
#        if S[i] != S[j]:
#            for k in range(j+1,N):
#                if j-i != k-j:
#                    if S[j] != S[k] and S[k] != S[i]:
#                        count += 1
#print(count)

r = list()
g = list()
b = list()

for i in range(N):
    if S[i] == "R":
        r.append(i)
    elif S[i] == "G":
        g.append(i)
    else:
        b.append(i)

bb = len(b)
gg = len(g)
rr = len(r)

sum = len(r) * len(g) * len(b)
for i in range(bb-1):
    for j in range(i+1,gg):
        if 2*j - i <= 0:
            k = 2*j - i
        if i - j == k - j:
            sum -=1
        #if abs(abs(g[j] - b[i]) - b[i]) in r:
#        if (abs(b[i] - abs(g[j] - b[i])) in r) or (b[i] + abs(g[j] - b[i]) in r):
#            sum -=1
        #elif abs(abs(g[j] - b[i]) - g[j]) in r:
#        elif (abs(g[j] - abs(g[j] - b[i])) in r) or (g[j] + abs(g[j] - b[i]) in r):
#            sum -=1
#        elif (abs(r[j] - abs(r[j] - b[i])) in g) or (r[j] + abs(r[j] - b[i]) in g):
#            sum -=1
#        for k in range(rr):
#            if abs(r[k] - g[j]) == abs(g[j] - b[i]) or abs(g[j] - b[i]) == abs(b[i] - r[k]) or abs(b[i] - r[k]) == abs(r[k] - g[j]):
#                count += 1
print(sum)


### FIXED CODE ###

N = int(input())
S = "A"
S += input()
r = 0
g = 0
b = 0
k = 0
for i in range(1, N+1):
    if S[i] == "R":
        r += 1
    elif S[i] == "G":
        g += 1
    else:
        b += 1

sum = r * g * b
for i in range(1, N-1):
    for j in range(i+1,N):
        k = 2*j - i
        if k <= N:
            if S[j] != S[i] and S[k] != S[j] and S[i] != S[k]:
                sum -= 1

print(sum)
import math
a,b=map(int, input().split())
print(a*b//math.gcd(a,b))

### FIXED CODE ###

import fractions
a,b=map(int, input().split())
print(a*b//fractions.gcd(a,b))
def read():
    return int(input())


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


def readmap():
    return map(int, input().split())


N, K = readmap()
A = readlist()

cnt = [0] * 50  # cnt[i] は 2^i の桁の 1 の数

for a in A:
    i = 0
    while a:
        if a % 2:
            cnt[i] += 1
        i += 1
        a = a // 2

is_zero = [False] * 50

for i in range(50):
    if 2 * cnt[i] >= N:
        is_zero[i] = True

candidate = []

for i in range(50):
    if 2**i <= K:
        c = 0
        for j in reversed(range(i+1)):
            if (not is_zero[j]) and c + 2 ** j <= K:
                c += 2 ** j
        candidate.append(c)

can = [sum([c ^ a for a in A]) for c in candidate]

print(max(can))

### FIXED CODE ###

def read():
    return int(input())


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


def readmap():
    return map(int, input().split())


N, K = readmap()
A = readlist()

cnt = [0] * 50  # cnt[i] は 2^i の桁の 1 の数

for a in A:
    i = 0
    while a:
        if a % 2:
            cnt[i] += 1
        i += 1
        a = a // 2

is_zero = [False] * 50

for i in range(50):
    if 2 * cnt[i] >= N:
        is_zero[i] = True

candidate = [0]

for i in range(49):
    if 2**i <= K:
        c = 0
        for j in reversed(range(i+1)):
            if (not is_zero[j]) and c + 2 ** j <= K:
                c += 2 ** j
        candidate.append(c)

can = [sum([c ^ a for a in A]) for c in candidate]

print(max(can))
import numpy as np
from numba import njit, i8, jitclass
import sys

spec = [
    ("size", i8),
    ("tree", i8[:])
]


@jitclass(spec)
class Bit:
    def __init__(self, n, arr):
        self.size = n
        self.tree = np.array([0] + arr, np.int64)
        for i in range(1, n+1):
            self.tree[i + 1 | i + 2] += self.tree[i]

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

    def range_sum(self, l, r):
        return self.sum(r) - self.sum(l)


def main():
    n, q = map(int, sys.stdin.buffer.readline().split())
    bit = Bit(n, list(map(int, sys.stdin.buffer.readline().split())))
    for x in sys.stdin.buffer.readlines():
        q, p, x = map(int, x.split())
        if q:
            print(bit.range_sum(p, x))
        else:
            bit.add(p+1, x)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys


class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


def main():
    n, q = map(int, sys.stdin.buffer.readline().split())
    bit = Bit(n)
    a = list(map(int, sys.stdin.buffer.readline().split()))
    for i in range(n):
        bit.add(i+1, a[i])
    for x in sys.stdin.buffer.readlines():
        q, p, x = map(int, x.split())
        if q:
            print(bit.sum(x) - bit.sum(p))
        else:
            bit.add(p+1, x)


if __name__ == "__main__":
    main()
a,b,c = map(decimal, input().split())
if abs((a**0.5) + (b**0.5)) < abs(c**0.5):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c = map(int, input().split())
d = c-a-b
if d > 0 and d**2 > 4*a*b:
  print("Yes")
else:
  print("No")
import numpy as np
N, M ,C = map(int, input().split())
a = []
for i in range(N+1):
    a.append(list(map(int, input().split())))
all = np.array(a)
sum = 0
num = 0

for i in range(N):
    mul = np.sum(all[0] * all[i+1]) + C
    if mul > 0:
        num += 1
    mul = 0

print(num)

### FIXED CODE ###

import numpy as np
N, M ,C = map(int, input().split())
a = []
for i in range(N+1):
    a.append(list(map(int, input().split())))
all = np.array(a)
sum = 0
num = 0

for i in range(N):
    mul = np.sum(all[0] * all[i+1]) + C
    if mul > 0:
        num += 1
    mul = 0

print(num)
S = input()
T = input()

for i in range(len(T), 0, -1):
    for j in range(len(T)-i+1):
        subst = T[j:i+j]
        print(subst)
        if S.find(subst, j, len(S)-(len(T)-i-j))>=0:
            print (len(T)-i)
#            print(subst)
            exit(0)



### FIXED CODE ###

S = input()
T = input()

def matchcount(x, y):
    ret = 0
    for i in range(len(x)):
        if x[i] == y[i]: ret += 1
    return ret

rec = len(T)
for i in range(len(S)-len(T)+1):
    subst = S[i:i+len(T)]
#    print(subst, matchcount(subst, T))
    rec = min(rec, len(T) - matchcount(subst, T))

print(rec)
import numpy as np
from sys import stdin

def main():
    nm = [int(x) for x in stdin.readline().rstrip().split()]
    gate = np.zeros([nm[1], 2])
    card = np.full([nm[0]], True)
    
    for i in range(nm[1]):
        g = [int(x) for x in stdin.readline().rstrip().split()]
        gate[i] = g
    for g in gate:
        for k in range(len(card)):
            if k < g[0]-1 or k >= g[1]:
                card[k] = False
    
    c = np.zeros_like(card)[card]
    print(len(c))

if __name__ == "__main__":
    main()

### FIXED CODE ###

import numpy as np
from sys import stdin

def main():
    nm = [int(x) for x in stdin.readline().rstrip().split()]
    gate = np.zeros([nm[1], 2], dtype=int)
    
    for i in range(nm[1]):
        g = [int(x) for x in stdin.readline().rstrip().split()]
        gate[i] = g
    
    l_max = np.max(gate[:, 0])
    r_min = np.min(gate[:, 1])
    c = 0
    if l_max <= r_min:
        c = r_min-l_max+1
    print(c)

if __name__ == "__main__":
    main()
if all(X//500<=A X%500<=(100*B+50*C) (X%500)%100<=C*50):
    print
    

### FIXED CODE ###

#Coins
A=int(input())
B=int(input())
C=int(input())
X=int(input())

i=0
#j=0 ここに入れるとだめ
ans=0
while i <=A:
    X_aftera=X-500*i
    if X_aftera<0:
        break
    j=0
    while j<=B:
        X_afterb=X_aftera-100*j
        if X_afterb<0:
            break
        if X_afterb//50<=C:
            ans +=1
        j+=1
    i+=1
print(ans)
r = int(input())

### FIXED CODE ###

r = float(input())

s = r * r * 3.14159265358979
l = 2 * r * 3.14159265358979
 
print(s, end = " ")
print(l)
a = input().split()

b = [int(x) for x in input().split()]

c = input()

if c == a[0] && :
  b[0]-=1
elif c == a[1]:
  b[1]-=1

if b[0] < 0:
  b[0] = 0
if b[1] < 0:
  b[1] = 0
print("{} {}".format(*b))

### FIXED CODE ###

a = input().split()
 
b = [int(x) for x in input().split()]
 
c = input()
 
if c == a[0]:
  b[0]-=1
elif c == a[1]:
  b[1]-=1
 
if b[0] < 0:
  b[0] = 0
if b[1] < 0:
  b[1] = 0
print("{} {}".format(*b))
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra

n, m, l = map(int, input().split())
abc = []
for _ in range(m):
    abc.append(map(int, input().split()))
q = int(input())
st = []
for _ in range(q):
    s, t = map(int, input().split())
    s -= 1
    t -= 1
    st.append((s,t))

adjacency_matrix = np.zeros((n, n))
for (a, b, c) in abc:
    adjacency_matrix[a-1][b-1] = c
    adjacency_matrix[b-1][a-1] = c

shotest = dijkstra(adjacency_matrix)
fuel_once = np.where(shotest <= l, 1, 0)
fuel_times = dijkstra(fuel_once).astype(int)

for tap in st:
    s, t = tap
    if shotest[s][t] < np.inf:
        print(fuel_times[s][t] - 1)
    else:
        print(-1)


### FIXED CODE ###

import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra

n, m, l = map(int, input().split())
abc = []
for _ in range(m):
    abc.append(map(int, input().split()))
q = int(input())
st = []
for _ in range(q):
    st.append(map(int, input().split()))

adjacency_matrix = np.zeros((n, n))
for a, b, c in abc:
    adjacency_matrix[a-1, b-1] = c
    adjacency_matrix[b-1, a-1] = c

shotest = dijkstra(adjacency_matrix)
fuel_once = np.where(shotest <= l, 1, 0)
fuel_times = dijkstra(fuel_once-np.eye(n))

for s, t in st:
    ans = fuel_times[s-1][t-1]
    if np.isinf(ans):
        print(-1)
    else:
        print(int(ans) - 1)
n,m = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
count = [0]*(m+1)
for i in a:
    count[i[0]] += 1
l = [0]*n
ans = max(count)
s = set()
for i in range(n-1):
    M = max(count)
    ind = count.index(M)
    s.add(ind)

    for j in range(n):
        if a[j][l[j]] == ind:

            count[ind] -= 1
            while a[j][l[j]] in s:
                l[j] += 1
            count[a[j][l[j]]] += 1
    ans = min(ans,max(count))

print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
count = [0]*(m+1)
for i in a:
    count[i[0]] += 1
l = [0]*n
ans = max(count)
s = set()
for i in range(m-1):
    M = max(count)
    ind = count.index(M)
    s.add(ind)

    for j in range(n):
        if a[j][l[j]] == ind:

            count[ind] -= 1
            while a[j][l[j]] in s:
                l[j] += 1
            count[a[j][l[j]]] += 1
    ans = min(ans,max(count))

print(ans)
#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()
words = ['dream', 'dreamer', 'erase', 'eraser']
L = len(max(words, key=len))


def dfs(n):
    if n == len(s):
        return True
    for w in words:
        if w in s[n:n + L]:
            if dfs(n + len(w)):
                return True
    return False


if dfs(0):
    print('YES')
else:
    print('NO')


### FIXED CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()
revs = s[::-1]
words = ['maerd', 'remaerd', 'esare', 'resare']


def scan(n):
    for w in words:
        if revs[n:].startswith(w):
            return len(w)
    print('NO')
    exit()


n = 0
while revs[n:] != '':
    n += scan(n)

print('YES')
N = int(input())
n = 10 ** 9 + 7
A_n = [int(i) % n for i in input().split()]
A_n_mod = sum([(A_n[i] * A_n[j]) % n for i in range(N-1) for j in range(i+1, N, 1)])
res = A_n_mod % n
print(res)

### FIXED CODE ###

D, T, S = [int(i) for i in input().split()]
t = D / S
if t > T:
    print('No')
else:
    print('Yes')
from math import pi
r = int(raw_input())
print "%s %s"%(pi * pow(r,2), 2 * pi * r)

### FIXED CODE ###

from math import pi
r = float(input())
print ("%s %s"%(pi * pow(r,2), 2 * pi * r))
r=int(input())
s=3r**2
print('s')

### FIXED CODE ###

r=int(input())
print(3*r*r)
a, b = map(int,input().split())
s = input().split("-")
print("Yes" if len(s[0])==a and len(s[1])==b else "No")

### FIXED CODE ###

print(24+(24-int(input())))
x=input()
while 1:
  k=1
  for i in range(2,x**2+1):
    if x%i==0:
      k=0
      break
  if k:
    print(x)
    break
  x+=1

### FIXED CODE ###

import math

x=int(input())
while 1:
  k=1
  for i in range(2,int(math.sqrt(x))+1):
    if x%i==0:
      k=0
      break
  if k:
    print(x)
    break
  x+=1
from goto import goto, label

a = int(input())

for i in range(a):
    b[i] = input()
    c[i] = len(b[i])

alpha = [chr(i) for i in range(97,97+26)]

if min(c) < a:
    ans = ""
else
    for ii in range(25):
        for i in range(a):
            d[i] = b[i].count(alpha[ii])
            ans = ans + alpha[ii] * min(d)
            if len(ans) > a:
                goto .END
label .END

### FIXED CODE ###


a = int(input())
b = []
c = []
ans = ""

for i in range(a):
    b.append(input())
    c.append(len(b[i]))

alpha = [chr(i) for i in range(97,97+26)]

for ii in range(26):
    d = []
    for i in range(a):
        d.append(b[i].count(alpha[ii]))
    ans = ans + (alpha[ii] * min(d))
           
print(ans)
def p_c():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    m = max(A)
    a = A.index(m)
    A.pop(a)
    b = max(A)

    for i in range(N):
        if i == a:
            print(b)
        else:
            print(m)


if __name__ == '__main__':
    p_b()


### FIXED CODE ###

def p_c():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    m = max(A)
    a = A.index(m)
    A.pop(a)
    b = max(A)

    for i in range(N):
        if i == a:
            print(b)
        else:
            print(m)


if __name__ == '__main__':
    p_c()
N, M, C = (map(int, input().split()))
B = list((map(int, input().split())))
counter = 0
for i in range(N):
	tmp = list((map(int, input().split())))
	total = C
	for j in range(M):
		total += B[i] * tmp[i]
		if total > 0:
			counter += 1
			break
			
print(counter)

### FIXED CODE ###

N, M, C = (map(int, input().split()))
B = list(map(int, input().split()))
counter = 0
for i in range(N):
	tmp = list(map(int, input().split()))
	total = C
	for j in range(M):
		total += B[j] * tmp[j]
	if total > 0:
		counter += 1
			
print(counter)
k,s  = list(map(int,input().split()))
cnt = 0

def est():
  for x in range(k+1):
    for y in range(k+1):
      if s-(x+y) >=0 and s-(x+y) <= k:
        cnt += 1
  return cnt
print(est())

### FIXED CODE ###

k,s = list(map(int,input().split()))

def fact(n):
  return sum([x for x in range(1,n+1)])

ans = 0
r = 0
for x in range(k+1):
  for y in range(x,k+1):
    if 0 <= s - (x+y) <= k:
      if (x==y):
          ans += 1
      else:
          ans += 2

print(ans)
N = int(input())
s = input()

def DFS(ans):
        if len(ans) == N+2:
                return ans

        if (ans[-1] == "S") ^ (s[len(ans)-2] == "o") ^ (ans[-2] == "W"):
                ans += "W"
        else:
                ans += "S"

        return DFS(ans)

for initial in ["SS","SW","WS","WW"]:
        ans = DFS(initial)
        if ans[0] == ans[-2] and ans[1] == ans[-1]:
                print(ans[1:-1])
                exit()

print("-1")

### FIXED CODE ###

N = int(input())
s = input()

def makeans(ans):
        for c in s:
                if (ans[-1] == "S") ^ (c == "o") ^ (ans[-2] == "W"):
                        ans += "W"
                else:
                        ans += "S"

        return ans

for initial in ["SS","SW","WS","WW"]:
        ans = makeans(initial)
        if ans[0] == ans[-2] and ans[1] == ans[-1]:
                print(ans[1:-1])
                exit()

print("-1")
def main():
    input = input()
    #input = 46979
    #print("%s:%s:%s"%(S/3600,(S//60)%60,S%60))
    if 0 <= input < 86400:
        hour = int(input / 3600)
        #minute = int(hour / 60)
        minute = int((input / 60) % 60)
        seconde = int(input % 60)
        #print("{0}:{1}:{2}".format(h, m, s))
        print("%d:%d:%d" % (hour,minute,seconde))

if __name__ == "__main__":
    print("main start!")
    main()
    print("main end!")

### FIXED CODE ###

input = int(input())
if 0 <= input < 86400:
    hour = input / 3600
    minute = (input / 60) % 60
    second = input % 60
    print("%d:%d:%d" % (hour,minute,second))
import math
import functools
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = functools.reduce(math.gcd, a)

if max(a) >= k and k % g == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

import fractions
import functools
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = functools.reduce(fractions.gcd, a)

if max(a) >= k and k % g == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
  return True
if i >= n or m > sum(A):
  return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

for m in M:
  if solve(0,m):
     print "yes"
  else:
     print "no"

### FIXED CODE ###

n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

for m in M:
  if solve(0,m):
     print "yes"
  else:
     print "no"