Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, M, Q = map(int, input().split())
tracks = [[] for i in range(N)]
for i in range(M):
    L, R = map(int, input().split())
    tracks[L-1].append(R-1)
    
for track in tracks: track.sort()

ans = [[None for j in range(N)] for i in range(N)]
for L in range(N):
    cur = 0
    tot = 0
    for R in range(L, N):
        while cur < len(tracks[L]) and tracks[L][cur] <= R:
            cur += 1
            tot += 1
        ans[L][R] = tot

for i in range(Q):
    p, q = map(int, input().split())
    print(sum(ans[i][q-1] for i in range(p-1, q)))


Fixed submission:
N, M, Q = map(int, input().split())
tracks = [[] for i in range(N)]
for i in range(M):
    L, R = map(int, input().split())
    tracks[L-1].append(R-1)
    
for track in tracks: track.sort()

ans = [[None for j in range(N)] for i in range(N)]
for L in range(N):
    cur = 0
    tot = 0
    for R in range(L, N):
        while cur < len(tracks[L]) and tracks[L][cur] <= R:
            cur += 1
            tot += 1
        ans[L][R] = tot

dp =[[None for i in range(N)] for j in range(N)]
for i in range(Q):
    p, q = map(int, input().split())
    if dp[p-1][q-1] == None:
        dp[p-1][q-1] = sum(ans[i][q-1] for i in range(p-1, q))
    print(dp[p-1][q-1])
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(a*b)

Fixed submission:
a=list(map(int,input().split()))
print(a[0]*a[1])
Buggy python submission (verdict: Runtime Error):
n=input()
k=set()
for i in range(n):
  o=input()
  k.append(o))
print(len(k))

Fixed submission:
n=int(input())
k=[]
for i in range(n):
  o=input()
  k.append(o)
print(len(set(k)))
Buggy python submission (verdict: Runtime Error):
def func(arr):
    crr=[0 for i in range(len(arr))]
    crr[0]=arr[0]
    crr[1]=arr[1]-arr[0]
    for i in range(2,len(arr)):
        crr[i]=min(abs((arr[i]-arr[i-1]))+crr[i-1],abs((arr[i]-arr[i-2]))+crr[i-2])
    print(crr)
    
b=input()
ar=list(map(int,input().split())
func(ar)

Fixed submission:
def func(arr):
    crr=[0 for i in range(len(arr))]
    crr[0]=0
    crr[1]=abs(arr[1]-arr[0])
    for i in range(2,len(arr)):
        crr[i]=min(abs((arr[i]-arr[i-1]))+crr[i-1],abs((arr[i]-arr[i-2]))+crr[i-2])
    print(crr[-1])

b=input()
cr=list(map(int,input().split()))
func(cr)
Buggy python submission (verdict: Runtime Error):
print({
  '000': 0,
  '001': 1,
  '010': 1,
  '011': 2,
  '100': 1,
  '101': 2,
  '110': 2,
  '111' 3
}[input()])

Fixed submission:
print((lambda s: int(s[0])+int(s[1])+int(s[2]))(input()))
Buggy python submission (verdict: Runtime Error):
print((lambda s:[s for s in reversed(range(len(s))) if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]][0])(input()))

Fixed submission:
print((lambda s: [len(t) for t in [s[:i] for i in reversed(range(len(s)))] if (len(t)%2==0 and t[:len(t)//2]==t[len(t)//2:])])(input())[0])
Buggy python submission (verdict: Time Limit Exceeded):
import os
import sys
from io import BytesIO

sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))

n, k = map(int, sys.stdin.readline().split())
a = map(int, sys.stdin.readline().split())
f = map(int, sys.stdin.readline().split())
a.sort()
f.sort(reverse=True)

'''
n, k = 100000, 0
a = range(n)
f = range(n)
a.sort()
f.sort(reverse=True)

print n, k

for i in range(n):
	print 1,
print

for i in range(n):
	print 1,
print
'''


def val(p):
	r = 0
	for i in range(n):
		t = 0 if a[i] * f[i] <= p else a[i] - p // f[i]
		r += t
	return r
		
def bin(l, r):
	if l == r:
		return l
	if l + 1 == r:
		if val(l) <= k:
			return l
		else:
			return r
	t = (l + r) // 2
	if val(t) <= k:
		return bin(l, t)
	else:
		return bin(t, r)
		
R = bin(0, 1000000000000)
print(R)

Fixed submission:
import os
import sys
from io import BytesIO

sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))

n, k = map(int, sys.stdin.readline().split())
a = map(int, sys.stdin.readline().split())
f = map(int, sys.stdin.readline().split())
a.sort()
f.sort(reverse=True)

'''
n, k = 100000, 0
a = range(n)
f = range(n)
a.sort()
f.sort(reverse=True)

print n, k

for i in range(n):
	print 1,
print

for i in range(n):
	print 1,
print
'''


def val(p):
	r = 0
	for i in range(n):
		t = 0 if a[i] * f[i] <= p else a[i] - p // f[i]
		r += t
	return r
		
def bin(l, r):
	if l == r:
		return l
	if l + 1 == r:
		if val(l) <= k:
			return l
		else:
			return r
	t = (l + r) // 2
	if val(t) <= k:
		return bin(l, t)
	else:
		return bin(t, r)
		
R = bin(0, 1000000000000)
print(R)
Buggy python submission (verdict: Runtime Error):
S=input()
N=Len(S)
ans=0
for i in range(N):
  if S[i]!=S[N-1-i]:
    S[i] =S[N-1-i]
    ans+=1
print(ans)

Fixed submission:
S=input()
N=len(S)
ans=0
for i in range(N):
  if S[i]!=S[N-1-i]:
    ans+=1
print(ans//2)
Buggy python submission (verdict: Runtime Error):
m = 55555

p = [False] * m
for i in range(3, m):
  if not p[i]:
    continue
  for j in range(2, m):
    if j * i >= len(p):
      break
    p[i*j] = False
    
n = int(input())

ans = []
for i in range(m):
  if len(ans)==n:
    break
  t = i*5+7
  if not p[t]:
    continue
  ans.append(t)
print(" ".join(ans))
    
          






Fixed submission:
m = 55555

p = [True] * m
for i in range(3, m):
    if not p[i]:
        continue
    for j in range(2, m):
        if j * i >= len(p):
            break
        p[i*j] = False

n = int(input())
if n <= 5:
    t = [2, 3, 5, 7, 11]
    print(" ".join([str(a) for a in t[:n]]))
else:
    ans = []
    for i in range(m):
        if len(ans) == n:
            break
        t = i*5+7
        if not p[t]:
            continue
        ans.append(t)
    print(" ".join([str(a) for a in ans]))
Buggy python submission (verdict: Runtime Error):
    a = int(input())
    s = input()
    if(a>=3200):
      print(s)
    else:
      print("red")

Fixed submission:
a = int(input())
s = input()
if(a>=3200):
	print(s)
else:
	print("red")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
m = n//2

a.sort()
minus = a[0:n//2]
plus = []
i = n//2
while a[i] < 0 and i < n:
    minus.append(a[i])
    i += 1
for j in range(i, n):
    plus.append(a[j])
print(sum(plus)-sum(minus))
for i in range(n-1):
    mi = minus.pop(0)
    pl = plus.pop(0)
    if len(minus) >= len(plus):
        print(str(pl) +' '+str(mi))
        plus.append(pl-mi)
    else:
        minus.append(mi-pl)
        print(str(mi) +' '+str(pl))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
m = n//2

a.sort()
if a[0] >= 0:
    minus = [a[0]]
    plus = a[1:n]
elif a[n-1] <= 0:
    minus = a[0:n-1]
    plus = [a[n-1]]
else:
    for i in range(n):
        if a[i] > 0:
            point = i
            break
    minus = a[0:point]
    plus = a[point:n]
print(sum(plus)-sum(minus))
for i in range(n-1):
    mi = minus.pop(0)
    pl = plus.pop(0)
    if len(minus) >= len(plus):
        print(str(pl) +' '+str(mi))
        plus.append(pl-mi)
    else:
        minus.append(mi-pl)
        print(str(mi) +' '+str(pl))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

h, w = map(int, input().split())
s = []
for i in range(h):
    line = list(input())
    s.append(line)
table = np.ones([h,w])
for i in range(h):
 
    tuzuki = False
    count = 0
    for j in range(w):
        if s[i][j] == '.':
 
            if tuzuki:
                count += 1
            else:
                start = j
                count = 1
                tuzuki = True
            if j == w-1:
              table[i][start:w] = count

        else:
            if tuzuki:
                tuzuki = False
                table[i][start:j] = count
for j in range(w):
    tuzuki = False
    count = 0
    for i in range(h):
        if s[i][j] == '.':
            if tuzuki:
                count += 1
            else:
                start = i
                count = 1
                tuzuki = True
            if i == h-1:
              table[start:h, j] += count - 1
        else:
            if tuzuki:
              table[start:i, j] += count - 1
              tuzuki = False
print(int(table.max()))

Fixed submission:
import numpy as np
h, w = map(int, input().split())
table = np.array([list(input())for _ in range(h)]) == '.'

d = np.zeros((h, w), dtype = int)
u = np.zeros((h, w), dtype = int)
r = np.zeros((h, w), dtype = int)
l = np.zeros((h, w), dtype = int)

for i in range(h):
    d[i] = (d[i-1]+1) * table[i]
    u[-i-1] = (u[-i]+1) * table[-i-1]
for i in range(w):
    r[:, i] = (r[:, i-1]+1) * table[:, i]
    l[:, -i-1] = (l[:, -i]+1) * table[:, -i-1]
print(np.max(d+u+r+l)-3)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S_P = []
for i in range(N):
    S , P = input().split()
    S_P.append([ S , int(P) , i])
S_P.sort( key = lambda x : x[0] )
state = S_P[0][0]
S_P_sort = []
temp = []
for S , P , i in S_P:
    if S != state:
        temp.sort( key = lambda x : x[1])
        S_P_sort.extend(temp)
        S_P_sort.append([S , P, i])
        state = S
        temp = []
    else:
        temp.append([S , P, i])
for j in range(N):
    print(S_P_sort[j][2]+1)

Fixed submission:
N = int(input())
S_P = []
for i in range(N):
    S , P = input().split()
    S_P.append([ S , int(P) , i])
S_P.sort( key = lambda x : x[0] )
state = S_P[0][0]
S_P_sort = []
temp = []
for S , P , i in S_P:
    if S != state:
        temp.sort( key = lambda x : x[1] , reverse = True)
        S_P_sort.extend(temp)
        state = S
        temp = []
        temp.append([S , P, i])
    else:
        temp.append([S , P, i])
temp.sort( key = lambda x : x[1] , reverse = True)
S_P_sort.extend(temp)
for j in range(N):
    print(S_P_sort[j][2]+1)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = sorted(list(map(int, input().split())))
for i in range(m):
    b, c = map(int, input().split())
    for j in range(b):
        A[j] = max(A[j], c)
    A = sorted(A)
print(sum(A))

Fixed submission:
a, b = map(int, input().split())
if a <= 5:
    print(0)
elif 6 <= a <= 12:
    print(int(b / 2))
else:
    print(b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
#m = int(input())
k = int(input())
#n, m = map(int, input().split())
#n, m, k = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
print(n-k+1)

Fixed submission:
#n = int(input())
#m = int(input())
#k = int(input())
#n, m = map(int, input().split())
n,  k = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
print(n-k+1)
Buggy python submission (verdict: Runtime Error):
#n = int(input())
#m = int(input())
#k = int(input())
#n, m = map(int, input().split())
r, g, b, n = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
count = 0
for i in range(n//r+1):
    for j in range((n-r*i)//g+1)
        if (n-r*i-g*j)%b == 0:
            count +=1
print(count)

Fixed submission:
#n = int(input())
#m = int(input())
#k = int(input())
#n, m = map(int, input().split())
r, g, b, n = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
count = 0
for i in range(n//r+1):
    for j in range((n-r*i)//g+1):
        if (n-r*i-g*j)%b == 0:
            count +=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
#n = int(input())
#m = int(input())
#k = int(input())
#n, m = map(int, input().split())
r, g, b, n = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
count = 0
for i in range(n//r+1):
    for j in range((n-r*i)//g+1):
        for k in range((n-r*i-g*j)//b+1):
            if r*i+g*j+b*k==n:
                count +=1
print(count)

Fixed submission:
#n = int(input())
#m = int(input())
#k = int(input())
#n, m = map(int, input().split())
r, g, b, n = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
count = 0
for i in range(n//r+1):
    for j in range((n-r*i)//g+1):
        if (n-r*i-g*j)%b == 0:
            count +=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
#n = int(input())
#m = int(input())
#k = int(input())
#n, m = map(int, input().split())
r, g, b, n = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
count = 0
for i in range(n//r+1):
    for j in range(n//g+1):
        for k in range(n//b+1):
            if r*i+g*j+b*k==n:
                count +=1
print(count)

Fixed submission:
#n = int(input())
#m = int(input())
#k = int(input())
#n, m = map(int, input().split())
r, g, b, n = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
count = 0
for i in range(n//r+1):
    for j in range((n-r*i)//g+1):
        if (n-r*i-g*j)%b == 0:
            count +=1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
mina = 10**9
minus = 0
sumA = 0
for a in A:
    if a < 0:
        minus += 1
        a = -a
    sumA += a
    mina = min(a, mina)
if minus % 2 == 1:
    sumA -= 2 * mina
print(sumA)

Fixed submission:
a, b, t = map( int, input().split() )
print(b*(t//a))

Buggy python submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))
forward = [0, a[0]]
back =[0, a[n-1]]
for i in range(1,n-1):
    forward.append(fractions.gcd(forward[i], a[i]))
    back.append(fractions.gcd(back[i], a[n-i-1]))

back.reverse()

ans = max(forward[n-2], back[0])
for i in range(n-2):
    ans = max(ans, fractions.gcd(forward[i], back[i]))
print(ans)


Fixed submission:
a, b, t = map( int, input().split() )
print(b*(t//a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
forward = [0]
back =[0]
for i in range(0,n-1):
    forward.append(fractions.gcd(forward[i], a[i]))
    back.append(fractions.gcd(back[i], a[n-i-1]))

back.reverse()

ans = 0
for i in range(n):
    ans = max(ans, fractions.gcd(forward[i], back[i]))
print(ans)

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))
forward = [0]
back =[0]
for i in range(0,n-1):
    forward.append(fractions.gcd(forward[i], a[i]))
    back.append(fractions.gcd(back[i], a[n-i-1]))
ans = 0
for i in range(n):
    ans = max(ans, fractions.gcd(forward[i], back[n-1-i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))

import fractions
def gcd(list):
    gcd = list[0]
    for a in list:
        gcd = fractions.gcd(gcd, a)
    return gcd

max_gcd = 0
for i in range(n):
    Ai = A.pop(i)
    max_gcd = max(max_gcd, gcd(A))
    A.insert(i, Ai)

print(max_gcd)

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))
forward = [0]
back =[0]
for i in range(0,n-1):
    forward.append(fractions.gcd(forward[i], a[i]))
    back.append(fractions.gcd(back[i], a[n-i-1]))
ans = 0
for i in range(n):
    ans = max(ans, fractions.gcd(forward[i], back[n-1-i]))
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))

import math
def gcd(list):
    gcd = list[0]
    for a in list:
        gcd = math.gcd(gcd, a)
    return gcd

max_gcd = 0
for i in range(n):
    Ai = A.pop(i)
    max_gcd = max(max_gcd, gcd(A))
    A.insert(i, Ai)

print(max_gcd)

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))
forward = [0]
back =[0]
for i in range(0,n-1):
    forward.append(fractions.gcd(forward[i], a[i]))
    back.append(fractions.gcd(back[i], a[n-i-1]))
ans = 0
for i in range(n):
    ans = max(ans, fractions.gcd(forward[i], back[n-1-i]))
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
mina = 10*10
minus = False
sumA = 0
for a in A:
    if a < 0:
        if minus:
            minus = False
        else:
            minus = True
    	a = -a
    sumA += a
    mina = min(a, mina)


if minus:
    sumA -= 2*mina
print(sumA)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
mina = abs(A[0])
minus = 0
sumA = 0
for a in A:
    if a < 0:
        minus += 1
        a = -a
    sumA += a
    mina = min(a, mina)
if minus % 2 == 1:
    sumA -= 2 * mina
print(sumA)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
mina = 10*10
minus = False
sumA = 0
for a in A:
    if a < 0:
        if minus:
            minus = False
        else:
            minus = True
    	a = -a
    sumA += a
    mina = min(a, mina)


if minus:
    sumA -= 2*mina
print(sumA)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
mina = abs(A[0])
minus = 0
sumA = 0
for a in A:
    if a < 0:
        minus += 1
        a = -a
    sumA += a
    mina = min(a, mina)
if minus % 2 == 1:
    sumA -= 2 * mina
print(sumA)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
c = input()
d = input()
e = input()
k = int(input())
if e - a <= k:
    print("Yey!")
else:
    print(":(")

Fixed submission:
a = int(input())
b = input()
c = input()
d = input()
e = int(input())
k = int(input())
if e - a <= k:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
c = input()
d = input()
e = input()
k = input()
if e - a <= k:
    print("Yey!")
else:
    print(":(")

Fixed submission:
a = int(input())
b = input()
c = input()
d = input()
e = int(input())
k = int(input())
if e - a <= k:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
s = input()
l = len(s)
a = [0]*l
for i in range(l):
    if s[i] == "A" or s[i] =="T" or s[i] =="C" or s[i] =="G":
        a[i] = 1
m = 0
if a[0] = 1:
  m = 1
for i in range(1,l):
    a[i] = (a[i-1]+1)*a[i]
    if m < a[i]:
        m = a[i]

print(m)

Fixed submission:
s = input()
l = len(s)
a = [0]*l
for i in range(l):
    if s[i] == "A" or s[i] =="T" or s[i] =="C" or s[i] =="G":
        a[i] = 1
m = 0
if a[0] == 1:
  m = 1
for i in range(1,l):
    a[i] = (a[i-1]+1)*a[i]
    if m < a[i]:
        m = a[i]

print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = [int(x) for x in input().split()]
flag = 0
for i in range(len(x)):
    for j in range(len(x)):
        if i != j:
            if x[i] == x[j]:
                print("NO")
                flag = 1
                break
    if flag == 1:
        break
else:
    print("YES")

Fixed submission:
n = int(input())
x = [int(x) for x in input().split()]

s = set(x)

if len(s) != len(x):
    print("NO")
else:
    print("YES")
Buggy python submission (verdict: Runtime Error):
x, y = input().split()
if x!=1 and y!=1:
  print(1)
if x!=2 and y!=2:
  print(2)
if x!=3 and y!=3:
  print(3)

Fixed submission:
x = int(input())
y = int(input())
if x==1 and y==2:
    print(3)
elif x==1 and y==3:
    print(2)
elif x==2 and y==3:
    print(1)
elif x==2 and y==1:
    print(3)
elif x==3 and y==1:
    print(2)
elif x==3 and y==2:
    print(1)
Buggy python submission (verdict: Runtime Error):
print(1 - input())

Fixed submission:
print(1 - (int(input())))
Buggy python submission (verdict: Runtime Error):
a = input()
print(a + a*a + a*a*a)

Fixed submission:
a = int(input())
print(a+a*a+a*a*a)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
ans = 0
for i in xrange(len(s)):
  if s[i] != t[i]:
    ans += 1
print(ans)

Fixed submission:
s = input()
t = input()
ans = 0
for i in range(len(s)):
  if s[i] != t[i]:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
def solve():
	a, b, c = map(int, raw_input().strip().split())
    d = c - a - b
    if d <= 0: return False
    return 4 * a * b < d * d

print 'Yes' if solve() else 'No'


Fixed submission:
def solve():
  a, b, c = map(int, raw_input().strip().split())
  d = c - a - b
  if d <= 0: return False
  return 4 * a * b < d * d

print 'Yes' if solve() else 'No'
Buggy python submission (verdict: Runtime Error):
k,x = map(int, raw_input.strip().split())
print 'Yes' if k*500>=x else 'No'

Fixed submission:
k,x = map(int, raw_input().strip().split())
print 'Yes' if k*500>=x else 'No'
Buggy python submission (verdict: Runtime Error):
s = raw_input()
t = raw_input()
ans = 0
for i in len(s):
  if s[i] == t[i]: ans += 1
print ans

Fixed submission:
s = raw_input()
t = raw_input()
ans = 0
for i in xrange(len(s)):
  if s[i] == t[i]: ans += 1
print ans
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
a = [input() for _ in xrange(n)]
ans = max(a)
for i in xrange(n):
  if a[i] != ans:
    print ans
  else:
    print max(a[:i] + a[i + 1:])

Fixed submission:
n = input()
a = [input() for _ in xrange(n)]
ans = max(a)
i = a.index(ans)
ans2 = max(a[:i] + a[i + 1:])
for i in xrange(n):
  if a[i] != ans:
    print ans
  else:
    print ans2
Buggy python submission (verdict: Runtime Error):
n = input()
a = map(int, raw_input().split())
b = [0 for _ in range(n)]
used = []

for i in xrange(n, 0, -1):
  sum = 0
  for j in xrange(2 * i, n + 1, i):
    sum += b[j]
  if sum % 2 != a[i]:
    used.append(i)
    b[i] = 1
print len(used)
for x in used: print x,
print

Fixed submission:
n = input()
a = [0] + map(int, raw_input().split())
b = [0 for _ in range(n + 1)]
used = []

for i in xrange(n, 0, -1):
  sum = 0
  for j in xrange(2 * i, n + 1, i):
    sum += b[j]
  if sum % 2 != a[i]:
    used.append(i)
    b[i] = 1
print len(used)
for x in used: print x,
print
Buggy python submission (verdict: Runtime Error):
n,m=int(input())
if(n==m) print('Yes')
else print('No')

Fixed submission:
n,m=map(int,input().split())
if(n==m):
  print('Yes')
else:
  print('No')