peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
A, B = map(int, input().split())

A = 100 * A
B = 100 * B

a = 0
b = 0

for i in range(A, A+100):
    
    a = i / 8
    
    for j in range(B, B+100):
        
        b = j /10
        
        if a == b:
            
            print(int(a))
            break
    else:
        if i == A +99:
            print("-1")
        else:
            continue
    
    break
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

a.sort()
total = sum(a)

b = 0
c = total

ans = 10 ** 9
for i in range(n-1):
    b = b + a[i]
    c = total - b
    ans = min(ans, abs(b - c))

print(ans)
# Judge status: Wrong Answer
w,h,n = map(int, input().split())
l,r,d,u = (0,w,0,h)
for i in range(n):
  x,y,a = map(int, input().split())
  if a == 1:
    l = max(l,x)
  elif a == 2:
    r = min(r,x)
  elif a == 3:
    d = max(d,y)
  else:
    u = min(u,y)
print(max((r-l)*(u-d),0))
# Judge status: Accepted
A, B, K = map(int, input().split())

d = min(A, K)
#print('d:', d)
A -= d
K -= d
d = min(B, K)
#print('d:', d)
B -= d
K -= d

print(A, B)
# Judge status: Accepted
x, y = map(int,input().split())

if x * y == 0:
  if x <= y:
    print(y - x)
  elif x > y:
    print(x - y + 1)
    
elif x * y > 0:
  if x <= y:
    print(y - x)
  elif x > y:
    print(x - y + 2)
    
elif x * y < 0:
  if abs(x) <= abs(y):
    print(abs(y) - abs(x) + 1)
  elif abs(x) > abs(y):
    print(abs(x) - abs(y) + 1)
# Judge status: Accepted
k = int(input())
if k%2 == 0:
    print(k//2*k//2)
else:
    print(k//2*(k//2+1))
# Judge status: Accepted
s, t = list(input() for i in range(2))
print("Yes" if sorted(s) < sorted(t)[::-1] else "No")
# Judge status: Wrong Answer
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
count = 0
ans = "No"

N,K = I()
A = l()

before = 1

for i in range(N-K):
    after = before / A[i] * A[K+i]
    if after > before:
        print("Yes")
    else:
        print("No")
    before = after
# Judge status: Accepted
A,B = map(int, input().split())
print('Possible' if A%3 == 0 or B%3 == 0 or (A+B)%3 == 0 else 'Impossible')
# Judge status: Accepted
n, m = map(int, input().split())
x = [-1] * n
for _ in range(m):
    s, c = map(int, input().split())
    s -= 1
    if x[s] != -1 and x[s] != c:
        print(-1)
        quit()
    x[s] = c
if n > 1 and x[0] == 0:
    print(-1)
    quit()

if x[0] == -1:
    x[0] = 1 if n > 1 else 0
for i in range(1, n):
    if x[i] == -1:
        x[i] = 0
print(''.join(map(str, x)))
# Judge status: Accepted
A,B,C=map(int,input().split())
R_lis = [-1]*(B)

for i in range (B):
    R_lis[i] = A*(i+1)%B

if C in R_lis:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import numpy as np
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():

    N=int(input())
    A=list(map(int,input().split()))
    B=list(map(int,input().split()))[::-1]

    from itertools import accumulate


    AA = list(accumulate([0] + A))+[0]  # 累積和を格納したリスト作成
    BB = (list(accumulate([0] + B))+[0])[::-1]  # 累積和を格納したリスト作成

    sumlist=np.array(AA)+np.array(BB)
    print(max(sumlist))


resolve()
# Judge status: Wrong Answer
import itertools
num = str(input())
sign = ("+", "-")
for s1, s2, s3 in itertools.product(sign, repeat=3):
    result = num[0] + s1 + num[1] + s2 + num[2] + s3 + num[3]
    if eval(result) == 7:
        print(result)
        break
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
def move():
    global a
    s = [0] * (n + 1)
    for i in range(n):
        s[max(0, i - a[i])] += 1
        s[min(n, i + a[i] + 1)] -= 1
    for i in range(1, n + 1):
        s[i] += s[i - 1]
    if all(map(lambda i: a[i] == s[i], range(n))):
        return True
    a = s
    return False
for _ in range(k):
    if move():
        break
print(*a[:n])
# Judge status: Accepted
import sys
input = sys.stdin.readline
import itertools

N,M = map(int,input().split())
a=[tuple(map(str,input().split())) for _ in range(M)]
ac = [0]*N
wa = [0]*N
for i in range(M):
    q = int(a[i][0])-1
    res = a[i][1]
    if res == 'AC':
        ac[q] = 1
    else:
        if ac[q] == 0:
            wa[q] += 1
wa2=0
for i in range(N):
    if ac[i]==1:
        wa2 += wa[i]
print("{} {}".format(sum(ac),wa2))
# Judge status: Accepted
n = int(input())
x = list(map(int,input().split(" ")))
x_max = max(x)
x_min = min(x)
l =[]

for i in range(x_min,x_max + 1):
    si = 0
    for j in range(n):
        xj = x[j]
        xj_p = (xj - i) ** 2
        si += xj_p
    l.append(si)

l.sort()
print(l[0])
# Judge status: Accepted
N, *A = map(int, open(0).read().split())

r = 0
ans = 0
for a in A:
    if a == 0:
        r = 0
        continue
    q, r = divmod(a + r, 2)
    ans += q
print(ans)
# Judge status: Wrong Answer
N,M=list(map(int,input().split()))
ans=0
for u in range(N):
  a,b=map(int,input().split())
  S=a*a+b*b
  if M*M<=S:
    ans+=1
print(ans)
# Judge status: Wrong Answer
al = [map(int, input().split()) for i in range(3)]
n = int(input())
bl = [int(input()) for i in range(n)]
check = [0 for i in range(9)]

for b in bl:
    if b in al:
        check[al.index(b)] = 1

if [1,1,1] in [check[:3], check[3:6], check[6:], check[0:7:3], check[1:8:3], check[2:9:3], check[0:9:4], check[3:8:2]]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a,b=mi()
if b%2==1:
  print("No")
  sys.exit()
if 2*a<=b<=4*a:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import numpy as np

a, b, c, d = map(int, input().split())
x = np.array([a, b])
y = np.array([c, d])
z = np.outer(x, y)
print(z.max())
# Judge status: Accepted
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
import numpy as np
#======================================================#
MOD=10**9+7
def main():
    n = II()
    aa = np.array(MII())
    ans = 0
    for i in range(60):
        cnt1 = int((aa&1).sum())
        ans += cnt1*(n-cnt1)*(2**i)
        aa >>= 1
    print(ans%MOD)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 22:54:45 2020

@author: Kanaru Sato
"""

n,k,q = list(map(int, input().split()))
dict = {}

for i in range(q):
    ans = input()
    if ans not in dict:
        dict[ans] = 1
    else:
        dict[ans] += 1

points = []

for i in range(1,n+1):
    if str(i) in dict and dict[str(i)]+k-q>0:
        points.append("Yes")
    else:
        points.append("No")

for i in range(n):
    print(points[i])
# Judge status: Accepted
X, N = map(int,input().split())
if N == 0:
  print(X)
else:
  q = list(map(int,input().split()))
  q = list(set(q))
  p = [i for i in range(-2 , 102)]
  for i in range(len(q)):
    p.remove(q[i])

  S = 103
  for i in range(len(p)):
    if abs(X - p[i]) < S :
      ans = p[i]
      S = X - ans
    elif abs(X - p[i]) == S :
      if p[i] < ans :
        ans = p[i]
  print(ans)
# Judge status: Accepted
n = int(input())
print(n//2+n%2)
# Judge status: Accepted
import collections
n,rev = int(raw_input()) ,False
class Node(object):
	def __init__(self, val):
		self.val = val
		self.next, self.prev = None, None

for i,ai in enumerate(map(int, raw_input().split())):
	node = Node(ai)		
	if i  == 0:
		head,tail = node,node
	else:
		if rev:
			head.prev, node.next = node, head
			head = node
		else:
			tail.next, node.prev = node, tail
			tail = node
		rev ^=  True

cur = head if not(rev) else tail  
while(cur):
	print cur.val, 
	cur = cur.next if not(rev) else cur.prev
# Judge status: Wrong Answer
N=int(input())
S=input()
ans=S.count("W")
for i in range(N):
  if S[i]=="W":
    ans-=1
  if i!=0:
    if S[i-1]=="E":
      ans+=1
  if i!=0:
    ans1=max(ans,ans1)
  else:
    ans1=ans
  print(ans)
print(N-1-ans1)
# Judge status: Wrong Answer
S = input()
N = len(S)
t_cnt = 0
s_cnt = 0

for i in range(N):
    if S[i] == 'T':
        t_cnt += 1
    else:
        break

for i in range(N):
    if S[N-1-i] == 'S':
        s_cnt += 1
    else:
        break

print(max(t_cnt,s_cnt) * 2)
# Judge status: Wrong Answer
n=int(input())
v=[int(input()) for i in range(n)]
t=sorted(v)
for i in v:
  print(t[1] if i==t[0] else t[0])
# Judge status: Wrong Answer
n = int(input())
s = input()
t = input()

ans = s + t
for i in range(n):
    is_same = True
    for j in range(i, n):
        if s[j] != t[j - i]:
            is_same = False
            break
    if is_same:
        ans = s[:i] + t

print(len(ans))
# Judge status: Wrong Answer
n = int(input())

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

ans = 0

x_sum = sum(x_list) //  n + 1

for x in x_list:
    ans += (x-x_sum)**2
    continue

print(ans)
# Judge status: Accepted
W,H,x,y=map(int,input().split())

S=W*H/2

if x+x==W and y+y==H:
    ans=1
else:
    ans=0

print(str('{:.10f}'.format(S))+' '+str(ans))
# Judge status: Wrong Answer
import math

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

x.append(X)
x.sort()

if N==1:
    ans = x[1]-x[0]
else:
    for i in range(N-1):
        ans = math.gcd(x[i+1]-x[i], x[i+2]-x[i+1])

print(ans)
# Judge status: Accepted
x, y = list(map(int, input().split()))
group = 0

a = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]

if a[x] == a[y]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x,y = map(int,input().split())
if ((x >= 0 and y >= 0) or (x < 0 and y < 0)) and x < y:
    print(abs(x-y))
elif (x >= 0 and y >= 0) and y < x:
    print(abs(x-y+1+(y != 0)))
elif (x < 0 and y < 0) and y < x:
    print(abs(x-y)+2)
elif x == -y:
    print(1)
else:
    print(abs(abs(x)-abs(y))+(y != 0))
# Judge status: Accepted
a = input()
if "7" in a:
  print("Yes")
else: 
  print("No")
# Judge status: Accepted
n, k = map(int, input().split())
count = 1

while n // k > 0:
    n = n // k
    count += 1
print(count)
# Judge status: Accepted
import numpy as np
n = int(input())
a = [int(i)- k-1 for k,i in enumerate(input().split())]
ans = 10**9
a = np.array(a,dtype = 'int64')
median = int(np.median(a))

print(np.sum(np.abs(a-median)))
# Judge status: Wrong Answer
n, t = map(int, input().split())
ans = float('inf')
for _ in range(n):
    x, y = map(int, input().split())
    if y <= t:
        ans = min(ans, x)
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 0
a.sort()
for i in range(1, n+1) :
    ans += a[-2*i]
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N-K):
    # print(A[i], A[i+K])
    if A[i] < A[i+K]:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
S = input()
ls = {"dream","dreamer","erase","eraser"}
now = ""
for i in range(len(S)):
  now += S[i]
  if now in ls:
    now = ""
if now == "":
  print("YES")
else:
  print("NO")
# Judge status: Accepted
a, b, k = map(int, input().split())

if a >= k:
  c = a-k
  e = "{0} {1}".format(c, b)
  print(e)
  
elif a < k <= a + b:
  c = b + a - k
  e = "{0} {1}".format(0, c)
  print(e)

else:
  print('0' +' ' +  '0')
# Judge status: Wrong Answer
n = int(input())
w = list(map(int, input().split()))

total = sum(w)
s1 = [0]*(n-1)
s2 = [0]*(n-1)
for i in range(n-1):
    s1[i] = sum(w[0:i])
    s2[i] = total - s1[i]

d = [0] * (n-1)
for i in range(n-1):
    d[i] = abs(s1[i] - s2[i])

print(min(d))
# Judge status: Accepted
n = int(input())
s = input()
t = input()
ans = n
for i in range(n):
    if s[i:] == t[:n-i]:
        print(ans)
        exit()
    ans +=1
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
c = input()
print(c.translate(str.maketrans("abcdefghijklmnopqrstuvwxy", "bcdefghijklmnopqrstuvwxyz")))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

codd = 0
cfour = 0

for i in range(n):
	if a[i]%4 == 1 or a[i]%4 == 3:
		codd += 1
	if a[i]%4 == 0:
		cfour += 1

if cfour == codd:
	print('Yes')
else:
	print('No')
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if (500*i + 100*j + 50*k) ==X:
                ans += 1

print(ans)
# Judge status: Accepted
S=input()
if S=="ABC": print("ARC")
else: print("ABC")
# Judge status: Accepted
a,b,c,d = map(int,input().split())
for i in range(100):
  c -= b
  if c <=0:
    ans = 'Yes'
    break
  a -= d
  if a <= 0:
    ans = 'No'
    break
print(ans)
# Judge status: Wrong Answer
a = sorted(list(map(int, input().split())))
k = int(input())
a[-1] = 2*k*a[-1]
print(sum(a))
# Judge status: Accepted
h, w= list(map(int, input().split()))
if h == 1 or w == 1:
    print(1)
else:
    ans = h*w/2
    if ans == int(ans):
        print(int(ans))
    else:
        print(int(ans + 0.5))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a%3==0 or b%3==0 or a+b%3==0:
  print("Possible")
else:
  print("Impossible")
# Judge status: Wrong Answer
N=int(input())

def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = sorted(list(set(table)))
    return table[1:]

lis=divisor(N)
count=0
for z in lis:
    if N % z ==0:
        N=N/z
        count+=1
print(count)
# Judge status: Accepted
n = int(input())
s = input()
right, left = 0, s.count('.')
r = [left]
for i in range(n):
    if s[i]=='#':
        right += 1
    else:
        left -= 1
    r.append(right+left)
print(min(r))
# Judge status: Wrong Answer
a=2
b=a+a^2+a^3
print(b)
# Judge status: Accepted
s = input()
if s == 'hi' * int(len(s)//2):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = 1
mod = 998244353
if a[0] !=0:
    ans = 0

cnt = [0]*n
for i in range(n):
    cnt[a[i]] += 1
for i in range(1,n):
    ans *= cnt[a[i]-1]
    ans %= mod
print(ans)
# Judge status: Accepted
N = int(input())
print(N // 2 if N % 2 == 0 else N // 2 + 1)
# Judge status: Accepted
N, K = map(int,input().split())

def probability(p):
    if p >= K:
        return 1
    cnt = 0
    while(p < K):
        p = p * 2
        cnt += 1
    return 1 / (2 ** cnt)

ans = 0

for i in range(1, N+1):
    ans += probability(i)
    
ans /= N

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
max = 0
sum = 0
for i in range(n):
  if a[i] > max:
    max = a[i]
  else:
    sum += (max - a[i]) 
print(sum)
# Judge status: Wrong Answer
s = input()
for i, s_ in enumerate(s, 1):
  if not (i%2==1) and (s_ in ['R', 'U', 'D']):
    print('No')
    exit()
  if not (i%2==0) and (s_ in ['L', 'U', 'D']):
    print('No')
    exit()

print('Yes')
# Judge status: Wrong Answer
# https://atcoder.jp/contests/abc105/tasks/abc105_c
# -2進数
# 前に考えたときはわからなかったけど、数式イジイジしたら解けた


N = int(input())
ans = ''

while N != 0:
    if N & 1:  # 奇数ならbitが立つのは共通する性質
        ans += '1'
        N /= -2
        if N > 0:
            N += 1
        N = int(N)
    else:
        ans += '0'
        N //= -2


print(ans[::-1])
# Judge status: Accepted
ABC=list(map(int,input().split(' ')))
K=int(input())
print(sum(ABC)-max(ABC)+max(ABC)*pow(2,K))
# Judge status: Accepted
a,b = map(int, input().split())

ans = (b-a)*(b-a+1)//2 - b

print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())

if 4 * a * b < (c - a - b) ** 2 and c - a - b > 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
 
stdin = sys.stdin

mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

a, b = na()

if a > 8 or b > 8:
    print(":(")
else:
    print("Yay!")
# Judge status: Accepted
N = int(input())

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

ans = a[0] + sum(b)
for i in range(1, N):
  temp = sum(a[:i + 1]) + sum(b[i:])
  ans = max(ans, temp)

print(ans)
# Judge status: Accepted
print(eval("+".join(sorted(input()))+"*10"))
# Judge status: Accepted
S = input()

cnt = 0
results = []

for i in range(len(S)):
    if S[i] in ['A', 'C', 'G', 'T']:
        cnt += 1
    else :
        results.append(cnt)
        cnt = 0
    results.append(cnt)
    
print(max(results))
# Judge status: Accepted
w, a, b = map(int, input().split())
if abs(a - b) <= w:
    print(0)
else:
    print(abs(a - b) - w)
# Judge status: Accepted
from itertools import permutations

N = int(input())
xlist = []
ylist = []

n = 1
for i in range(1, N+1):
    x, y = map(int, input().split())
    xlist.append(x)
    ylist.append(y)
    n *= i

ans = 0
for perm in permutations(range(N)):
    for i in range(N-1):
        x1, y1 = xlist[perm[i]], ylist[perm[i]]
        x2, y2 = xlist[perm[i+1]], ylist[perm[i+1]]
        ans += ((x1 - x2)**2 + (y1 - y2)**2)**0.5 / n

print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
ALL=[]
for i in range(k):
    d=int(input())
    A = list(map(int,input().split()))
    for ii in range(d):
        ALL.append(A[ii])
ans=list(set(list(range(1,n+1))) - set(ALL))
print(len(ans))
# Judge status: Accepted
s=input()
a=0
b=0
c=0
for i in range(3):
    if s[i]=="a":
        a+=1
    elif s[i]=="b":
        b+=1
    elif s[i]=="c":
        c+=1
if a==1 and b==1 and c==1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
X, Y = map(int, input().split())
print(X+(Y//2))
# Judge status: Accepted
n = input()
for i in range(2):
    if n[i] == n[i+1] and n[i+1] == n[i+2]:
        print("Yes")
        exit()
print("No")
# Judge status: Accepted
s = int(input())
l = [s]
ans = True
while ans:
    m = len(l)
    if l[m - 1] % 2 == 0:
        l.append(l[m - 1] // 2)
    else:
        l.append(3 * l[m - 1] + 1)
    for i in range(m):
        if l[i] == l[m]:
            print(m + 1)
            ans = False
# Judge status: Accepted
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    for _ in range(k):
        imos = [0] * (n + 1)
        for i in range(n):
            imos[max(0, i - a[i])] += 1
            imos[min(n, i + a[i] + 1)] -= 1
        for i in range(1, n):
            imos[i] += imos[i-1]
        imos.pop()
        a = imos
        if min(a) == n:
            break 
    print(*a)
main()
# Judge status: Accepted
def main():
    S = input()

    ans = 1000
    for i in range(len(S)-2):
        tmp = abs(int(S[i:i+3]) - 753)
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    A, B, C = input().split()

    ans = max(int(A + B) + int(C), int(B + C) + int(A), int(C + A) + int(B))

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
X, A, B = map(int, input().split())
D = {abs(X-A):"A", abs(X-B):"B"}

print(D[min(abs(X-A), abs(B-X))])
# Judge status: Accepted
#106_C
S=input()
K=int(input())
ans=0
for i in range(len(S)):
    if S[i]!='1':
        ans=i
        break

print('1' if K<=ans else S[ans])
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().split()))
S = 1000
K = 0
b = 1
last = 0
			
for i in range(N):
	if i != N-1:
		if a[i]<=a[i+1]:
			K = S // a[i]
			S -= K*a[i]
			last = i
		if a[i]>a[i+1]:
			S += a[i]*K
			K = 0
	else:
		if a[i]<=a[last]:
			S += a[last]*K
		else:
			S += a[i]*K
print(S)
# Judge status: Wrong Answer
color=input().split()
x,y=map(int,input().split())
color2=input()

if color2==color[0]:
    print(x-1)
else:
    print(y-1)
# Judge status: Accepted
N = int(input())
s = set()
for i in range(N):
    s ^= {int(input())}
print(len(s))
# Judge status: Accepted
n=int(input())
a=[0]+list(map(int,input().split()))

m=0
ans=[]
c=[0]*(n+1)
for i in reversed(range(1,n+1)):
  if a[i]%2!=c[i]%2:
    m+=1
    ans.append(i)
    j=1
    r=set()
    while j*j<=i:
      if i%j==0:
        r.add(j)
        r.add(i//j)
      j+=1
    for j in r:
      c[j]+=1
      c[j]%=2
        
print(m)
print(*sorted(ans))
# Judge status: Wrong Answer
N, R = map(int, input().split())
print(R if 10>=N else R-100*(10-N))
# Judge status: Accepted
N = int(input())

for X in range(1, N+1):
    if X*108//100==N:
        print(X)
        break
else:
    print(':(')
# Judge status: Wrong Answer
from collections import deque
k,n = map(int,input().split())
a = deque(list(map(int,input().split())))
b = []
for i in range(n):
	b.append(a[i]-k)
b = deque(reversed(sorted(b)))
for i in range(n):
	a.appendleft(abs(b[i]))
a = list(a)
x = []
sa = []
#print(a)
sb = []
for i in range(len(a)):
	sa.append(sum(a[:i+1]))
for i in range(len(a)-n):
	sb.append(sa[i+n]-sa[i])

print(min(sb))
# Judge status: Accepted
n = int(input())
t,a= map(int, input().split())
l = list(map(int, input().split()))

x = t - l[0] * 0.006
tmp = []
for x in l:
    x = t - x * 0.006
    tmp.append(x)

ans = []

for z in tmp:
    y = a - z
    ans.append(abs(y))

print(ans.index(min(ans)) + 1)
# Judge status: Accepted
import sys

def S(): return sys.stdin.readline().rstrip()

A,B,T = map(int,S().split())

print(T//A*B)
# Judge status: Accepted
L,R,D = map(int,input().rstrip().split(" "))
ans = 0
for i in range(L,R+1):
    if i % D == 0:
        ans += 1
print(ans)
# Judge status: Wrong Answer
a, b, c, d, = input()
print("Yes" if "a"=="b"=="c" or "b"=="c"=="d" else "No")
# Judge status: Wrong Answer
s,t =map(str,input().split())
a,b =map(int,input().split())
u=input()
if u==s:
    print(a-1)
else:
    print(b-1)
# Judge status: Accepted
N=int(input())
A=sorted(map(int,input().split()))
ans=0
for i in range(N-1):
  ans+=A[i]

if ans<=A[N-1]:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
import itertools

abcd = input()
memo = list(itertools.product(['+', '-'], repeat=3))

for i in range(2 ** 3):
    cnt = int(abcd[0])
    for j in range(3):
        if memo[i][j] == '+':
            cnt += int(abcd[j + 1])
        else:
            cnt -= int(abcd[j + 1])
    if cnt == 7:
        print(abcd[0] + memo[i][0] + abcd[1] + memo[i][1] + abcd[2] + memo[i][2] + abcd[3] + '=7')
        break
# Judge status: Wrong Answer
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == 'red':
    print(A-1, B)
else:
    print(A, B-1)
# Judge status: Accepted
def main():
  s = input()
  t = s[::-1]
  count = 0
 
  for i in range(len(s)//2):
     if s[i] != t[i]:
      count += 1
    
  print(count)

if __name__ == '__main__':
    main()
# Judge status: Accepted

def resolve():
    # P は [0, 1]
    N, P = map(int, input().split())
    A = list(map(int, input().split()))

    odds = sum([1 for a in A if a % 2 == 1])

    ans = 0
    if odds == 0:
        if P == 0:
            ans = 2 ** N
    else:
        ans = 2 ** (N - 1)

    print(ans)


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
def judgement(n, m):
    if n == m:
        return 'Yes'
    else:
        return 'No'

if __name__ == "__main__":
    n, m = input().split(' ')
    print(judgement(n, m))
# Judge status: Accepted
n = input()
if "7" in n:
  print("Yes")
else:
  print('No')
# Judge status: Wrong Answer
import math
n,m=map(int,input().split())
num=int(math.sqrt(m))
ans=1
if n==1:
    ans=m
else:
    for i in range(1,num+2):
        if m%i==0 and m//i>=n:
            ans=max(ans,i)
print(ans)
# Judge status: Wrong Answer
A, B, C, X, Y = map(int,input().split())

m = 10^10
for i in range(X):
  for j in range(Y):
    k = max(2*X-2*i,2*Y-2*j)
    m = min(m,A*i+B*j+C*k)
    
print(m)
# Judge status: Accepted
n = input()
res = 0
for i in range(len(n)):
    res += int(n[i])
if res % 9 == 0:
    print("Yes")
else:
    print("No")