Harryxun/stf_run huggingface dataset:
N,M = map(int,input().split())
s = [int(input()) for i in range(M)]
c = [int(input()) for i in range(M)]
first = []
second = []
third = []
for i in range(M):
  if s[i] == 1:
    first.append(c[i])
  elif s[i] == 2:
    second.append(c[i])
  elif s[i] == 3:
    third.append(c[i])
if first == []:
  print(-1)
elif second == []:
  second.append(0)
elif third == []:
  third.append(0)
l.append(min(first))
l.append(min(second))
l.append(min(third))
l = ''.join(str(n) for n in l)
print(l)

### FIXED CODE ###

N,M = map(int,input().split())
sc=[list(map(int,input().split()))for _ in range(M)]
ans = -1
for i in range(1000):
  s = str(i)
  if len(s) == N:
    flg = 0
    for a,b in sc:
      if int(s[a-1]) != b:
        flg = 1
    if flg == 0:
      ans = i
      break
print(ans)
a, b = map(int, input())
if a % b == 0:
  print(a + b)
else:
  print(b - a)


### FIXED CODE ###

a, b = map(int, input().split())
if b % a == 0:
  print(a + b)
else:
  print(b - a)
n,m=map(int,input().split())
lists=list(map(int,input().split()))
uselist=[]
for some in lists:
    some=some//2
    uselist.append(some)

import fractions
import math
ans = uselist[0]
for i in range(1, n):
    ans = ans* uselist[i] // fractions.gcd(ans, uselist[i])

flags=True
for some in uselist:
    a=ans//some
    if a%2==0:
        flags=False
        break
if flags:
    p=math.floor(m/ans)
    if p%2==0:
      print(p//2)
    elif p%2!=0:
      print(p//2+1)
    
else:
    print(0)


### FIXED CODE ###

k,x=map(int,input().split())
if 500*k>=x:
    print("Yes")
else:
    print("No")
s = list(map(int,input().split()))
N = s[0]
X = s[1]
L = list(map(int,input().split()))
a = 0
d = 0
while d <= X:
  while a <= N+1:
    d += L[a]
    a += 1 

print(a)
  

### FIXED CODE ###

s = list(map(int,input().split()))
N = s[0]
X = s[1]
L = list(map(int,input().split()))
a = 0
d = 0
while d <= X:
  if a >= N:
    a = N+1
    break
  else:
    d += L[a]
    a += 1 

print(a)
s=input()
t=input()
if len(t)==1:
  try:
    print(s.index(t)+1)
  except ValueError:
    print(-1)
    exit()
  l=list()
  for _ in list(t):
    l.append([i for i,x in enumerate(list(s)) if x==_]) if [i for i,x in enumerate(list(s)) if x==_]!=[] else print(-1) and exit()
  ed=l[0][0]
  for i in range(len(t))[1:-1]:
    k=l[i]
    if max(k+[ed])==ed :
      cd+=1
    else:
      ex=list(sorted(k+[ed])).index(ed)
      ed=k[ex]
k=l[len(t)-1]
if max(k+[ed])==ed :
  print((cd+1)*len(s)+min(k)+1)
else:
  ex=list(sorted(k+[ed])).index(ed)
  ed=k[ex]
  print((cd)*len(s)+ed+1)

### FIXED CODE ###

def f():
    s,t=input(),input()
    n,m=len(s),len(t)
    table=[[]for i in  range(26)]
    d={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

    for j in range(n):
        table[d[s[j]]].append(j)
    now=0
    ind=0
    if set(list(t))-set(list(s)):print(-1);exit()
    from bisect import bisect_left as bl
    for p in t:
        if ind>table[d[p]][-1]:now+=1;ind=0
        ind=table[d[p]][bl(table[d[p]],ind)]+1

    print(now*n+ind)
if __name__ == "__main__":
    f()
s = list(input())
while len(s)>0:
  if len(s) % 2 == 0:
    s.pop(-1).pop(-1)
  else:
    s.pop(-1)
  n = len(s)//2
  if s[:n] == s[n-1:]:
    print(len(s))
    break


### FIXED CODE ###

s = list(input().rstrip())
while len(s)>0:
  
  s.pop()
    
  n = len(s)//2
  
  if s[:n] == s[n:] and len(s) % 2 == 0:
    print(len(s))
    break
a,b,c,d = map(int,input().split())
while a>0 and c>0:
  c=c-b
  a=a-d
if a=0:
  print("No")
else:
  print("Yes")
  

### FIXED CODE ###

a,b,c,d = map(int,input().split())
counter_1=0
counter_2=0
while c>0:
  c=c-b
  counter_1=counter_1+1 #counter_1は高橋の攻撃回数
while a>0:
  a=a-d
  counter_2=counter_2+1 #counter_2は青木の攻撃回数
if counter_2>=counter_1:
  print("Yes")
else:
  print("No")
A, B, K = [int(i) for i in input().split()]

res_a = set() 
res_b = set() 
lim = min(A, B)
for i in range(1, lim):
    if A%i == 0:
        res_a.add(i)
    if B%i == 0:
        res_b.add(i)

a_b_union = list(res_a | res_b)

print(a_b_union[K-1])

### FIXED CODE ###

A, B, K = [int(i) for i in input().split()]

res = []
for i in range(1, min(A, B)+1):
    if A % i == 0 and B % i == 0:
        res.append(i)

print(res[::-1][K-1])
N,M = map(int, input().split())
p = [0]*M
S = [0]*M
X = [0]*N
Y = [0]*N
A = 0
B = 0
for i in range(M):
    p[i],S[i] = input().split()
q = [int(s) for s in p]
for i in range(M):
    if S[i] == "AC":
        if Y[q[i]]==0:
            Y[q[i]]+=1
            A += 1
            B += X[q[i]]
        else:
            A = A
            B = B
    else:
        if Y[q[i]]==0:
            X[q[i]] += 1
        else:
            A = A
            B = B
print(str(A)+" "+str(B))      

### FIXED CODE ###

N,M = map(int, input().split())
p = [0]*M
S = [0]*M
for i in range(M):
    p[i],S[i] = input().split()
q = [int(s)-1 for s in p]
X = [0]*N
Y = [0]*N
A = 0
B = 0
for i in range(M):
    if S[i] == "AC":
        if Y[q[i]]==0:
            Y[q[i]]+=1
            A += 1
            B += X[q[i]]
    else:
        if Y[q[i]]==0:
            X[q[i]] += 1
print(str(A)+" "+str(B))
import os, sys, re, math

inary = [int(s) for s in raw_input().split(' ')]

t = inary[0]
ret = 0
while t < inary[2]:
  ret += inary[1]
  t += inary[0]

print(ret)

### FIXED CODE ###

import os, sys, re, math

a,b,t = [s for s in input().split(' ')]
A = int(a)
B = int(b)
T = int(t) + 0.5
t = A
ret = 0
while  t < T:
  ret += B
  t += A

print(ret)
def insertionSort(A, n, g, cnt):
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j+g] = A[j]
            j = j - g
            cnt += 1
        A[j+g] = v

    return cnt


def shellSort(A, n):
    cnt = 0

    G = []
    if n <= 3:
        m = 1
        G[0] = 1
    else:
        m = n // 2
        G = [0] * m
        G[0] = n // m
        for i in range(1, m):
            G[i] = G[i-1] // 2
            if G[i] == 0:
                G[i] = 1

    print(m)
    print(*G)
    for i in range(m):
        cnt = insertionSort(A, n, G[i], cnt)

    print(cnt)


def main():
    n = int(input())
    a = []
    for i in range(n):
        a.append(int(input()))

    shellSort(a, n)

    for i in range(n):
        print(a[i])


if __name__ == '__main__':
    main()



### FIXED CODE ###

def insertionSort(A, n, g, cnt):
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j+g] = A[j]
            j = j - g
            cnt += 1
        A[j+g] = v

    return cnt


def shellSort(A, n):
    cnt = 0

    G = []
    G.append(1)
    for i in range(n):
        tmp = 3 * G[-1] + 1
        if tmp > n:
            break
        else:
            G.append(tmp)
    G.reverse()
    m = len(G)

    print(m)
    print(*G)

    for i in range(m):
        cnt = insertionSort(A, n, G[i], cnt)

    print(cnt)


def main():
    n = int(input())
    a = []
    for i in range(n):
        a.append(int(input()))

    shellSort(a, n)

    for i in range(n):
        print(a[i])


if __name__ == '__main__':
    main()
wake_up_hour= int(input("Enter WakeUp Hour: "))
wake_up_minute=int(input("Enter WakeUp Minute: "))
sleep_hour=int(input("Enter Sleep Hour: "))
sleep_minute= int(input("Enter Sleep Minute:" ))
study_time=int(input("Study time :"))

print(wake_up_hour, wake_up_minute, sleep_hour, sleep_minute, study_time)
Total_Minutes = (sleep_hour) *60 + (sleep_minute) - ((wake_up_hour) * 60 + (wake_up_minute))

print(Total_Minutes)

if Total_Minutes > study_time:
    print("You can finish the study")
    start_before_minute= ((sleep_hour*60 +  sleep_minute) - study_time) % 60
    start_before_hour= ((sleep_hour*60 +  sleep_minute) - study_time) // 60 
    print("Start before: ", start_before_hour, start_before_minute, )
else:
    print("You are lazy!!!. wake up early")

### FIXED CODE ###

import math
import re
import copy

h1,m1,h2,m2,k = map(int,input().split())
w1 = h1*60 + m1
w2 = h2 * 60 + m2
w3 = (w2-w1+24*60)%(24*60)
w3 = w3 - k
print(w3)
N,M = map(int,input().split())
L = list(map(int,input().split()))
L = sorted(L)
left = ""
right = ""

if N >= M :
    ans = 0
else :
    for i in range(N) :
        if i == 0 :
            left = L[0]
            L = L[1:]
        elif i == 1 :
            right = L[-1]
            L = L[:-1]
        else :
            if abs(left-L[0]) < abs(right-L[-1]) :
                right = L[-1]
                L = L[:-1]
            else :
                left = L[0]
                L = L[1:]
    #print(L)
    ans = 0

    while len(L) :
        #print(abs(left-L[0]),abs(right-L[-1]))
        if abs(left-L[0]) < abs(right-L[-1]) :
            ans += abs(left-L[0])
            left = L[0]
            L = L[1:]
        else :
            ans += abs(right-L[-1])
            right = L[-1]
            L = L[:-1]

print(ans)
#print(L)


### FIXED CODE ###

N,M = map(int,input().split())
L = list(map(int,input().split()))
if N >= M :
    ans = 0
else :
    L = sorted(L)
    A = []
    for i in range(M-1) :
        A.append(L[i+1]-L[i])
    A = sorted(A)
    ans = sum(A[:M-N])
print(ans)
import math
n = int(input())
ans = 0
for i in reversed(range(int(math.sqrt(n)))):
    if n%i == 0:
        j = n // i
        ans = i+j-2
        break
print(ans)


### FIXED CODE ###

import math
n = int(input())
ans = 0
for i in reversed(range(int(math.sqrt(n))+1)):
    if n%i == 0:
        j = n // i
        ans = i+j-2
        break
print(ans)
N,T = map(int,(list(input().split())))
cost = []
for i in range(N):
    c,t = map(int,(list(input().split())))
    if t<=T:
        cost.append(c)
print(min(cost))


### FIXED CODE ###

N,T = map(int,(list(input().split())))
cost = 1001
for _ in range(N):
    c,t = map(int,(list(input().split())))
    if t<=T:
        cost=min(cost,c)
if cost == 1001:
    print('TLE')
else:
    print(cost)
n = int(input())
x = int(input())
t = int(input())
w = n//x
if (n % x) == 0:
    print(w * t)
else:
    w += 1
    print(w * t)

### FIXED CODE ###

n,x,t = map(int, input().split())
w = n//x
if (n % x) == 0:
    print(w * t)
else:
    w += 1
    print(w * t)
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0

diff = []
for i, index in enumerate(a,1):
    diff.append(abs(i - index))

diff.sort()
if n % 2 == 1:
    b = diff[len(diff) // 2]
    for i in diff:
        ans1 += abs(i - b)

    print(ans1)
else:
    b1 = diff[len(diff) // 2 - 1]
    b2 = diff[len(diff) // 2]
    for i in diff:
        ans1 += abs(i -b1)
        ans2 += abs(i -b2)
    print(min(b1.b2))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
diff = []
for i, index in enumerate(a,1):
    diff.append(i-index)

diff.sort()
if n % 2 == 1:
    b = diff[n // 2]
    tmp = map(lambda x: x - b, diff)
    print(sum( map(abs,tmp )))
else:
    b1 = diff[n // 2 - 1]
    b2 = diff[n // 2]
    tmp1 = map(lambda x: x - b1, diff)
    tmp2 = map(lambda x: x - b2, diff)
    ans1 = sum( map(abs,tmp1 ))
    ans2 = sum( map(abs,tmp2 ))
    print(min(ans1,ans2))
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))

    if a <= 0 and b >= 0:
        print('Zero')
    elif b < 0 and (b - a + 1) % 2 == 1:
        print('Negative')
    else:
        print('Positive')
    return

resolve()

### FIXED CODE ###

def resolve():
    a, b = list(map(int, input().split()))

    if a <= 0 and b >= 0:
        print('Zero')
    elif b < 0 and (b - a + 1) % 2 == 1:
        print('Negative')
    else:
        print('Positive')
    return


resolve()
x = int(input())
s = str(x)
if x < 100:
    print(0)
s2s = ''.join(([s[-2],s[-1]]))
s2 = int(s2s)
# print(s2)

x1 = s2 // 5
# print(x1)
if s2 % 5 == 0:
    n = x1
else:
    n = x1+1
# print(n)
if 100*n > x:
    print(0)
else:
    print(1)


### FIXED CODE ###

def solve():
    x = int(input())
    s = str(x)
    if x < 100:
        return print(0)
    s2s = ''.join(([s[-2],s[-1]]))
    s2 = int(s2s)
    # print(s2)

    x1 = s2 // 5
    # print(x1)
    if s2 % 5 == 0:
        n = x1
    else:
        n = x1+1
    # print(n)
    if 100*n > x:
        print(0)
    else:
        print(1)
solve()
antenas = list(int, input() for i in range(5))

k = int(input)

if (antenas[4] - antenas[0]) <= k:
  print("Yay!")
else :
  print(":(")
  
  


### FIXED CODE ###

antenas = [int(input()) for i in range(5)]

k = int(input())

if (antenas[4] - antenas[0]) <= k:
  print("Yay!")
else :
  print(":(")
a,b = map(int,input.split())
if a >= 13:
  print(b)
elif 6<=a<=12:print(b//2)
else:print(0)

### FIXED CODE ###

a,b = map(int,input().split())
if a >= 13: print(b)
elif 6 <= a:print(b//2)
else:print(0)
x=[input() for i in range(5)]
print("Yay!" if max(x)-min(x)>=k else ":(")

### FIXED CODE ###

x=[int(input()) for i in range(5)]
k=int(input())
print("Yay!" if max(x)-min(x)<=k else ":(")
L, R = map(int ,input().split())
if R-L >= 2019:
    print(0)
else:
    li = []
    for i in range(L, R+1):
        li.append(i%2019)
    l = []
    for i in range(len(li)-1):
        for j in range(i+1,len(li)):
            l.append((li[i]*li[j])%2019)
    a = min(l)

print((a)%2019)


### FIXED CODE ###

L, R = map(int ,input().split())
if R-L >= 2019:
    print(0)
else:
    li = []
    for i in range(L, R+1):
        li.append(i%2019)
    l = []
    for i in range(len(li)-1):
        for j in range(i+1,len(li)):
            l.append((li[i]*li[j])%2019)
    a = min(l)

    print((a)%2019)
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=input()
	if n==-1:break
	e=0
	for i in range(n):
		a=ref[int(raw_input())]
		print "{:07b}".format(a^e)
		e=a

### FIXED CODE ###

ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass
,m = map(int,input().split())
ls = [[int(x) for x in input().split()]for i in range(m)]
lst = []
ans = 0
ans_2 = 0
for i in range(m):
    a,b = ls[i][0],ls[i][1]
    for j in range(n):
        if a<=j<=b:
          lst.append(j)
for _ in range(n):
    if lst.count(_) == m:
        ans += 1
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
k_1 = []
k_2 = []
for i in range(M):
  l,r = map(int,input().split())
  k_1.append(l)
  k_2.append(r)
if max(k_1)<=min(k_2):
  print(min(k_2)-max(k_1)+1)
else:
  print(0)
x=input()
if x==A:
  print(T)
elif x==T:
  print(A)
elif x==G:
  print(C)
else:
  print(G)


### FIXED CODE ###

x=input()
if x=='A':
    print('T')
elif x=='T':
    print('A')
elif x=='G':
    print('C')
elif x=='C':
    print('G')
N N = int(input())
A = list(map(int,input().split()))

ans = 0
for a in range(0,len(A),2):
    if A[a]% 2 == 1:
        ans += 1
print(ans)
    

### FIXED CODE ###

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

ans = 0
for a in range(0,len(A),2):
    if A[a]% 2 == 1:
        ans += 1
print(ans)
h = int(input())
a = int(input())
counter = 0

while h > 0:
    h -= a
    counter += 1
    
print(counter)

### FIXED CODE ###

h,a = map(int, input().split())
counter = 0

while h > 0:
    h -= a
    counter += 1
    
print(counter)
if l == 'SSS':
	print(0)

elif l == 'SSR' or l == 'RSS' or l == 'SRS' or l == 'RSR':
	print(1)

elif l == 'SRR' or l == 'RRS':
	print(2)
  
elif l == 'RRR':
	print(3)

### FIXED CODE ###

l = input()

if l == 'SSS':
	print(0)

elif l == 'SSR' or l == 'RSS' or l == 'SRS' or l == 'RSR':
	print(1)

elif l == 'SRR' or l == 'RRS':
	print(2)
  
elif l == 'RRR':
	print(3)
n = int(input())
a,b,c = input(),input(),input()

ans = 0
for i in range(n):
  cnt = len(set(a[i],b[i],c[i]))-1
  ans += cnt

print(ans)

### FIXED CODE ###


n = int(input())
a = input()
b = input()
c = input()

ans = 0
for i in range(n):
    cnt = 2
    if a[i]==b[i]: cnt -= 1
    if b[i]==c[i]: cnt -= 1
    if c[i]==a[i]: cnt -= 1
    if cnt<0: cnt = 0
    ans += cnt

print(ans)
import sys
a = 1

While 1:
        x = sys.stdin.readline().strip()
        if x == 0:
                  break;
        print("Case {0}: {1}".format(a,x))
        a += 1
        

### FIXED CODE ###

import sys
a = 1

for i in sys.stdin:
        x = i.strip()
        if x == "0":
                break;
        print("Case {0}: {1}".format(a,x))
        a += 1
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors


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

d = {}
for a in A:
    for x in make_divisors(a):
        d[x] = d.get(x, 0) + 1

print(sorted([(k,v) for k,v in d.items() if v >= N-1], key=lambda x: -x[0])[0][0])


### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

L = [0] * N
R = [0] * N

L[0] = A[0]
R[N-1] = A[-1]

for n in range(1, N):
    L[n] = gcd(L[n - 1], A[n])
for n in reversed(range(N-1)):
    R[n] = gcd(R[n + 1], A[n])

ans = 0
for n in range(N):
    if n == 0:
        ans = max(ans, R[n+1])
    elif n == N - 1:
        ans = max(ans, L[n-1])
    else:
        ans = max(ans, gcd(L[n-1], R[n+1]))

print(ans)
n = input()
S = set(int(),raw_input().split())
m = input()
T = set(int(),raw_input().split())
print len(S&T)

### FIXED CODE ###

n = input()
S = set([int(s) for s in raw_input().split()])
m = input()
T = set([int(s) for s in raw_input().split()])
print len(S&T)
n = int(input())
h = list(map(int, input().split()))

ans = 0
tmp = 0
for i in range(n):

    if h[i] >= h[i + 1]:
        tmp += 1
    elif ans < tmp:
        ans = tmp
        tmp = 0
    
else:
    if ans < tmp:
        ans = tmp

print(ans)


### FIXED CODE ###

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

ans = 0
tmp = 0
for i in range(n - 1):

    if h[i] >= h[i + 1]:
        tmp += 1
    else:
        if ans < tmp:
            ans = tmp
        tmp = 0
    
else:
    if ans < tmp:
        ans = tmp

print(ans)
from collections import Counter
from operator import itemgetter

N = int(input())
A = Counter(map(int,input().split()))
A1 = list(A.items())
A1 = sorted(A1,key=itemgetter(1),reverse = True)
A1 = sorted(A1,key=itemgetter(0),reverse = True)
#print(A1)

#正方形の場合
B =[]
for i in range(len(A1)):
    if A1[i][1] > 3:
        B.append(A1[i][0])
        if len(B) == 1:
            break
C =[]
for i in range(len(A1)):
    if A1[i][1] > 1:
        C.append(A1[i][0])
        if len(C) == 2:
            break

if len(C) == 0:
    print(0)
else:
    print(max(B[0]*2,C[0]*C[1]))


### FIXED CODE ###

from collections import Counter
from operator import itemgetter

N = int(input())
A = Counter(map(int,input().split()))
A1 = list(A.items())
A1 = sorted(A1,key=itemgetter(1),reverse = True)
A1 = sorted(A1,key=itemgetter(0),reverse = True)
#print(A1)

#正方形の場合
B =[]
for i in range(len(A1)):
    if A1[i][1] > 3:
        B.append(A1[i][0])
        if len(B) == 1:
            break
C =[]
for i in range(len(A1)):
    if A1[i][1] > 1:
        C.append(A1[i][0])
        if len(C) == 2:
            break

if len(C) == 0:
    print(0)
elif len(B) !=0:
    print(max(B[0]*B[0],C[0]*C[1]))
else:
    print(C[0]*C[1])
s=input()
if len(s)<26:
    al=[chr(ord('a') + i) for i in range(26)]
    for i in al:
        if not(i in s):
            print(s+i)
            exit()
if s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()
for i in range(25):
    if s[i]>s[i+1]:
        k=i-1
        break
a="z"
for i in range(k+2,26):
    if s[k]<s[i]:
        a=min(a,s[i])
print(s[:k]+a)

### FIXED CODE ###

s=input()
if len(s)<26:
    al=[chr(ord('a') + i) for i in range(26)]
    for i in al:
        if not(i in s):
            print(s+i)
            exit()
if s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()
a=[]
for i in range(25,-1,-1):
    for j in range(24-(25-i),-1,-1):
        if s[j]<s[i]:
            a.append(s[:j]+s[i])
print(min(a))
A,B,C=map(int,input().split())
print(max(A,B,C)-min(A,B,C)

### FIXED CODE ###

A,B,C=map(int,input().split())
print(max(A,B,C)-min(A,B,C))
import collections, scipy.special 
n, p = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
    a[i] %= 2
c = collections.Counter(a)
zero = c[0]
one = c[1]
ans = 0
if p == 0:
    s = 0
else:
    s = 1
for i in range(s, one, 2):
    ans += 2 ** zero * scipy.special.comb(one, i, exact=True)

print(ans)

### FIXED CODE ###

import collections, scipy.misc 
n, p = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
    a[i] %= 2
c = collections.Counter(a)
zero = c[0]
one = c[1]
ans = 0
if p == 0:
    s = 0
else:
    s = 1
for i in range(s, one + 1, 2):
    ans += 2 ** zero * scipy.misc.comb(one, i, exact=True)

print(ans)
from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]
    ans = []
    X, Y, Z, K = (int(_) for _ in input().split())
    A = list(int(_) for _ in input().split())
    A.sort()
    B = list(int(_) for _ in input().split())
    B.sort()
    C = list(int(_) for _ in input().split())
    C.sort()
    for a in A:
        for b in B:
            for i in range(min(len(C),3001)):
                ans.append(a + b + C[i])
    ans.sort()
    ans = ans[::-1]
    ans = ans[:K]
    print('\n'.join(map(str,ans)))

if __name__ == '__main__':
    main()


### FIXED CODE ###

from functools import reduce
import math

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input().rstrip())
    S = []
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    min_s = min(S)
    if(N % min_s == 0):
        print(N//min_s -1 + 5)
    else:
        print(N//min_s + 5)
    
if __name__ == '__main__':
    main()
while True:
    H, W = [int(i) for i in input().split()]
    if H == w == 0:
        break
    
    for h in range(H):
        for w in range(W):
            print('#',end='')
            
      
    
    print()
    
print()

### FIXED CODE ###

while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break
    
    for h in range(H):
        for w in range(W):
            print('#', end='')
        print()
    
    print()
#!/usr/bin/env python3
def func(a, i):
    return {a[0]:i, a[1]:i+1, a[2]:i+2}
A = {}
for i in range(3):
    A.update(func(input().split(), 3*i))
N = int(input())
b = [A.get(input(), -1) for _ in range(N)]
bingo = [[0, 1, 2], [3, 4, 5], [6, 7, 8],
         [0, 3, 6], [1, 4, 7], [2, 5, 8],
         [0, 4, 8], [2, 4, 6]]
for i in bingo:
    if set(i) <= set(b):
        print("Yes")
        break
else:
    print("No")

### FIXED CODE ###

#!/usr/bin/env python3
N = int(input())
print((N + 1) // 2)
while 1:
  H, W = map(int, input().split())
  if W == 0 and H == 0:
    break
  print "#"*W
  for i in range(1, H-1):
    print ("#" + ("." * (W-2)) + "#")
  print "#"* W
  print ""

### FIXED CODE ###

while 1:
   H, W = map(int, raw_input().split())
   if H == 0 and W == 0:
      break
   print "#"*W
   for i in range(1, H-1):
      print ("#"+"."*(W-2)+"#")
   print "#"*W
   print ""