Harryxun/stf_run huggingface dataset:
H, W = map(int, input().split())
Sij = [input() for _ in range(H)]

diff = [[-1, 0], [1, 0], [0, -1], [0, 1]]
def is_isolated(y, x):
    if Sij[y][x] != "#":
        return False
    for d in diff:
        y2 = y + d[0]
        x2 = x + d[1]
        if y2 >= 0 and y2 < H and x2 >= 0 and x2 < W:
            if Sij[y2][x2] == "#":
                return False
    return True

out = "Yes"
for y in range(H):
    for x in range(W):
        if is_isolated(x, y):
            out = "No"
            break
print(out)

### FIXED CODE ###

H, W = map(int, input().split())
Sij = [input() for _ in range(H)]

diff = [[-1, 0], [1, 0], [0, -1], [0, 1]]
def is_isolated(y, x):
    if Sij[y][x] != "#":
        return False
    for d in diff:
        y2 = y + d[0]
        x2 = x + d[1]
        if y2 >= 0 and y2 < H and x2 >= 0 and x2 < W:
            if Sij[y2][x2] == "#":
                return False
    return True

out = "Yes"
for y in range(H):
    for x in range(W):
        if is_isolated(y, x):
            out = "No"
            break
print(out)
def get_count(li,c):
    m=(li[0][c],1)
    h={}
    h[li[0][c]]=1
    for i in li[1:]:
        if(i[c] in h):
            h[i[c]]+=1
        else:
            h[i[c]]=1
        if(m[1]<h[i[c]]):
            m=(i[c],h[i[c]])
    return m


h,w,n=list(map(int,input().split()))
if(h==1 or w==1):
    li = []
    for i in range(n):
        li.append(tuple(map(int, input().split())))
    print(n)
else:
    li=[]
    for i in range(n):
        li.append(tuple(map(int,input().split())))
    li=list(set(li))

    r=get_count(li,0)
    c=get_count(li,1)
    # print(r,c)
    s=0
    if(r[1]>c[1]):
        temp=[]
        for i in li:
            if(i[0]!=r[0]):
                temp.append(i)
        s+=r[1]+get_count(temp,1)[1]
    else:
        temp=[]
        for i in li:
            if(i[1]!=c[0]):
                temp.append(i)
        s+=c[1]+get_count(temp,0)[1]

    print(s)



### FIXED CODE ###


def get_count(li,c):
    if(li==[]):
        return ((0,0))
    m=(li[0][c],1)
    h={}
    h[li[0][c]]=1
    for i in li[1:]:
        if(i[c] in h):
            h[i[c]]+=1
        else:
            h[i[c]]=1
        if(m[1]<h[i[c]]):
            m=(i[c],h[i[c]])
    return m


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

if(h==1 or w==1 or n<=1):
    li = []
    for i in range(n):
        li.append(tuple(map(int, input().split())))
    print(n)
else:
    li=[]
    for i in range(n):
        li.append(tuple(map(int,input().split())))
    li=list(set(li))
    r=get_count(li,0)
    c=get_count(li,1)
    # print(r,c)
    s=0
    if(r[1]>c[1]):
        temp=[]
        for i in li:
            if(i[0]!=r[0]):
                temp.append(i)
        s+=r[1]+get_count(temp,1)[1]
    else:
        temp=[]
        for i in li:
            if(i[1]!=c[0]):
                temp.append(i)
        s+=c[1]+get_count(temp,0)[1]

    print(s)
A,B,C,D = map(int,input().split())
print(min(A,B)+min(C,D))A = int(input())
B = int(input())
C = int(input())
D = int(input())

print(min(A,B)+min(C,D))

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())

print(min(A,B)+min(C,D))
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
c = 0
max_dif = 0
for i in range(n):
    for j in range(i + 1, n):
        if a[j] - a[i] > max_dif:
            c = 1
            max_dif = a[j] - a[i]
        elif: a[j] - a[i] == max_dif:
            c += 1
print(str(c))


### FIXED CODE ###

n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
min_a = 1000000000
max_dif = 0
max_dif_c = 0
for i in range(n):
    if a[i] < min_a:
        min_a = a[i]
    elif a[i] - min_a > max_dif:
        max_dif = a[i] - min_a
        max_dif_c = 1
    elif a[i] - min_a == max_dif:
        max_dif_c += 1
print(str(max_dif_c))
import numpy as np

N = int(input())
X = np.array(list(map(int, input().split())))
cost = float("inf")
for i in range(101):
    cost = min(np.sum((X - i) ** 2))
print(cost)

### FIXED CODE ###

import numpy as np

N = int(input())
X = np.array(list(map(int, input().split())))
costs = []
for i in range(101):
    costs.append(np.sum((X - i) ** 2))
print(min(costs))
import sys
input=sys.stdin.readline
n,a,b,c=map(int,input().split())
s=[input() for i in range(n)]
dp=[dict() for i in range(n+1)]
dp[0][""]=[a,b,c]
for i in range(n):
    if len(dp[i])==0:
        print("No")
        break
    if s[i]=="AB":
        for j in dp[i]:
            a,b,c=dp[i][j]
            if dp[i][j][0]>0:
                dp[i+1][j+"A"]=[a-1,b+1,c]
            if dp[i][j][1]>0:
                dp[i+1][j+"B"]=[a+1,b-1,c]
    elif s[i]=="AC":
        for j in dp[i]:
            a,b,c=dp[i][j]
            if dp[i][j][0]>0:
                dp[i+1][j+"A"]=[a-1,b,c+1]
            if dp[i][j][2]>0:
                dp[i+1][j+"C"]=[a+1,b,c-1]
    else:
        for j in dp[i]:
            a,b,c=dp[i][j]
            if dp[i][j][1]>0:
                dp[i+1][j+"B"]=[a,b-1,c+1]
            if dp[i][j][2]>0:
                dp[i+1][j+"C"]=[a,b+1,c-1]
else:
    print("Yes")
    z=list(dp[-1])
    print(z)
    for i in range(n):
        print(z[-1][i])






### FIXED CODE ###

n,a,b,c=map(int,input().split())
s_=[input() for i in range(n)]
ans=""
for i in range(n):
    s1,s2=s_[i]
    if s2=="B":
        if a==1 and b==1 and i!=n-1:
            if s_[i+1][0]=="A":
                a,b,ans=(a+1,b-1,ans+"A")
            else:
                a,b,ans=(a-1,b+1,ans+"B")
            continue
        a,b,ans=(a-1,b+1,ans+"B") if a>b else (a+1,b-1,ans+"A")
        if min(a,b)==-1:
            print("No")
            break
    elif s1=="A":
        if a==1 and c==1 and i!=n-1:
            if s_[i+1][1]=="C":
                a,c,ans=(a-1,c+1,ans+"C")
            else:
                a,c,ans=(a+1,c-1,ans+"A")
            continue
        a,c,ans=(a-1,c+1,ans+"C") if a>c else (a+1,c-1,ans+"A")
        if min(a,c)==-1:
            print("No")
            break
    else:
        if c==1 and b==1 and i!=n-1:
            if s_[i+1][1]=="C":
                b,c,ans=(b-1,c+1,ans+"C")
            else:
                b,c,ans=(b+1,c-1,ans+"B")
            continue
        b,c,ans=(b-1,c+1,ans+"C") if b>c else (b+1,c-1,ans+"B")
        if min(b,c)==-1:
            print("No")
            break
else:
    print("Yes")
    for j in range(n):
        print(ans[j])
N=input()
list=map(int,input().split())
sum+=0
for i in range(1,N+1)
sum=abs(i-list)
print(min(sum**2))


### FIXED CODE ###

N = int(input())
men=list(map(int,input().split()))
for i in range(1,101):
  suu=0
  if i==1:
    for n in range(N):
      suu+=(1-men[n])**2
      ans=suu
  else:
    for h in range(N): 
      suu+=(i-men[h])**2
  if suu<ans:
      ans=suu
print(ans)
P,Q,R=map(int,input().split())
result=0
min1=100
min2=100

if min1>P:
    min1=P
    flag="P"
if min1>Q:
    min1=Q
    flag="Q"
if min1>R:
    min1=R
    flag="R"
if(flag!="P"):
    if min2>P:
        min2=P
if(flag!="Q"):
    if min2>Q:
        min2=Q
if(flag!="R"):
    if min1>R:
        min2=R
print(min1+min2)


### FIXED CODE ###

P,Q,R=map(int,input().split())

min1=P
min2=Q

min1=101
min2=101





Z1=P+Q
Z2=Q+R
Z3=P+R
Z4=Q+R
Z5=R+P
Z6=Q+R

min1=Z1
if(min1>Z2):
    min1=Z2
if(min1>Z3):
    min1=Z3
print(min1)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n = int(input())
i = 1
num = [0] * 13 #num[i] -> ?´???°???i???????????°??§????°??????°

while True:
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1

    if num[cnt] == 0:
        num[cnt] = i

    if num[n] > 0:
        ans = num[n]
        break

    i += 1

print(ans)

### FIXED CODE ###

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

n = int(input())
i = 1
num = [0] * 13

while True:
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1

    if cnt > 12:
        i += 1
        continue

    if num[cnt] == 0:
        num[cnt] = i

    if num[n] > 0:
        ans = num[n]
        break

    i += 1

print(ans)
s = input()
x = int(input())
tank = []
for c in list(s):
    if c=='a':
        tank.append(0)
    else:
        tank.append(ord('z') + 1 - ord(c))
res = ''
for i in range(len(tank)):
    if tank[i] == 0:
        res += s[i]
    elif tank[i] <= x:
        x -= tank[i]
        tank[i] = 0
        res += 'a'
    else:
        res += s[i]

c = res[-1]
if ord(c)+x <= ord('z'):
    res = res[:-1] + chr(ord(c)+x)
else:
    res = res[:-1] + chr(ord(c)+x-ord('z')+ord('a')-1)
print(res)

### FIXED CODE ###

s = input()
x = int(input())
tank = []
for c in list(s):
    if c=='a':
        tank.append(0)
    else:
        tank.append(ord('z') + 1 - ord(c))
res = ''
for i in range(len(tank)):
    if tank[i] == 0:
        res += s[i]
    elif tank[i] <= x:
        x -= tank[i]
        tank[i] = 0
        res += 'a'
    else:
        res += s[i]

c = res[-1]
x %= 26
if ord(c)+x <= ord('z'):
    res = res[:-1] + chr(ord(c)+x)
else:
    res = res[:-1] + chr(ord(c)+x-ord('z')+ord('a')-1)
print(res)
n=input()
if len(n)==1:
  print(int(n))
else:
  cnt=n[1:].count('9')
  if cnt1==len(n)-1:
    print(int(n[0])+9*(len(n)-1))
  else:
    print(int(n[0])-1+9*(len(n)-1))

### FIXED CODE ###

n=input()
if len(n)==1:
  print(int(n))
else:
  cnt=n[1:].count('9')
  if cnt==len(n)-1:
    print(int(n[0])+9*(len(n)-1))
  else:
    print(int(n[0])-1+9*(len(n)-1))
from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 7)

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == '__main__':
    n, m = list(map(int, input().split(" ")))
    a = list(map(int, input().split(" ")))
    a = list(set(a))

    # for j in a:
    #     if j % 2 != 0:
    #         print("0")

    # a = [i/2 for i in a]
    l = lcm_list(a)

    # if l == 0:
    #     print(0)
    #     exit()

    i = l / 2

    for j in a:
        if i // (j // 2) % 2 == 0:
            print(0)
            exit()

    if m < i:
        print("0")
    else:
        print(int(((m - i) // (l)) + 1))


### FIXED CODE ###

from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 7)

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == '__main__':
    n, m = list(map(int, input().split(" ")))
    a = list(map(int, input().split(" ")))
    a = list(set(a))

    # for j in a:
    #     if j % 2 != 0:
    #         print("0")

    # a = [i/2 for i in a]
    l = lcm_list(a)

    # if l == 0:
    #     print(0)
    #     exit()

    if (2 * m) < l:
        print("0")
        exit()

    i = l / 2

    for j in a:
        if i // (j // 2) % 2 == 0:
            print(0)
            exit()

    # if m < i:
    #     print("0")
    else:
        # print("1")
        print(int(((m - i) // l) + 1))
        # print(int((m // i + 1) // 2))
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
L = [int(v) for v in input().split()]
no = [v for v in range(10) if v not in L]

s = list(map(int, str(N)))

for i in range(len(s)):
    if i == 0:
        if s[i] in L:
            s[i] = min([v for v in no if v != 0 and v > s[i]])
    else:
        if s[i] in L:
            s[i] = min([v for v in no if v > s[i]])
            
print("".join(map(str, s)))

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
L = [v for v in input().split()]

for n in range(N, 200000):
    s = list(str(n))
    
    f = False
    for c in s:
        if c in L:
            f = True
    if f:
        continue
            
    print("".join(s))
    exit()
n = int(input())
a=[]
for i in range(1,10):
  for j in range(1,10):
    a.apppend(i*j)
    
for i in a:
  if a[i]==n:
    print("Yes")
    break
  else:
    print("No")

### FIXED CODE ###

n = int(input())
a=[]
for i in range(1,10):
  for j in range(1,10):
    a.append(i*j)
c=0
b = 0
for i in range(81):
  if a[i]==n:
    c=1
    print("Yes")
    break
  else:
    b = 1

if b==1 and c!=1:
  print("No")
D, N = map(int, input().split())

def cnt(n):
    tmp = 0
    n = n*1.0
    while n.is_integer():
        if (n/100.0).is_integer():
            tmp += 1
            n = n / 100.0
        else:
            break
            
    return tmp

coef = 100**D
whole = np.array([i*coef for i in range(1, 150)])
result = np.array(list(map(cnt, whole)))

print(whole[np.where(result==D)][N-1])

### FIXED CODE ###

import numpy as np
D, N = map(int, input().split())

def cnt(n):
    tmp = 0
    n = n*1.0
    while n.is_integer():
        if (n/100.0).is_integer():
            tmp += 1
            n = n / 100.0
        else:
            break
            
    return tmp

coef = 100**D
whole = np.array([i*coef for i in range(1, 150)])
result = np.array(list(map(cnt, whole)))

print(whole[np.where(result==D)][N-1])
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]


from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np

s = input()
t = input()

for i in range(0, len(s)-len(t)+1):
    s_s = s[i:len(s)-1+i]
    flag = True
    for ssi, ti in zip(s_s, t):
        if ssi == "?":
            continue
        if ssi != ti:
            flag = False
            break
    if flag:
        ans_i = i
        break

if flag:
    print((s[0:i]+t+s[i:len(s)-len(t)-1]).replace("?", "a"))
else:
    print("UNRESTORABLE")

### FIXED CODE ###

# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]


from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np

s = input()
t = input()

if len(s) >= len(t):
    ans_l = []
    for i in range(0, len(s)-len(t)+1):
        s_s = s[i:len(s)-1+i]
        flag = True
        for ssi, ti in zip(s_s, t):
            if ssi == "?":
                continue
            if ssi != ti:
                flag = False
                break
        if flag:
            ans_l.append(i)

    d = []
    for ans_i in ans_l:
        tmp_s = (s[:ans_i]+t+s[len(t)+ans_i:]).replace("?", "a")
        d.append(tmp_s)
    d = sorted(d)
    if len(d) > 0:
        print(d[0])
    else:
        print("UNRESTORABLE")
else:
    print("UNRESTORABLE")
def duplicate_check(value, value_list):
	if value_list.count(value) == 2:
		while value in value_list: value_list.remove(value)
	return ()value_list
value_list = []
result_list = []
while True:
	try:
		number_of_test = int(input())
		value = int(input()
		value_list.append(value)
		result_list = duplicate_check(value, value_list)
	except EOFError:
		break

print(len(result_list))


### FIXED CODE ###

import collections

cnt = int(input())
array = []
for i in range(cnt):
    array.append(int(input()))
cnt_dict = collections.Counter(array)

res = 0
for j in cnt_dict.values():
    if j % 2 != 0:
        res += 1
print(res)
# -*- coding: utf-8 -*-

s = int(input())
n = len(s) - 1
answer = 0
for i in range(2 ** n):
    operation = [""] * n
    for j in range(n):
        if (i >> j) & 1:
            operation[n - 1 -j] = "+"
    
    formula = ""
    for p_n, p_o in zip(s, operation + [""]):
        formula += (p_n + p_o)
    
    answer += eval(formula)

print(answer)

### FIXED CODE ###

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

s = str(input())
n = len(s) - 1
answer = 0
for i in range(2 ** n):
    operation = [""] * n
    for j in range(n):
        if (i >> j) & 1:
            operation[n - 1 -j] = "+"
    
    formula = ""
    for p_n, p_o in zip(s, operation + [""]):
        formula += (p_n + p_o)
    
    answer += eval(formula)

print(answer)
# ６月６日
a = int(input())
b = int(input())
c = int(input())
d = (a+b)*c//2
print(d)


### FIXED CODE ###

N = int(input())
candy_sum = int((1+N)*N/2)
print(candy_sum)
count = 1

whie (true) :
    x = input().strip()
    if x == '0' :
        break
    print('Case %s: %s'%(count,x))
    count = count + 1;

### FIXED CODE ###

count = 1

while True :
    x = input().strip()
    if x == '0' :
        break
    print('Case %s: %s'%(count,x))
    count = count + 1;
x,y,z=(map(int,input().split())

print(z,x,y)

### FIXED CODE ###

x,y,z=map(int,input().split())
print(z,x,y)
#print("{} {}".format(z,x,y))
# -*- coding: utf-8 -*-
from math import factorial

n = int(input())
strlist = []
for i in range(n):
    strlist.append(list(str(input())))

allcount = 0
while (len(strlist) > 1):
    i = 1
    count = 1
    while True:
        if(set(strlist[0]) == set(strlist[i])):
            count += 1
            strlist.pop(i)
        else:
            i += 1
        if(i==len(strlist)):
            if(count > 1):
                allcount += int(factorial(count) / factorial(2) / factorial(count-2))
            break
    strlist.pop(0)
print(allcount)


### FIXED CODE ###

row = input().split()
a = int(row[0])
b = int(row[1])

print(max(a+b, a-b, a*b))
import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    H,N = map(int,input().split())
    # AB = [list(map(int,input().split())) for _ in range(N)]
    A = []
    B = []
    for i in range(N):
        temp = list(map(int,input().split()))
        A.append(temp[0])
        B.append(temp[1])

    A = np.array(A)
    B = np.array(B)

    maxA = max(A)
    INF = 10 ** 4 + 1

    dp = [[INF for j in range(H+maxA+1)] for i in range(N)]
    dp[0][0] = 0
    for j in range(1,H+maxA+1):
        time = (j+A[0]-1)//A[0]
        dp[0][j] = B[0] * time

    for i in range(N-1):
        for j in range(H+maxA+1):
            dp[i+1][j] = min(dp[i][j],dp[i+1][j-A[i+1]]+B[i+1])

    res = min(dp[N-1][H:])
    print(res)





main()


### FIXED CODE ###

# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    H,N = map(int,input().split())
    # AB = [list(map(int,input().split())) for _ in range(N)]
    A = []
    B = []
    for i in range(N):
        temp = list(map(int,input().split()))
        A.append(temp[0])
        B.append(temp[1])

    # A = np.array(A)
    # B = np.array(B)

    maxA = max(A)
    INF = 10 ** 4 + 1

    dp = [[INF for j in range(H+maxA+1)] for i in range(N)]
    dp[0][0] = 0
    for j in range(1,H+maxA+1):
        time = (j+A[0]-1)//A[0]
        dp[0][j] = B[0] * time

    for i in range(N-1):
        for j in range(H+maxA+1):
            dp[i+1][j] = min(dp[i][j],dp[i+1][j-A[i+1]]+B[i+1])

    res = min(dp[N-1][H:])
    print(res)





main()
import sys

sys.setrecursionlimit(10000)


def memoize(f):
    cache = {}

    def func(*args):
        if args not in cache:
            cache[args] = f(*args)
        return cache[args]

    return func


@memoize



def combi(n, r):
  if r == 0 or n == r:
    return 1
  return combi(n-1, r-1) + combi(n-1, r)

n, a, b = map(int, input().split())
items = sorted(map(int, input().split()), reverse=True)
max_ave_list = items[:a]
print(sum(max_ave_list)/len(max_ave_list))

m = max_ave_list.count(max_ave_list[-1])
l = items.count(max_ave_list[-1])
if l == m:
  print(1)
elif max_ave_list[0] != max_ave_list[-1]:
  print(combi(l, m))
else:
  print(sum(combi(l, k) for k in range(m, min(b, l) + 1)))

### FIXED CODE ###

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

if(a[0] + a[1] >= 24 ):
  print(a[0] + a[1] - 24)
else:
  print(a[0] + a[1])
from collections import deque

n,a=map(int,input().split())
cards=list(map(int,input().split()))


noz=[x-a for x in cards].count(0)
pl=[x-a for x in cards if x-a>0]
nl=[a-x for x in cards if x-a<0]
sl=[pl,nl][len(nl)<=len(pl)]
ll=[pl,nl][len(pl)<len(nl)]

sl.sort()
ll.sort()

nsl=len(sl)
nll=len(ll)

sumsl=[sum([sl[x]*((i>>x)&1) for x in range(nsl)]) for i in range(1,2**nsl)]
# print(sl,ll,sumsl)
count=0
for i in range(1,nll+1):
    if sumsl[-1]< sum([ll[x]*(((2**i)>>x)&1) for x in range(nll)]):
        continue

for j in range(1,2**i):
    s=sum([ll[x]*((j>>x)&1) for x in range(nll)])
    count+=(s in sumsl)

print((count+1)*(2**noz)-1)


### FIXED CODE ###

import sys

n,a=map(int, input().split())
cards=list(map(int, input().split()))

integers=[x-a for x in cards]
cards.append(a)
f=max(cards)*n


dp=[[0 for i in range(n+1)] for j in range(2*f+1) ]

for y in range(n+1):
    for x in range(2*f+1):
        if y==0 and x==f:
            dp[x][y]=1
        elif y>0 and (x-integers[y-1]<0 or x-integers[y-1]>2*f):
            dp[x][y]=dp[x][y-1]
        elif y>0 and x-integers[y-1]>=0 and x-integers[y-1]<=2*f:
            dp[x][y]=dp[x-integers[y-1]][y-1]+dp[x][y-1]
        else:
            dp[x][y]=0
print(dp[f][n]-1)
def solve(S):
    for a in ['+', '-']:
        for b in ['+', '-']:
            for c in ['+', '-']:
                if eval('{}{}{}{}{}{}{}'.format(
                        S[0], a, S[1], b, S[2], c, S[3]
                )) == 7:
                    return '{}{}{}{}{}{}{}=7'.format(
                        S[0], a, S[1], b, S[2], c, S[3]
                    )
 
 S = input()
print(solve(S))

### FIXED CODE ###

S = input()


for i in range(8):
    f = ""
    B = ["-"]*3

    for j in range(3):
        if ((i>>j)&1):
            B[j] = "+"
    for a,b in zip(S, B+[""]):
        f += (a+b)
    
        
    if eval(f) == 7:
        print(f+"=7")
        break
n, k, x, y = map(int, input().split())
if k <= n:
  print(k*x)
else:
  print(k*x + (n-k)*y)

### FIXED CODE ###

n, k, x, y = (int(input()) for i in range(4))
if k >= n:
  print(n*x)
else:
  print(k*x + (n-k)*y)
def BubbleSort(A,n):
    count = 0
    for i in range(n):
        for j in range(n-1,i,-1):
            if A[j] < A[j-1]:
                A[j], A[j-1] = A[j-1], A[j]
                print (A[j], A[j-1])
                count += 1
    return A, count

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

ans, count =  (BubbleSort(A,n))
ans = list(map(str,ans))

print (" ".join(ans))
print (count)

### FIXED CODE ###

n = int(input())
 
numbers = list(map(int, input().split(" ")))
 
cnt = 0
 
for i in range(n):
    for j in range(n - 1, i, -1):
        if numbers[j] < numbers[j - 1]:
            numbers[j],numbers[j - 1] = numbers[j - 1], numbers[j]
            cnt += 1
 
numbers = map(str, numbers)
print(" ".join(numbers))
 
print(cnt)
a,b,c=map(input.split())
print('A' + b.head+ 'C',sep="")

### FIXED CODE ###

print("A%sC"%input()[8])