Harryxun/stf_run huggingface dataset:
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

c = 0
for i in range(n):
    ai = a[i]
    bi = b[i]
    if ai < bi:
        c += (bi-ai)//2
    else:
        c -= (ai-bi)
print('Yes' if c >= 0 else 'No')


### FIXED CODE ###

x,y=map(int,input().split())
if x%y==0:
    print('-1')
else:
    print(x)
def main():
  r,D,X_2000=map(int,input().split())
  x=[]
  x.append(X_2000)
  for i in range(1:11):
    x[i]=r*x[i-1]-D
    x.append(x[i])
    print(x[i])
main()

  

### FIXED CODE ###

def main():
  r,D,X_2000=map(int,input().split())
  x=[]
  x.append(X_2000)
  for i in range(1,11):
    x.append(r*x[i-1]-D)
    print(x[i])
main()
X,N = map(int, input().split())
if N ==0:
  print(X)
  exit() 
if N !=0:
  p = list(map(int, input().split()))
if p.count(X) == 0:
  print(X)
  exit()
for a in range(1000):
  if p.count(X-a) ==0:
    print(X-a)
    exit()
  elif p.count(X+a) ==0:
    print(X+a)
    exit()


### FIXED CODE ###

s = list(map(int, input().split()))
for i in range(len(s)):
  if s[i]==0:
    print(i+1)
N, K = map(int, input().split())

MOD = 10 ** 9 + 7

cache = {}
def f(k, n):
    if k == 1:
        return 1
    if k in cache:
        return cache[k]
    result = pow(k, n, MOD)
    for i in range(2, k + 1):
        result -= f(k // i, n)
        result %= MOD
    cache[k] = result
    return result


result = 0
for i in range(K + 1):
    result += f(K // i, N) * i
    result %= MOD
print(result)


### FIXED CODE ###

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

MOD = 10 ** 9 + 7

cache = {}
def f(k, n):
    if k == 1:
        return 1
    if k in cache:
        return cache[k]
    result = pow(k, n, MOD)
    for i in range(2, k + 1):
        result -= f(k // i, n)
        result %= MOD
    cache[k] = result
    return result

result = 0
for i in range(2, K + 1):
    result += f(K // i, N) * i
result += f(K, N)
result %= MOD
print(result)
N = int(input())
g = [ [] for i in range(N)]
for _ in range(N-1):
  a, b = map(int, input().split())
  g[b-1].append(a-1)
  g[a-1].append(b-1)
visit = [0]*N
e = []
a = [0]*N
b = [0]*N
def tansakuf(i):
  visit[i] = 1
  for j in g[i]:
    if visit[j] == 0:
      a[j] = a[i] + 1
      e.append(j)
  if len(e) != 0:
    f = e[0]
    e.pop(0)
    return tansakuf(f)
tansakuf(0)
visit = [0]*N
def tansakus(i):
  visit[i] = 1
  for j in g[i]:
    if visit[j] == 0:
      b[j] = b[i] + 1
      e.append(j)
  if len(e) != 0:
    f = e[0]
    e.pop(0)
    return tansakus(f)
tansakus(N-1)
cnt = 0
for i in range(N):
  if a[i] <= b[i]:
    cnt += 1
  else:
    cnt -= 1
if cnt > 0:
  print('Fennec')
else:
  print('Snuke')

### FIXED CODE ###

from collections import deque
N = int(input())
g = [[] for i in range(N)]
for _ in range(N-1):
  a, b = map(int, input().split())
  g[b-1].append(a-1)
  g[a-1].append(b-1)
a = [-1]*N
b = [-1]*N
def bfs(n):
  q=deque()
  q.append(n)
  a[n] = 0
  while len(q):
    x=q.popleft()
    for i in g[x]:
      if a[i]==-1: 
        a[i]=a[x]+1
        q.append(i)
bfs(0)
def bfs2(n):
  q=deque()
  q.append(n)
  b[n] = 0
  while len(q):
    x=q.popleft()
    for i in g[x]:
      if b[i]==-1: 
        b[i]=b[x]+1
        q.append(i)
bfs2(N-1)
cnt = 0
for i in range(N):
  if a[i] <= b[i]:
    cnt += 1
  else:
    cnt -= 1
if cnt > 0:
  print('Fennec')
else:
  print('Snuke')
for i in range(1,10):
	for j in range(1,10):
		print str(i)+"x"+str(j)"="+str(i*j)
		


### FIXED CODE ###

for i in range(1,10):
	for j in range(1,10):
		print str(i) + "x" + str(j) + "=" + str(i*j)
N, M = list(map(int, input().split()))
LRD = [list(map(int, input().split())) for i in range(M) ]
x = [-1]*(N+1)
unsolve = LRD

if M == 0:
    print("Yes")
    exit()

def sr(unsolves):
    nextUnsolve = []
    for u in unsolves:
        l, r, d = u
        if x[l] == -1 and x[r] == -1:
            nextUnsolve.append(u)
        elif x[l] == -1:
            x[l] = x[r] - d
        elif x[r] == -1:
            x[r] = x[l] + d
        else:
            if x[r] != x[l] + d:
                print("No")
                exit()
    if not not nextUnsolve:
        sr(nextUnsolve)

x[LRD[0][0]] = 0
sr(unsolve)

print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(200002)

N, M = map(int, input().split())
G = [[] for _ in range(N)]
x = [None] * (N)

def dfs(s):
    global x, G
    for t, d in G[s]:
        if x[t] is None:
            x[t] = x[s] + d
            if not dfs(t):
                return False
        else:
            if x[t] != x[s] + d:
                return False
    return True

for _ in range(M):
    L, R, D = map(int, input().split())
    G[L-1].append([R-1,  D])
    G[R-1].append([L-1, -D])

ans = True
for i in range(N):
    if x[i] is None:
        x[i] = 0
        ans &= dfs(i)

print("Yes" if ans else "No")
import math

a=int(input().split())
print(2*math.pi*a)

### FIXED CODE ###

import math

a=int(input())
print(2*math.pi*a)
import math
r=int(input())
m=math.pi
s=r*r*m
l=2*r*m
print(s,l)

### FIXED CODE ###

import math
r=float(input())
m=float(math.pi)
s=r*r*m
l=2*r*m
print(s,l)
Not found

### FIXED CODE ###

K, X = map(int, input().split())
for x in range(X-K+1, X+K):
    print(x, end=" ")
vs = input()
t = input()

stri = []
mincount = -1
for i in range(len(s)-len(t)+1):
    count = 0
    for j in range(len(t)):
        if(s[i+j] == t[j]):
            count+= 1
    mincount = max(mincount,count) 
print(len(t) - mincount)

### FIXED CODE ###

s = input()
t = input()

stri = []
for i in range(len(s)-len(t)+1):
    j = i+ len(t)
    stri.append(s[i:j])
maxcount = 0
for i in range(len(stri)):
    count = 0
    for j in range(len(t)):
        if(stri[i][j] ==t[j]):
            count+= 1
    maxcount = max(maxcount,count) 
print(len(t)-maxcount)
#http://compro.tsutajiro.com/archive/180220_probability_dp.pdf
import sys
n = int(input())
a = list(map(int, sys.stdin.readline().split( )))
cnt =[0,0,0]
for i in range(n):
    cnt[3-a[i]] += 1

divT = [1/i for i in range(1,n+1)]

from functools import lru_cache### 
@lru_cache(100100100)

def f(x,y,z):
    if x==y==z==n:
        return 0
    res = 0
    delta = n*divT[n-z-1]
    if x != n:
        res += (f(x+1,y,z) + delta) * (n-x)
    if y != x:
        res += (f(x,y+1,z) + delta) * (x-y)#x+1,y+1ではない
    if z != y:
        res += (f(x,y,z+1) + delta)* (y-z)#x+1,y+1,z+1ではない
    res *=divT[n-z-1]
    return res
    

print(f(cnt[1]+cnt[2],cnt[2],0))


### FIXED CODE ###

#http://compro.tsutajiro.com/archive/180220_probability_dp.pdf
import sys
n = int(input())
a = list(map(int, sys.stdin.readline().split( )))
cnt =[0,0,0]
for i in range(n):
    cnt[3-a[i]] += 1
dp = [[[0 for _ in range(n+1)] for __ in range(n+1)] for ___ in range(n+1)]

dp[n][n][n] = 0
divT = [1/i for i in range(1,n+1)]

for x in range(n,cnt[1]+cnt[2]-1,-1):## -2だったのを-1に
    for y in range(x,cnt[2]-1,-1):##cnt[2]
        for z in range(y,-1,-1):
            delta = n*divT[n-z-1]#2枚以下を引くまで
            if x != n:
                dp[x][y][z] += (dp[x+1][y][z] + delta) * (n-x)
            if y != x:
                dp[x][y][z] += (dp[x][y+1][z] + delta) * (x-y)#x+1,y+1ではない
            if z != y:
                dp[x][y][z] += (dp[x][y][z+1] + delta)* (y-z)#x+1,y+1,z+1ではない
            dp[x][y][z] *=divT[n-z-1]

print(dp[cnt[1]+cnt[2]][cnt[2]][0])
N,K = list(map(int,input().split()))
R = list(map(int,input().split()))
R.sort(reverse=True)
for i in range(K):
    R.pop(0)
print(sum(R))

### FIXED CODE ###

N,K = list(map(int,input().split()))
R = list(map(int,input().split()))
R.sort(reverse=True)
if N < K:
    print(0)
    exit()
for i in range(K):
    R[i] = 0
print(sum(R))
while true:
H,W = map(int,raw_input().split())

 if W==0 and H==0 :
    break
 
 else :
 print ('#' * W + '\n')

 for i in range(H-2) :
   print ('#'+ '.'*(W-2)+ '#'+'\n')

  print ('#'*W + '\n')

### FIXED CODE ###

while 1:
    H, W = map(int,raw_input().split())
    if H + W == 0: break
    print ('#' * W)
    for h in range(H-2):
        print ('#' + '.' * (W - 2) + '#')
    print ('#' * W + '\n')
N,M = map(int,input().split())
import numpy as np
A = sorted(np.array(list(map(int,input().split()))),reverse=True)
bi = [0]*(A[0]+1)
for a in A:
  bi[a]+=1
  
cum = [0]*(A[0]+1)
for i in range(1,A[0]+1):
  cum[i]=cum[i-1]+bi[i]

cum_max = cum[-1]
left = 0
right = A[0]*2
while right-1!=left:
  x = (right+left)//2
  num = 0
  for a in A:
    b = max(x-a,1)
    if b<=A[0]:
      num += cum_max-cum[b-1]
    
  if num>M:
    left=x
  else:
    right=x

ans = 0
for a in A:
  b = max(x-a,1)
  c = cum_max-cum[b-1]
  ans+=(a*c)+(sum(A[:c]))
  
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())),reverse=True)
bi = [0]*(A[0]+1)
for a in A:
  bi[a]+=1
  
cum = [0]*(A[0]+1)
for i in range(1,A[0]+1):
  cum[i]=cum[i-1]+bi[i]

cum_max=cum[-1]
left = 0
right = A[0]*2+1
while right-1!=left:
  x = (right+left)//2
  num = 0
  for a in A:
    b = max(x-a,1)
    if b<=A[0]:
      num += cum_max-cum[b-1]
    
  if num>=M:
    left=x
  else:
    right=x

ans = 0
cum_A = [0]*(N+1)
for i in range(1,N+1):
  cum_A[i]=cum_A[i-1]+A[i-1]
for a in A:
  b = max(right-a,1)
  if b>A[0]:
    break
  c = cum_max-cum[b-1]
  M-=c
  ans+=(a*c)+cum_A[c]
  

ans+=M*left
print(ans)
N = int(input())
A = list(map(int, input().split()))

number = defaultdict(int)
for a in A:
    number[a] += 1

def combination(n, r):
    denominator = 1
    for i in range(n, n - r, -1):
        denominator *= i
    numerator = factorial(r)
    return denominator // numerator

combi = {}
combi2 = {}
for k, v in number.items():
    combi[k] = combination(v, 2)
    combi2[k] = combination(v - 1, 2)
combination_all = sum(combi.values())
# print(f"number:{number} combi:{combi} combi2:{combi2} combination_all:{combination_all}", file=sys.stderr)

for a in A:
    print(combination_all - (combi[a] - combi2[a]))

### FIXED CODE ###

from collections import defaultdict
from math import factorial

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

number = defaultdict(int)
for a in A:
    number[a] += 1

def combination(n, r):
    denominator = 1
    for i in range(n, n - r, -1):
        denominator *= i
    numerator = factorial(r)
    return denominator // numerator

combi = {}
combi2 = {}
for k, v in number.items():
    combi[k] = combination(v, 2)
    combi2[k] = combination(v - 1, 2)
combination_all = sum(combi.values())
# print(f"number:{number} combi:{combi} combi2:{combi2} combination_all:{combination_all}", file=sys.stderr)

for a in A:
    print(combination_all - (combi[a] - combi2[a]))
n=int(input())
p=list(map(float, input().split())
       
dp=[[0 for i in range(n+1)] for j in range(n+1)]
dp[0][0]=1

for i in range(1,n+1):
       for j in range(n+1):
       	if j==0:
       		dp[i][j]=(1.0-p[i-1])*dp[i-1][j]
       	else:
       		dp[i][j]=p[i-1]*dp[i-1][j-1]+(1.0-p[i-1])*dp[i-1][j]
res=0
for i in range(n//2+1,n+1):
       res+=dp[n][i]
print(res)       

### FIXED CODE ###

n=int(input())
p=list(map(float, input().split()))
       
dp=[[0 for i in range(n+1)] for j in range(n+1)]
dp[0][0]=1

for i in range(1,n+1):
       for j in range(n+1):
       	if j==0:
       		dp[i][j]=(1.0-p[i-1])*dp[i-1][j]
       	else:
       		dp[i][j]=p[i-1]*dp[i-1][j-1]+(1.0-p[i-1])*dp[i-1][j]
res=0
for i in range(n//2+1,n+1):
       res+=dp[n][i]
print(res)
from collections import defaultdict

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

ans = X
x = X

m = []
for i in range(0, M+1):
    m.append((i ** 2) % M)

C = [x]
Xd = defaultdict(lambda: -1)
Xd[x] = 0
Xl = [x]

for i in range(1, N):
    
    x = m[x]

    if Xd[x] > -1:
        # print(i)
        break
    Xd[x] = i
    Xl.append(x)
    ans += x
    C.append(ans)

# print(Xl)
# print(C)
# print(Xd[x], i)
S = C[i-1] - C[Xd[x]-1]
loop_len = i - Xd[x]
if loop_len > 0:
    loop_num = (N - i) // loop_len
    # print(loop_num)
    ans += loop_num * S
    m = N - loop_num * loop_len - i
    # print(ans)
    # print(m)
    ans += C[Xd[x]+m-1] - C[Xd[x]-1]

# print(S)

print(ans)

### FIXED CODE ###

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

ans = X
x = X

C = [0, x]
Xd = [-1] * (M+1)
Xd[x] = 0
i = 1

for i in range(1, N):
    x = x**2 % M

    if Xd[x] > -1:
        break
    Xd[x] = i
    ans += x
    C.append(ans)

loop_len = i - Xd[x]
if loop_len > 0:
    S = C[i] - C[Xd[x]]
    loop_num = (N - i) // loop_len
    ans += loop_num * S
    m = N - loop_num * loop_len - i
    ans += C[Xd[x]+m] - C[Xd[x]]

print(ans)
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [[] for _ in range(n)]
check = [False for _ in range(n)]
for i in range(m):
  a, b = map(int, input().split())
  ab[a-1].append(b)
  ab[b-1].append(a)

for j in range(n):
  for k in ab[j]:
    if h[j] <= h[k]:
      check[j] = True
      
print(check.count(True))

### FIXED CODE ###

n,m=map(int,input().split())
h=[0]+list(map(int, input().split()))
roads=[[] for _ in range(n+1)]
cnt=0
for i in range(m):
    a,b=map(int,input().split())
    roads[a].append(b)
    roads[b].append(a)

for i in range(1,n+1):
    for j in roads[i]:
        if h[i]<=h[j]:
            break
    else:
         cnt+=1
    
print(cnt)
x, y = map(int, input())
print(x * y)

### FIXED CODE ###

x, y = map(int, input().split())
print(x * y)
if N < 10:
    print(N)
elif N >= 10 and N < 100:
    print(9)
elif N >= 100 and N < 1000:
    print(N - 90)
elif N >= 1000 and N < 10000:
    print(909)
elif N >= 10000 and N < 100000:
    print(N-9090)
else:
    print(90909)

### FIXED CODE ###

N = int(input())

ans = 0

for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)
N=input()
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4:
    count=count+1
print(count)
    
    
    


### FIXED CODE ###

N=int(input())
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4 and ks!=6:
    count=count+1
print(count)
import sys
input = sys.stdin.readline
def main():
    n = int(input())
    s = int(input(), 2)
    pc0 = bin(s).count("1")
    ans = []
    for i in range(n):
        k = 1 << (n - 1 - i)
        x = k ^ s
        if x >= s:
            pc0 += 1
        else:
            pc0 -= 1
        x %= pc0
        cnt = 1
        while x > 0:
            pc = bin(x).count("1")
            x %= pc
            cnt += 1
        ans.append(cnt)
    print("\n".join(str(y) for y in ans))
if __name__ == '__main__':
    main()

### FIXED CODE ###

n = int(input())
s = input()
x = int(s, 2)
pcx = s.count("1")
pc1 = x % (pcx - 1) if pcx > 1 else 0
pc2 = x % (pcx + 1)

def f(j):
    cnt = 0
    while j:
        j %= bin(j).count("1")
        cnt += 1
    return cnt

for i, y in enumerate(s):
    k = n - 1 - i
    if y == "0":
        print(f((pc2 + pow(2, k, pcx + 1)) % (pcx + 1)) + 1)
    elif pcx > 1:
        print(f((pc1 - pow(2, k, pcx - 1)) % (pcx - 1)) + 1)
    else:
        print(0)
def segfunc(x, y): return max(x, y)

def init(tmpn):
    global noden
    n = 1
    while tmpn > n:
        n *= 2
    noden = n

def update(i, x):
    i += noden-1
    node[i] = x
    while i:
        i = (i-1)//2
        node[i] = segfunc(node[i*2 + 1], node[i*2 + 2])

def query(l, r):
    L = l + noden
    R = r + noden
    s = INF
    while L < R:
        if R & 1:
            R -= 1
            s = segfunc(s, node[R - 1])
        if L & 1:
            s = segfunc(s, node[L - 1])
            L += 1
        L >>= 1
        R >>= 1
    return s

N, K = map(int, input().split())
MAX_N = 2**(N-1).bit_length()
a = [int(input()) for _ in range(N)]
node = [0] * (30005)
noden = 0
INF = 0
init(N)
ma = 30005
ans = 0
for i in a:
    tmp = query(max(i - K, 0), min(ma, i + K + 1))
    update(i, tmp + 1)
    ans = max(ans, tmp + 1)
print(ans)

### FIXED CODE ###

def segfunc(x, y): return max(x, y)

class SegmentTree:
    def __init__(self, arr):
        size = len(arr)
        n = 2 ** (size - 1).bit_length()
        self.n = n
        self.node = [0] * (2*n)
        for i in range(size):
            self.node[i+n-1] = arr[i]
        for i in reversed(range(n-2)):
            self.node[i] = segfunc(self.node[2*i+1], self.node[2*i+2])

    def update(self, i, x):
        i += self.n - 1
        self.node[i] = x
        while i > 0:
            i = (i - 1) // 2
            self.node[i] = segfunc(self.node[i * 2 + 1], self.node[i * 2 + 2])

    def update(self, x, val):
        x += (self.n - 1)
        self.node[x] = val
        while x > 0:
            x = (x - 1) // 2
            self.node[x] = segfunc(self.node[2 * x + 1], self.node[2 * x + 2])

    def query(self, a, b):
        res = 0
        l = self.n - 1 + a
        r = self.n - 1 + (b - 1)

        while l <= r:
            if l == r:
                res = segfunc(res, self.node[l])
                break

            if l % 2 == 0:
                res = segfunc(res, self.node[l])
            if r % 2 == 1:
                res = segfunc(res, self.node[r])
            l = l // 2
            r = r // 2 - 1

        return res

N, K = map(int, input().split())
INF = 0
seg = SegmentTree([0] * 300005)
for i in range(N):
    a = int(input())
    tmp = seg.query(max(a - K, 0), min(a + K, 300000) + 1) + 1
    seg.update(a, tmp)
print(seg.query(0, 300005))
x=1
while True:
    i=input()
    print('case {}: {}'.format(x,i))
    x+=1
    if i==0:
        break


### FIXED CODE ###

import sys
 
i=1
for s in sys.stdin:
  n = int(s)
  if n == 0:
    break
  print("Case ",i,": ",n,sep="")
  i += 1
a, b, c = map(int, input().split())

if c-a-b>=0:
    if 4*a*b<(c-a-b)**2:
        print('Yes')
    else:
        print('No')
else:
    print('No')

### FIXED CODE ###

lst = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())

print(lst[K-1])
K, S = map(int,input().split())
from itertools import product
ans = 0
for x,y,z in product(range(K+1),3):
  if x + y + z == S:ans += 1
print(ans)

### FIXED CODE ###

from itertools import  product
K, S = map(int, input().split())
ans = 0
for x,y in product(range(K+1),repeat=2):
    z = S - x - y
    if 0 <= z <= K and x + y + z == S:
        ans += 1
print(ans)
N = int(input())
L_2 = 2
L_1 = 1
for i in range(N-1):
  K = L_1+L_2
  L_2 = L_1
  L_1 = K
print(K)


### FIXED CODE ###

L = [2,1]
for i in range(100):
  L.append(L[i+1]+L[i])
n = int(input())
print(L[n])
n=int(input())
l = list(map(int, input().split())
i= [k for k in l if l[k]%2==0 or l[k]%5==0]        
j = [k for k in i if i[k]%3==0 or i[k]%5==0]   
if len[i]==len[j]:
         print("APPROVED")
else:
         print("DENIED")

### FIXED CODE ###

n=int(input())
l = list(map(int, input().split()))
count=0
kount=0
for i in range(n):
    if l[i]%2==0:
        count+=1
        if l[i]%3==0:
            kount+=1 
        elif l[i]%5==0: 
          kount+=1
if count==kount:
         print("APPROVED")
else:
         print("DENIED")
N = int(input())
a_lis = list(map(int, input().split()))

maximum = max(a_lis)
minimum = min(a_lis)


new_mx = maximum - N + 1
count = [0] * (max(new_mx, minimum) + 1 - min(new_mx, minimum))
for num in range(min(new_mx, minimum), max(new_mx, minimum) + 1):
    tmp = 0
    for i in range(N):
        tmp += abs(a_lis[i] - num - i)
    count[num - min(new_mx, minimum)] = tmp
print(min(count))

### FIXED CODE ###

from collections import Counter
from statistics import median
N = int(input())
a_lis = list(map(int, input().split()))

new_lis = [item - i - 1 for i, item in enumerate(a_lis)]

mode = median(new_lis)

count = 0
for i in range(N):
    count += abs(a_lis[i] - mode - i - 1)
    
print(int(count))
h,n=map(int,input().split())
a=list(map(int,input().spliy()))
sum=0
for i in a:
  sum=sum+i
  
if sum >=h:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

h,n=map(int,input().split())
a=list(map(int,input().split()))
sum=0
for i in a:
  sum=sum+i
  
if sum >=h:
  print('Yes')
else:
  print('No')
#AGC018-A
if False:
    import fractions

    N,K=map(int,input().split())
    A=[int(i) for i in input().split()]
    MAX=max(A)
    GCD=A[0]
    for a in A:
        GCD=fractions.gcd(a,GCD)
    if K%GCD==0 and K<=MAX:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

#ABC134-D
if True:
    M=int(input())
    B=[int(i) for i in input().split()]
    fact=[[1] for i in range(M)]
    for i in range(2,M+1):
        k=2
        while k*i<=M:
            fact[k*i-1].append(i)
            k+=1
    # print(fact)
    ANS=[]
    PAL=[0 for i in range(M)]
    for i in reversed(range(M)):
        if 2*(i+1)>M:
            PAL[i]+=B[i]
            if B[i]==1:
                ANS.append(i+1)
        else:
            if PAL[i]!=B[i]:
                PAL[i]=(PAL[i]+1)%2
                ANS.append(i+1)
        for j in fact[i]:
                PAL[j]=(PAL[j]+PAL[i])%2
            
            
    print(len(ANS))
    print(' '.join(map(str,ANS)))

        



### FIXED CODE ###

#ABC134-D
if True:
    N=int(input())
    A=[int(i) for i in input().split()]
    fact=[[1] for i in range(N)]
    for i in range(2,N+1):
        k=2
        while k*i<=N:
            fact[k*i-1].append(i)
            k+=1
    # print(fact)
    SUM=[0 for i in range(N)]
    ANS=[]
    for i in reversed(range(N)):
        if (i+1)*2>N:
            if A[i]==1:
                ANS.append(i+1)
                SUM[i]=A[i]
            for j in fact[i]:
                SUM[j-1]=(SUM[j-1]+A[i])%2
        else:
            if SUM[i]==1:
                if A[i]==1:
                    continue
                else:
                    ANS.append(i+1)
                    SUM[i]=1
                    for j in fact[i]:
                        SUM[j-1]=(SUM[j-1]+1)%2
            else:
                if A[i]==0:
                    continue
                else:
                    ANS.append(i+1)
                    SUM[i]=1
                    for j in fact[i]:
                        SUM[j-1]=(SUM[j-1]+1)%2
    print(len(ANS))
    print(' '.join(map(str,ANS)))
#include <stdio.h>

int main(void) {
	int i,d,S;
	while (scanf("%d",&d)!=EOF){
		S=0;
		for (i=0;i<600;i+=d){
			S+=d*pow(i,2);
		}
		printf("%d\n",S);
	}
	return 0;
}

### FIXED CODE ###

while True:
    try:
        wid = int(raw_input())
        r = 600 // wid
        integral = 0
        for i in range(1,r):
            integral += wid*(wid*i)**2
        print integral
    except:
        break
if S=='Sunny':
	print('Cloudy')
elif S=='Cloudy':
	print('Rainy')
else:
	print('Sunny')

### FIXED CODE ###

S=input()
if S=='Sunny':
	print('Cloudy')
elif S=='Cloudy':
	print('Rainy')
else:
	print('Sunny')
A,B,K = map(int,input().split())

if A>K:
    i =A-K 
elif (A+B) > K:
    i =0
    j =(A+B)-K 
else:
    i =0
    j =0
print('{} {}'.format(i,j))


### FIXED CODE ###

A,B,K = map(int,input().split())

if A>=K:
    i =A-K 
    j =B
elif (A+B) >= K:
    i =0
    j =(A+B)-K 
else:
    i =0
    j =0
print('{} {}'.format(i,j))
import numpy as np
s = input()
n = len(s)
child = np.ones(n)
x = np.zeros((n,n))
for i in range(n):
    if s[i] == 'R':
        x[i][i+1] = 1
    else:
        x[i][i-1] = 1
        

x = np.linalg.matrix_power(x,10**100)
print(*map(int,np.dot(child,x)))

### FIXED CODE ###


S = input()
n = len(S)
ans = [0 for i in range(n)]
for i in range(n):
    if S[i:i+2] == "RL":
        for j in range(i,-1,-1):
            if S[j] == "R":
                ans[i + (i-j) % 2] += 1
            else:
                break
        for j in range(i+1,n):
            if S[j] == "L":
                ans[i + (j-i) % 2] += 1
            else:
                break

print(*ans)
h,w = map(int,input().split())
s = [list("."+input()+".") for _ in range(w)]
s=["."*(w+2)]+s+["."*(w+2)]
flg = 0
for i in range(h):
  for j in range(w):
    if s[i][j] == "#":
      if s[i-1][j]=="#" or s[i+1][j]=="#" or s[i][j-1]=="#" or s[i][j+1]=="#":
        flg = 0
      else:
        flg = 1
print("Yes" if flg == 0 else "No")
    

### FIXED CODE ###

h,w = map(int,input().split())
s = [list("."+input()+".") for _ in range(h)]
s=["."*(w+2)]+s+["."*(w+2)]
flg = 0
for i in range(h):
  for j in range(w):
    if s[i][j] == "#":
      if s[i-1][j]=="." and s[i+1][j]=="." and s[i][j-1]=="." and s[i][j+1]==".":
        flg = 1
print("Yes" if flg == 0 else "No")
n,m=map(int,input().split())
for ai in range(m):
    ai=list(int(input()))
    k=sum(ai)
if k<=m:
    print(m-k)
else:
    print("-1")

### FIXED CODE ###

n,m=map(int,input().split())
ai=list(map(int,input().split()))
k=sum(ai)
if k<=n:
    print(n-k)
else:
    print("-1")