Harryxun/stf_run huggingface dataset:
n=int(raw_input())
A=map(int, raw_input().split())
q=int(raw_input())
m=map(int, raw_input().split())

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

for i range(0,q):
  if solve(0,m[i]):
    print "yes"
  else:
    print "no"

### FIXED CODE ###

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

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

for i in range(0,q):
  if solve(0,m[i]):
    print "yes"
  else:
    print "no"
num = input()
evens = [int(x) for x  in input().split()]

itr = 0
flg = True
while flg:
  evens = list(map(lambda x: (x/2), evens))
  is_evens = list(map(lambda x: x.is_integer(), evens))
  if not all(is_evens):
    flg = False
    break
  itr+=1
  print(evens)
print(itr)

### FIXED CODE ###

num = input()
print(num.count('1'))
def main120():
    import sys
    S_org = input()
    S = []

    for s in range(len(S_org)):
        S.append(S_org[s])
    S = list(map(int, S))

    cont = True
    index = 0
    count = 0

    if len(S) == 1:
        print(0)
        sys.exit()

    else:
        while(cont):
            if S[index] == S[index+1]:
                index += 1
            else:
                count += 2
                S.pop(index)
                S.pop(index)
    
            if index == len(S) - 2:
                if S[index] != S[index+1]:
                    count += 2
                print(count)
                sys.exit()


main120()

### FIXED CODE ###

def main120():
    import sys
    S_org = input()
    S = []

    for s in range(len(S_org)):
        S.append(S_org[s])
    S = list(map(int, S))

    cont = True
    index = 0
    count = 0

    if len(S) == 1:
        print(0)
        sys.exit()

    else:
        while(cont):
            if S[index] == S[index+1]:
                index += 1
            else:
                count += 2
                S.pop(index)
                S.pop(index)
                if index > 0:
                    index -= 1

            if index == len(S) - 2:
                if S[index] != S[index+1]:
                    count += 2
                print(count)
                sys.exit()


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

num_counts = dict()
if len(set(num_lists)) <= k:
  ans = 0
else:
  for i in set(num_lists):
    num_counts[i] = num_lists.count(i)
    numbers = [num_counts.values()]
    numbers.sort()
    ans = 0
  for i in range(len(set(num_lists)) - k):
    ans += numbers[i]

print(ans)


### FIXED CODE ###

from collections import Counter

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

num_counts = dict()
length = len(set(num_lists))
ans = 0

if length > k:
  d = Counter()
  d.update(num_lists)
  count_sorted = list(d.values())
  count_sorted.sort()
  for i in range(length - k):
    ans += count_sorted[i]

print(ans)
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
red_exist=1 if len(n_red) else 0
red_only=1 if red_exist and list(set(A))[0]==8 else 0
n_min=len(set(A)) if not red_exist else len(set(A))-1
print(1 if red_only else n_min,n_min+n_red)


### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
n_min=len(set(A))
n_8=1 if n_red else 0
print(1 if n_min==1 and list(set(A))[0]==8 else n_min-n_8,n_min+n_red-n_8)
H, W = map(int, input().split())
S = [list(input()) for __ in range(H)]

dl = [(-1, 0), (0, 1), (1, 0), (-1, -1)]
for i, row in enumerate(S):
    for j, val in enumerate(row):
        if val == '.':
            continue

        can_paint = False
        for dx, dy in dl:
            di, dj = i + dx, j + dy
            if di < 0 or H <= di or dj < 0 or W <= dj:
                continue
            if S[di][dj] == '#':
                can_paint = True
                break
        if not can_paint:
            print('No')
            sys.exit(0)
print('Yes')

### FIXED CODE ###

def resolve():
    H, W = map(int, input().split())
    S = [list(input()) for __ in range(H)]

    dl = [(-1, 0), (0, 1), (1, 0), (0, -1)]
    for i, row in enumerate(S):
        for j, val in enumerate(row):
            if val == '.':
                continue

            can_paint = False
            for dx, dy in dl:
                di, dj = i + dx, j + dy
                if di < 0 or H <= di or dj < 0 or W <= dj:
                    continue
                if S[di][dj] == '#':
                    can_paint = True
                    break
            if not can_paint:
                return 'No'
    return 'Yes'

print(resolve())
# -*- coding: utf-8 -*-
a = int(input())
b = int(input().split(""))
list(b)
count = []
for i in range(a):
  count[i] = 0
  while b[i] % 2 == 0:
    b[i] = b[i] / 2
    count[i] += 1
print(min(count))

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
count = []
for i in range(n):
    count.append(0)
    while a[i] % 2 == 0:
        a[i] = a[i] / 2
        count[i] += 1
print(min(count))
import math

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

a_b= [list(map(int, input().split())) for _ in range(N_H[0])]
length =len(a_b)

a= [a_b[i][0] for i in range(length)]
b= [a_b[i][1] for i in range(length)]

counter = 0
i = 0
pattern = 0


a_max = max(a)
a_max_idx = a.index(a_max)
b_a_max_idx = b[a_max_idx]

b.pop(a_max_idx)

b.sort()
b.reverse()

if N_H[1] <= b[a_max_idx]:
    print(1)
    
while True:
    if N_H[1] <= b_a_max_idx:
        counter += 1
        print(counter)
        break

    if i <= length-2:    
        if b[i] > a_max:
            N_H[1] -= b[i]

            i += 1

            counter += 1

            if N_H[1] <= 0:
                print(counter)
    else:
        counter += math.ceil((N_H[1]-b_a_max_idx)/a_max)+1
        print(counter)
        break


### FIXED CODE ###

import math

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

a_b= [list(map(int, input().split())) for _ in range(N_H[0])]
length =len(a_b)

a= [a_b[i][0] for i in range(length)]
b= [a_b[i][1] for i in range(length)]

counter = 0
i = 0
pattern = 0


a_max = max(a)
b_max = max(b)
a_max_idx = a.index(a_max)
b_a_max_idx = b[a_max_idx]

b.pop(a_max_idx)

b.sort()
b.reverse()

    
while True:
    if N_H[1] <= b_max and counter == 0:
        counter += 1
        print(counter)
        break
    
    if N_H[1] <= b_a_max_idx:
        counter += 1
        print(counter)
        break

    if i <= length-2:    
        if b[i] > a_max:
            N_H[1] -= b[i]

            i += 1

            counter += 1

            if N_H[1] <= 0:
                print(counter)
                break
        else:
            counter += math.ceil((N_H[1]-b_a_max_idx)/a_max)+1
            print(counter)
            break
    else:
            counter += math.ceil((N_H[1]-b_a_max_idx)/a_max)+1
            print(counter)
            break
N, K = map(int, input().split())
x = list(map(int, input().split()))

count_m = 0
count_p = 0
for i in range(N):
    if x[i] > 0:
        count_m = i
        count_p = N-i
        break
    elif x[i] == 0:
        count_m = i
        count_p = N-i-1
        K -= 1
        N -= 1
        x = x.remove(x[i])
        break
if count_m == 0 and count_p == 0:
    count_m = N

ans = 0
    

y = K
z = K - y
for j in range(1, y):
    #if count_m-j>0 and count_m+y-1-j<N-1:
    if True:

        print(j)

        print(x[count_m+y-1-j],x[count_m-j] ,x[count_m-1])



if count_m >= 1:
    tmp = min(x[count_m+y-1-j]-x[count_m-j] *2 for j in range(1, y) if count_m-j>=0  and count_m+y-1-j<N)
    tmp2 = min(x[count_m+y-1-j]*2-x[count_m-j] for j in range(1, y) if count_m-j>=0 and count_m+y-1-j<N)
else:
    tmp = tmp2 = 1000000000

if N==0:
    ans = 0

elif count_p>=K:
    # print(y, "1chi")
    ans = min(tmp, tmp2, x[count_m+min(y, count_p)-1])
elif count_m>=K:
    #print("ni")
    ans = min(tmp, tmp2, -x[count_m-K])
else:
    # print("san")
    ans = min(tmp, tmp2)


print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
x = list(map(int, input().split()))

count_m = 0
count_p = 0
for i in range(N):
    if x[i] > 0:
        count_m = i
        count_p = N-i
        break
    elif x[i] == 0:
        count_m = i
        count_p = N-i-1
        K -= 1
        N -= 1
        x.remove(x[i])
        break
if count_m == 0 and count_p == 0:
    count_m = N

ans = 0
    

y = K
z = K - y


if count_m >= 1 and count_p>=1:
    # for j in (range(1,y)):
    #     if count_m-j>=0  and count_m+y-1-j<N:
    #         print(x[count_m+y-1-j], x[count_m-j])
    tmp = min(x[count_m+y-1-j]-x[count_m-j] *2 for j in range(1, y) if count_m-j>=0  and count_m+y-1-j<N)
    tmp2 = min(x[count_m+y-1-j]*2-x[count_m-j] for j in range(1, y) if count_m-j>=0 and count_m+y-1-j<N)
else:
    tmp = tmp2 = 1000000000

if N==0:
    ans = 0


elif count_p>=K:
    # print(y, "1chi")
    ans = min(tmp, tmp2, x[count_m+min(y, count_p)-1])
elif count_m>=K:
    #print("ni")
    ans = min(tmp, tmp2, -x[count_m-K])
else:
    #print("san", tmp, tmp2)
    ans = min(tmp, tmp2)


print(ans)
a = list(map(int,input().split()))

a,sort()
print('YES' if a[0] == 5 and a[1] == 5 and a[2] == 7 else 'NO')


### FIXED CODE ###

a = list(map(int,input().split()))
 
a.sort()
print('YES' if a[0] == 5 and a[1] == 5 and a[2] == 7 else 'NO')
N=int(input())
ABC=[]
for _ in range(N):
    ABC.append(list(map(int,input().split())))
MAXlist=[]
from functools import lru_cache
@lru_cache(maxsize=None)
def dynam(n):
    if n>1:
        a=max(dynam(n-1)[1]+ABC[n-1][0],
              dynam(n-1)[2]+ABC[n-1][0])
        b=max(dynam(n-1)[0]+ABC[n-1][1],
              dynam(n-1)[2]+ABC[n-1][1])
        c=max(dynam(n-1)[0]+ABC[n-1][2],
              dynam(n-1)[1]+ABC[n-1][2])
        return (a,b,c)
    return tuple(ABC[0])
print(max(dynam(N)))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
N=int(input())
ABC=[]
for _ in range(N):
    ABC.append(list(map(int,input().split())))
from functools import lru_cache
@lru_cache(maxsize=None)
def dynam(n):
    if n>1:
        a=max(dynam(n-1)[1]+ABC[n-1][0],
              dynam(n-1)[2]+ABC[n-1][0])
        b=max(dynam(n-1)[0]+ABC[n-1][1],
              dynam(n-1)[2]+ABC[n-1][1])
        c=max(dynam(n-1)[0]+ABC[n-1][2],
              dynam(n-1)[1]+ABC[n-1][2])
        return (a,b,c)
    return tuple(ABC[0])
print(max(dynam(N)))
s1 = input()
s2 = input()

if s2 in s1+s1:
    print("Yes")
else
    print("No")

### FIXED CODE ###

s1 = input()
s2 = input()

if s2 in s1+s1:
    print("Yes")
else:
    print("No")
X, N = map(int, input().split())
p = list(map(int, input().split()))

if p:
    x = [i for i in range(1, max(p)) if i not in p]

    c = x.pop()
    a = abs(c - X)
    for i in x:
        if abs(i - X) < a:
            c = i
    print(c)
else:
    print(X)


### FIXED CODE ###

X, N = map(int, input().split())
p = list(map(int, input().split()))

i = 0
while True:
    if X - i not in p:
        print(X - i)
        break
    elif X + i not in p:
        print(X + i)
        break
    i += 1
lis=0
S=0
L=0
lis=input().split()
S=lis[0]*lis[1]
L=lis[0]*2+lis[1]*2
print(S L)

### FIXED CODE ###

lis=0
S=0
L=0
lis=input().split()
S=int(lis[0])*int(lis[1])
L=int(lis[0])*2+int(lis[1])*2
print(S,L)
N = int(input())
T = int(input())
A = int(input())
H = list(map(int, input().split()))

ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.append(ans)
 
ans_min = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_min:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")

### FIXED CODE ###

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


ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.append(ans)


ans_mini = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_mini:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")
A,B=map(int,input().split())
if A>B :
  print("GREATER")
elif A==B :
  print("EQUAL")
else :
  print("LESS")

### FIXED CODE ###

A=int(input())
B=int(input())
if A>B :
  print("GREATER")
elif A==B :
  print("EQUAL")
else :
  print("LESS")
p=input;p();a=map(int,p().split());print(max(a)-min(a))

### FIXED CODE ###

p=input;p();a=sorted([int(i)for i in p().split()]);print(a[-1]-a[0])
X=input().split()
N=int(X[0])
M=int(X[1])
A=list(map(int,input().split()))
y=N-sum(A)
z=0
if y>=0:
  z=y
else:
  z=-1
print(z)

### FIXED CODE ###

from math import pi
R=float(input())
print(2*R*pi)
def fcd(a , b):
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return int(a*b/fcd(a , b))


n = int(input())
t_list = []
ans_list = []
for i in range(n):
    t_list.append(int(input()))
    
    
for i in range(len(t_list)):
    if i == 0:
        continue
    elif i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    else:
        ans_list.append(lcm(ans_list[i-2],t_list[i]))
print(ans_list[-1])

### FIXED CODE ###

def fcd(a , b):
    
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return a*b//fcd(a , b)


n = int(input())
t_list = []
ans_list = []
for i in range(n):
    t_list.append(int(input()))
    
    
for i in range(len(t_list)):
    if i == 0:
        ans_list.append(t_list[0])
        continue
    if i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    if i >=2:
        ans_list.append(lcm(ans_list[-1],t_list[i]))
print(ans_list[-1])
n,m = map(int,input().split())
dp = [0]*n

for i in range(m):
    dp[int(input())-1] = 10**12
    
if dp[0] == 10**12:
    dp[0] = 0
else:
    dp[0] = 1

if dp[1] == 10**12:
    dp[1] = 0
else:
    dp[1] = 1+ dp[0]

mod = 1000000007

for i in range(2,n):
    if dp[i] == 10**12:
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod
print(dp[-1])

### FIXED CODE ###

n,m = map(int,input().split())
dp = [0]*n

for i in range(m):
    dp[int(input())-1] = 10**12
    
if dp[0] == 10**12:
    dp[0] = 0
else:
    dp[0] = 1

if n == 1:
    print(dp[0])
else:
    if dp[1] == 10**12:
        dp[1] = 0
    else:
        dp[1] = 1+ dp[0]

    mod = 1000000007

    for i in range(2,n):
        if dp[i] == 10**12:
            dp[i] = 0
        else:
            dp[i] = dp[i-1] + dp[i-2]
            dp[i] %= mod
    print(dp[-1])
N = list(input())
K = int(input())
for i in N :
  a = int(i)
  ans += a**(5*10**15)
  if ans>=K:
    print(a)

### FIXED CODE ###

N = list(input())
K = int(input())
for i in range(K) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(1)
a,b,c,d=map(int,input().split());print(min(b,d)-max(a,c))

### FIXED CODE ###

s=input();print("YNeos"[s!=s[::-1]::2])
h, w = list(map(int, input().split() ))

s = []
s.append("." * (w+2)) 
for _ in range(h):
	s.append("." + input() + ".")
s.append("." * (w+2)) 

ans = "Yes"
dx = [-1, 0, 1, 0]
dy = [ 0, 1, 0,-1]

for i in range(1, h+1):
	for j in range(1, h+1):
		if s[i][j] == "#":
			CanPaint = False
			for k in range(4):
				if s[i+dx[k]][j+dy[k]] == "#":
					CanPaint = True
			if not CanPaint:
				ans = "No"

print(ans)


### FIXED CODE ###

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

s = []
s.append("." * (w+2)) 
for _ in range(h):
	s.append("." + input() + ".")
s.append("." * (w+2)) 

ans = "Yes"
dx = [-1, 0, 1, 0]
dy = [ 0, 1, 0,-1]

for i in range(1, h+1):
	for j in range(1, w+1):
		if s[i][j] == "#":
			CanPaint = False
			for k in range(4):
				if s[i+dx[k]][j+dy[k]] == "#":
					CanPaint = True
			if not CanPaint:
				ans = "No"

print(ans)
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in s:
    if 'a' <= c <= 'z':
            count[c] += 1

for key, num in count:
    print("{0} : {1}".format(key, count[key]))

### FIXED CODE ###

import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in lines:
    if 'a' <= c <= 'z':
            count[c] += 1

for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
n = int(input())
numbers = list(map(int, input().split()))
ans = 0
while True:
    index = 1
    for i in range(n):
        if numbers[i] % 2 == 0:
            numbers[i] = numbers[i] / 2
        else:
            index = 0
            break
    if index == 1:
        ans += 1
    else:
        break
print(ans)


### FIXED CODE ###

# 文字列を入力
number = list(input())
# カウントの設置
count = 0
# 各桁の判定
if number[0] == '1':
    count += 1
if number[1] == '1':
    count += 1
if number[2] == '1':
    count += 1
# 出力
print(count)
n = input()
sum = 0
for i in range(n):
  a = map(int, raw_input().split())
  a.sort()
for i in range(n):
  sum += a[i]
print '%d %d %d' % (a[0], a[n-1], sum)

### FIXED CODE ###

n = input()
sum = 0
a = map(int, raw_input().split())
a.sort()
for i in range(n):
  sum += a[i]
print '%d %d %d' % (a[0], a[n-1], sum)
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

sl = []
cnt = -1
for i in range(M):
    a = int(input())
    b = (a - 1) - (cnt + 1)
    if b == -1:
        print(0)
        break
    sl.append(max(b, 1))
    cnt = a
else:
    sl.append(max(N - (a + 1), 1))
    ans = 1
    for s in sl:
        p = 0
        for i in range(s):
            j = s - i
            if (i <= j):
                p += combinations_count(j, i)
            else:
                break
        ans *= p
        ans = ans % 1000000007
    print(ans % 1000000007)

### FIXED CODE ###

N, M = map(int, input().split())
a = [0]*N
for _ in range(M):
    idx = int(input()) - 1
    a[idx] = 1
    
dp = [0]*(N+1)
dp[0] = 1
dp[1] = 1
for i in range(N-1):
    if a[i] == 0:
        dp[i+1] += dp[i]
        dp[i+2] += dp[i]
print(dp[N-1] % 1000000007)
def fact(n):
    if n==0:
        return 1
    return n*fact(n-1)
ans=0    
N=int(input())
s=list(map(int,input().split()))
t=max(s)
for i in s:
    c=fact(t)/(fact(i)*fact(t-i))
    if ans<c:
        ans=c
        an=i
print(str(t)+" "+str(an))        
    

### FIXED CODE ###

N=int(input())
s=list(map(int,input().split()))
n=max(s)
s.remove(n)
q=n
for i in s:
    t=abs(n/2-i)
    if q>=t:
        q=t
        w=str(n)+" "+str(i)
print(w)
a = input()
if a>=30:
  print("Yes")
else:
  print("No")
  

### FIXED CODE ###

a = int(input())
if a >=30:
  print("Yes")
else:
  print("No")
x, n = map(int, input().split())
if n==0:
    print(x)
else:
    P = list(map(int, input().split())
    for i in range(0, 102):
        if x-i not in P or x+i not in P:
            if x-i not in P:
                print(x-i)
                exit(0)
            if x+i not in P:
                print(x+i)
                exit(0)

### FIXED CODE ###

x, n = map(int, input().split())
if n==0:
    print(x)
if n > 0:
    P = list(map(int, input().split()))
    for i in range(0,102):
        if x-i not in P or x+i not in P:
            if x-i not in P:
                print(x-i)
                exit(0)
            if x+i not in P:
                print(x+i)
                exit(0)
weather = input()

if (weather == 'Cloudy'):
    print 'Rainy'

if (weather == 'Cloudy'):
    print 'Rainy'
    
if (weather == 'Cloudy'):
    print 'Rainy'

### FIXED CODE ###

weather = input()

if weather == 'Sunny':
    print('Cloudy')

if weather == 'Cloudy':
    print('Rainy')

if weather == 'Rainy':
    print('Sunny')
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;

#define rep(i,a,n) for(int i=a;i<n;i++)
#define rrep(i,a,n) for(int i=a:i<n;i--)

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << min({ a + b,b + c,c + a }) << endl;
}

### FIXED CODE ###

a,b,c = map(int,input().split())
print(min(a+b,b+c,c+a))
A=int(input())
B=int(input())
if A+B==15:print("+")
else if A*B==15:print("*")
else :print("x")

### FIXED CODE ###

a = input().split(' ')
A = int(a[0])
B = int(a[1])
if A+B==15:print("+")
elif A*B==15:print("*")
else :print("x")
from itertools import permutations

while True:
	n = int(raw_input().strip())
	k = int(raw_input().strip())
	if n == k == 0:
		break
	nums = [raw_input().strip() for i in xrange(n)]
	result = set(["".join(p) for p in permutations(nums, k)])
	print len(result)

### FIXED CODE ###

import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())
W,H,x,y = map(int,input().split())
print(W*H*0.5, int(x=W*0.5 and y=H*0.5))

### FIXED CODE ###

W,H,x,y = map(int,input().split())
print(W*H*0.5, int(x==W*0.5 and y==H*0.5))
def main():
    S = input()
    k = int(input())

    array = []
    for i in range(len(S)):
        for j in range(i+1,len(S)+1):
            array.append(S[i:j])
    array = list(set(array))
    array.sort()
    print(array[k-1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    S = input()
    k = int(input())

    array = []
    for i in range(len(S)):
        for j in range(i+1,len(S)+1):
            if j-i <= k:
                array.append(S[i:j])
    array = list(set(array))
    array.sort()
    print(array[k-1])


if __name__ == '__main__':
    main()
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,a,b=mp()
print(max((b-a)*(n-2)+1),0)

### 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,a,b=mp()
print(max(((b-a)*(n-2)+1),0))
li = [int(input()) for i in range(5)]
a,b,c,d,e = li[0],li[1],li[2],li[3],li[4]
a1,b1,c1,d1,e1 = int(str(a)[-1]),int(str(b)[-1]),int(str(c)[-1]),int(str(d)[-1]),int(str(e)[-1])
for i in range(1,11):
    if a1 == i:
        plus = i+(li[0])//10*10
        li.remove(li[0])
        break
    if b1 == i:
        plus = i+(li[1])//10*10
        li.remove(li[1])
        break
    if c1 == i:
        plus = i+(li[2])//10*10
        li.remove(li[2])
        break
    if d1 == i:
        plus = i+(li[3])//10*10
        li.remove(li[3])
        break
    if e1 == i:
        plus = i+(li[4])//10*10
        li.remove(li[4])
        break
for i in range(4):
    if li[i] % 10 != 0:
        li[i] = (li[i] // 10 + 1)*10
print(sum(li)+plus)

### FIXED CODE ###

li,lia = [],[]
total = 0
for i in range(5):
    a = input()
    li.append(a)
for i in range(5):
    lia.append(li[i][-1])
lib = [int(s) for s in lia]
b = lib.count(0)
for i in range(b):
    lib.remove(0)
for i in range(5):
    total += (int(li[i])//10+1)*10
if len(lib) >= 1:
    total -= 10*(1+b)
else:
    total -= 10*(b)
if len(lib) >= 1:
    total += min(lib)
if total <= 0:
    print(0)
else:
    print(total)