peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import itertools
N = int(input())
L = [int(_) for _ in input().split()]
ans = 0
for i, j, k in itertools.combinations(range(N), 3):
    a, b, c = sorted([L[i], L[j], L[k]])
    if a + b > c and a != b and b != c:
        ans += 1
print(ans)
# Judge status: Accepted
X = int(input())
flag = 0

for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == X:
            print(a, b)
            flag = 1
            break
    if flag == 1:
        break
# Judge status: Accepted
import sys
from collections import deque
input = sys.stdin.readline


def main():
    X = input().rstrip()

    stack = deque()
    for s in X:
        if s == "S":
            stack.append(s)
        else:
            if len(stack) == 0 or stack[-1] == "T":
                stack.append(s)
            else:
                stack.pop()
    ans = len(stack)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 0
switch = 0
for i in range(n):
    if switch == 0:
         if a[i] == i+1:
                ans += 1
                switch = 1
    else:
        switch = 0
print(ans)
# Judge status: Accepted
import sys

L, R = map(int, input().split())
P = 2019
if R - L >= 2019:
    print(0)
    sys.exit()
elif (R % P) - (L % P) < 0:
    print(0)
    sys.exit()

R %= P
L %= P
ans = 2019
for i in range(L, R):
    for j in range(i + 1, R + 1):
        ans = min(ans, (i * j) % P)
print(ans)
# Judge status: Wrong Answer
N=int(input())
A=int(input())
mod=N%500
if mod>A:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())


for _ in range(N):
    B = int(input())
    for i in range(3):
      for j in range(3):
          if A[i][j] == B:
              A[i][j] = 0
        
bingo = False
for row in A:
  if sum(row) == 0:
    bingo = True
for col in zip(*A):
  if sum(col) == 0:
    bingo = True
if sum(A[i][i] for i in range(3)) == 0:
  bingo =True
if sum(A[i][3 - i - 1] for i in range(3)) == 0:
  bingo = True
  
print("Yes" if bingo == True else "No")
# Judge status: Accepted
n,m = map(int,input().split())
a = list(map(int,input().split()))
import heapq
heapq.heapify(a)
BC=[list(map(int,input().split())) for _ in range(m)]
BC.sort(reverse=True,key=lambda x:x[1])
for i in range(m):
    while BC[i][0]>0:
        if BC[i][1] > a[0]:
            minA = heapq.heappop(a)
            heapq.heappush(a,BC[i][1])
            BC[i][0] -=1
        else:
            break
print(sum(a))
# Judge status: Accepted
X = int(input())

if X == 7 or X == 5 or X == 3:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
def resolve():
    s_x, s_y, t_x, t_y = map(int, input().split())

    d_x = t_x - s_x
    d_y = t_y - s_y
    p_1 = 'U'*d_y + 'R'*d_x
    p_2 = 'D'*d_y + 'L'*d_x
    p_3 = 'L' + 'U' * (d_y+1) + 'R' * (d_x+1) + 'D'
    p_4 = 'R' + 'D' * (d_y+1) + 'L' * (d_x + 1) + 'U'

    print(p_1+p_2+p_3+p_4)

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
s = list(input())
if s[0] == "A" and "C" in s[2:-1]:
    s.remove("A")
    s.remove("C")
    for i in s:
        if i.isupper():
            print("WA")
            exit()
    print("AC")
else:
    print("WA")
# Judge status: Wrong Answer
N, M = map(int, input().split())

if N == 1 and M == 1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
if n % 2 == 1:
  print(0)
  exit()
ans = 0
ex = 1
while True:
  expo = 2 * 5**ex
  if n // expo == 0:
    break
  ans += n // expo
  ex += 1
print(ans)
# Judge status: Wrong Answer
import math
N=int(input())
A=list(map(int,input().split()))
ans = []
AV=math.ceil(sum(A)/N)
for i in A:
    ans.append((i-AV)**2)
print(sum(ans))
# Judge status: Accepted
a,b=map(int,input().split())
 
print(a) if a<=b else print(a-1)
# Judge status: Wrong Answer
import math
n = int(input())
x1 = math.ceil(n/1.08)
x2 = math.floor((n+1)/1.08)
print(':(' if x2<x1 else x1)
# Judge status: Accepted
s = list(input())
t = input()

for i in range(len(s) - len(t), -1, -1):
    for j in range(len(t)):
        if s[i+j] != t[j] and s[i+j] != '?':
            break
    else:
        for j in range(len(t)):
            s[i+j] = t[j]
        for j in range(len(s)):
            if s[j] == '?':
                s[j] = 'a'
        print(''.join(s))
        exit()

print('UNRESTORABLE')
# Judge status: Accepted
n=int(input())
if n>=1000:
  print('ABD')
else:
  print('ABC')
# Judge status: Wrong Answer
a, b, c = map(int,input().split())
print('c'+' a'+' b')
# Judge status: Accepted
def main():
    S = input()

    ans = 0
    tmp = ''
    pre = ''
    for s in S:
        tmp += s
        if tmp != pre:
            pre = tmp
            tmp = ''
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
d = int(input())

D   = "Christmas"
D_1 = "Chrismas Eve"
D_2 = "Christmas Eve Eve"
D_3 = "Christmas Eve Eve Eve"

if d == 25:
  print(D)
elif d == 24:
  print(D_1)
elif d == 23:
  print(D_2)
else:
  print(D_3)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range(n):
    if a[i]>b[i]:
        ans+=b[i]
    else:
        ans+=a[i]
        if  a[i+1]>(b[i]-a[i]):
            ans+=b[i]-a[i]
            a[i+1]-=(b[i]-a[i])
        else:
            ans+=a[i+1]
            a[i+1]=0
print(ans)
# Judge status: Accepted
W,A,B = map(int,input().split())
print(max(abs(A-B)-W,0))
# Judge status: Accepted
*a,=map(int,input().split())
b=[bin(a[i+1]-a[i])[::-1].find('1')for i in (0,1)]
print((max(b) if b[0]*b[1]<0 else min(b))*(1-sum(a)%2))
# Judge status: Wrong Answer
n = input().split()
a = int(n[0])
b = int(n[1])
c = int(n[2])
if (a + b) == c:
  print('Yes')
elif (a + b) == c:
  print('Yes')
elif (a + c) == b:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
S = input()
S_int = map(int, S)

if len(S) == 1:
    print(0)
else:
    s = list(S_int)
    def reverse_count(s, initial):
        count = 0
        c = initial
        for i in range(len(s) - 1):
            if s[i] != c:
                count += 1
            c = (c + 1) % 2
        return count
        
    ### 0スタートと1スタートの場合両方で少ない方を出力
    print(min(reverse_count(s, 0), reverse_count(s, 1)))
# Judge status: Wrong Answer
A,B,C=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
if A==max(A,B,C):
    print(A*10+B+C)
elif B==max(A,B,C):
    print(B*10+A+C)
if C==max(A,B,C):
    print(C*10+B+A)
# Judge status: Accepted
import sys
input = sys.stdin.readline
mod = 2019
s = input().rstrip()
n = len(s)
mod_list = [0]
for i in range(n - 1, -1, -1):
    mod_list.append((mod_list[-1] + int(s[i]) * pow(10, n - 1 - i, mod)) % mod)
from collections import Counter
c = Counter(mod_list)
ans = 0
for i in c.keys():
    ans += c[i] * (c[i] - 1) // 2
print(ans)
# Judge status: Accepted
print('Yes' if int(input()) >= 30 else 'No')
# Judge status: Wrong Answer
s = list(map(int,input().split()))
s.sort
set(s)
print(sum(s[:2]))
# Judge status: Wrong Answer
n,m = list(map(int,input().split()))
ka = [list(map(int,input().split())) for _ in range(n)]
for i in ka:
    del(i[0])
flag_1 = False
count = 0
for i in range(1,m):
    for j in ka:
        if j.count(i) >= 1:
            flag_1 = True
        else:
            flag_1 = False
            break
    if flag_1:
        count += 1
print(count)
# Judge status: Accepted
from functools import reduce
n = int(input())
def r(n, m, l):
    if n == 1:
        return [m * 10 + l[0]]
    return reduce(lambda a, b: a + b, [r(n-1, m * 10 + l[i], l[:i] + l[i + 1:]) for i in range(0, n)])
d = r(n, 0, list(range(1, n+1)))
p = int(reduce(lambda a, b: a + b, input().split()))
q = int(reduce(lambda a, b: a + b, input().split()))
print(abs(d.index(q) - d.index(p)))
# Judge status: Accepted
N = input()[::-1]
l = len(N)

n0 = int(N[0])
dp = [[0, 0] for i in range(l)]
dp[0] = [n0, 11-n0]

for i, n in enumerate(N[1:], 1):
  n = int(n)
  dp[i][0] = min(dp[i-1][0]+n, dp[i-1][1]+n)
  dp[i][1] = min(dp[i-1][0]+1+(10-n), dp[i-1][1]+(9-n))


print(min(dp[-1]))
# Judge status: Accepted
N = input()

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

def lcm(x, y):
    return (x * y) // gcd(x, y)
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)

l = 1
for i in A:
    l = lcm(l, i)

ans = 0
for i in A:
    ans += l // i

print(ans%1000000007)
# Judge status: Accepted
N = input().replace("\n", "")
L = len(N)
dp = [[0 for _ in range(2)] for i in range(L+1)]
dp[0][1] = 1
for i in range(L):
    n = int(N[i])
    dp[i+1][0] = min(dp[i][0]+n, dp[i][1]+(10-n))
    dp[i+1][1] = min(dp[i][0]+n+1, dp[i][1]+(9-n))
print(dp[L][0])
# Judge status: Wrong Answer
A, B = map(int, input().split())
if A>=9 or B>=9:
  print(-1)
else:
  print(A*B)
# Judge status: Accepted
k, x = map(int, input().split())
print(' '.join(map(str, range(x-k+1, x+k))))
# Judge status: Accepted
a,b=map(int,input().split())
import math 
ans=0
for i in range(1,1001):
    aa=math.floor(i*0.08)
    bb=math.floor(i*0.1)
    if aa==a and bb==b:
        print(i)
        break
else:
    print(-1)
# Judge status: Wrong Answer
a, v = input().split(' ')
a = int(a)
v = int(v)
b, u = input().split(' ')
b = int(b)
u = int(u)
t = int(input())


if a + v * t >= b + u * t :
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
A, B = map(int, input().split())
for i in range(1000):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        exit()
print(-1)
# Judge status: Accepted
def main():
    N=int(input())

    if N%2!=0:
        print(0)
        exit()
    
    k=10
    ans=0
    while(k<=N):
        ans+=N//k
        k*=5
    print(ans)
    
if __name__=="__main__":
    main()
# Judge status: Accepted
h,n=map(int,input().split())
a=[0]*n
a=list(map(int,input().split()))

print("Yes" if (h<=sum(a)) else "No")
# Judge status: Wrong Answer
N = int(input())
l = sorted([int(x) for x in input().split()])
ans = 'YES'
for i in range(N-1):
  if l[0] == l[1]:
    ans = 'NO'
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
dic = {}
for i in range(1, N+1):
    dic[i] = 0
for i in A:
    dic[i] += 1
for ans in dic.values():
    print(ans)
# Judge status: Wrong Answer
def solve(a,k,dp):
	for i in range(2,n+1):		
		for j in range(i-1, max(0, i-k-1), -1):
			# print(i,j)
			dp[i] = min(dp[i], dp[j] + abs(a[i]-a[j]))
			# print(dp[j], i, j)
		# print(dp[i])
	


n,k = map(int, input().split())
a = list(map(int, input().split()))
a.insert(0,0)

dp = [99999 for i in range(n+2)]
dp[1] = 0
# dp[1] = abs(a[1]-a[0])

solve(a,k,dp)


# print(dp)
print(dp[n])
# Judge status: Accepted
w, h, n = map(int, input().split())
xya = [list(map(int, input().split())) for _ in range(n)]

w1 = 0
w2 = w
h1 = 0
h2 = h
for x, y, a in xya:
    if a == 1:
        w1= max(w1, x)
    if a == 2:
        w2 = min(w2, x)
    if a == 3:
        h1 = max(h1, y)
    if a == 4:
        h2 = min(h2, y)
        
print(max(0, (w2-w1))*max(0, (h2-h1)))
# Judge status: Accepted
N = int(input())
A=list(map(int,input().split()))
odd_num=0
bai_four=0
for i in range(N):
    if A[i]%2==1:
        odd_num=odd_num+1
    elif A[i]%4==0:
        bai_four=bai_four+1
if N%2==0:
    if odd_num <= bai_four:
        print('Yes')
    else:
        print('No')
else:
    if odd_num <= bai_four+1:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
n=int(input())
s=0
l=0
for i in range(n):
    b,c=map(int,input().split())
    if b==c:
        l+=1
    else:
        l=0
    if l>=3:
        s+=1

if s==0:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
H,W,target = map(int,input().split())
res = 'No'
for w in range(0,W+1):
    for h in range(0,H+1):
        num_black = w * h + (W-w)*(H-h)
        if num_black == target:
            res = 'Yes'
print(res)
# Judge status: Accepted
X, Y, A, B, C = map(int, input().strip().split())
p = list(map(int, input().strip().split()))
q = list(map(int, input().strip().split()))
r = list(map(int, input().strip().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

p=p[:X]
q=q[:Y]

lst=p+q+r
lst.sort(reverse=True)

ans=sum(lst[:X+Y])
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())

ans = 1
while K ** ans <= N:
    ans += 1

print(ans)
# Judge status: Accepted
inputted = list(map(int, input().split()))
N = inputted[0]
X = inputted[1]
L = list(map(int, input().split()))

x = 0
number_of_bounds = 0
for _i, Li in enumerate(L):
    number_of_bounds = _i + 1
    x += Li
    if x > X: break

if x <= X:
    number_of_bounds += 1

print(number_of_bounds)
# Judge status: Accepted
N = int(input())
a = ""
if N == 0:
    a = 0
while N != 0:
    if N % 2 != 0:
        N -= 1
        a = "1" + a
    else:
        a = "0" + a
    N = N // -2
print(a)
# Judge status: Wrong Answer
a, b, c = (int(i) for i in input().split('/'))
n = a*1e7 + b*1e3 + c*10
if n > 20190430:
  print('TBD')
else:
  print('Heisei')
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

def main():
    s=int(input())
    S=set()
    S.add(s)
    n=s
    for i in range(2,10**7):
        if n%2:
            n=3*n+1
        else:
            n=n//2
        if n in S:
            print(i)
            exit()
        S.add(n)
            

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
import heapq
stdin = sys.stdin

n,m = map(int, stdin.readline().split())

# 最大値を取得するために、マイナス各値にマイナスをかける。
an = [i*(-1) for i in map(int, stdin.readline().split())]
#print(an)

# リストのheap化
heapq.heapify(an)

# heapから最大値を取り出して、半分にしてヒープに戻すことをｍ回。
for _ in range(m):
    b = heapq.heappop(an)
    heapq.heappush(an, b//2 + 1)

ans = (-1)*sum(an)
print(ans)
# Judge status: Wrong Answer
#--Harmony

a, b = map(int, input().split())
N = a + b

if (N % 2 == 0):
  print(N/2)
else:
  print("IMPOSSIBLE")
# Judge status: Wrong Answer
def main():
    N = map(int, input().split())
    A = list(map(int, input().split()))[::-1]
    cont = 0
    ans_val = 0
    for i in range(len(A) - 1):
        if A[i] <= A[i+1]:
            cont += 1
            diff = A[i+1] - A[i]
            ans_val += diff * cont
        else:
            cont = 0
    return ans_val

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

n,m = map(int,input().split())

x = (n*(n-1))/2
y = (m*(m-1))/2

print(int(x+y))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().strip().split()))
c=0
for i in range(N):
	if (i+1)%2!=0 and A[i]%2!=0:
		c+=1
print(c)
# Judge status: Accepted
n, d = map(int, input().split())

total = 0

for i in range(n):
    x, y = map(int, input().split())
    if (x**2 + y**2)**0.5 <= d:
        total += 1
print(total)
# Judge status: Accepted
k=int(input())
result = []
def dfs(pos, val):
  result.append(val)

  if pos == 10:
    return
  
  for i in range(-1,2):
    add_num = (val % 10) + i
    if 0 <= add_num <= 9:
      dfs(pos+1, val*10+add_num)

for i in range(1,10):
  dfs(1,i)
result.sort()
print(result[k-1])
# Judge status: Wrong Answer
N, M = map(int, input().split())

A = [int(i) for i in range(M)]

B = sum(A)

if N <= B:
  print(N-B)

else:
  print('-1')
# Judge status: Accepted
a,b = map(int,input().split())


if (a*b)%2 == 0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

minus_cnt=0
zero_flag=False
mn = 10**10
sm = 0

for i in range(N):
    if a[i] == 0:
        zero_flag=True
    if a[i] < 0:
        minus_cnt+=1
    if mn > abs(a[i]):
        mn = abs(a[i])
    sm+=abs(a[i])

if zero_flag or minus_cnt%2==0:
    print(sm)
else:
    print(sm-2*mn)
# Judge status: Accepted
c11,c12,c13 = map(int, input().split())
c21,c22,c23 = map(int, input().split())
c31,c32,c33 = map(int, input().split())
if c21-c11==c22-c12==c23-c13 and c31-c21==c32-c22==c33-c23:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,k=map(int,input().split())
s = list(input())

s[k-1]=s[k-1].lower()

print(''.join(s))
# Judge status: Accepted
from itertools import combinations
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
ans = []
for i in b:
  for x in range(3):
    for y in range(3):
      if i == a[x][y]:
        ans.append(3*x+y)
if len(ans) <= 2:
  print("No")
  exit()
ans.sort()
for i,j,k in combinations(ans,3):
  if (i,j,k) in ((0,1,2),(0,4,8),(3,4,5),(6,7,8),(0,3,6),(1,4,7),(2,5,8),(2,4,6)):
    print("Yes")
    break
else:
  print("No")
# Judge status: Accepted
n = int(input())

l = list(map(int, input().split(" ")))
l.sort()

ans = 0

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if l[i] != l[j] != l[k]:
                if l[i] + l[j] > l[k]:
                    ans += 1

print(ans)
# Judge status: Wrong Answer
T = input()

ans = ""
for i in range(len(T)):
    if(T[i] == "?"):
        if(i != len(T)-1 and T[i+1] == "D"):
            ans += "P"
            continue
        elif(i != len(T)-1 and T[i+1] == "?"):
            ans += "P"
            continue
        ans += "D"
    else:
        ans += T[i]
    
print(ans)
# Judge status: Accepted
def main():
    A = int(input())
    B = int(input())
    print(6-(A+B))
if __name__ == "__main__":
    main()
# Judge status: Accepted
# -*- coding: utf-8 -*-

N = int(input().strip())
S = input().strip()
#-----

x=0
x_max=0
for w in S:
    if w == "I":
        x += 1
    elif w == "D":
        x -= 1
    
    x_max = max(x_max, x)

print(x_max)
# Judge status: Accepted
n, m = map(int, input().split())

if n == 1 and m == 1:
    ans = 1
elif n == 1 or m == 1:
    ans = max(n, m) - 2
else:
    ans = (n - 2)*(m - 2)

print(ans)
# Judge status: Accepted
Sd = input()
T = input()
 
def check(A, B):
    for a, b in zip(A, B):
        if a != '?' and a != b:
            return False
 
    return True
 
for i in range(len(Sd) - len(T) + 1)[::-1]:
    if check(Sd[i:i + len(T)], T):
        print((Sd[:i] + T + Sd[i + len(T):]).replace('?', 'a'))
        break
else:
    print('UNRESTORABLE')
# Judge status: Wrong Answer
n, m = map(int, input().split())
od = (m + 1) // 2
x = 2 * od + 1
for i in range(1, od + 1):
    print(i, x - i)
for i in range(m - od - 1):
    print(x + i, 2 * m + 1 - i)
# Judge status: Accepted
from collections import defaultdict

N = int(input())
d = defaultdict(int)
for a in map(int, input().split()):
    d[a] += 1
    d[a - 1] += 1
    d[a + 1] += 1

print(max(d.values()))
# Judge status: Accepted
N, M = map(int, input().split())

A = [input() for _ in range(N)]
B = [input() for _ in range(M)]


def f(i, j):
  for k in range(M):
    for l in range(M):
      if A[i+k][j+l] != B[k][l]:
        return False
  return True

def slv():
  for i in range(N-M+1):
    for j in range(N-M+1):
      if f(i, j):
        return 'Yes'
  return 'No'
print(slv())
# Judge status: Accepted
N = int(input())
S = list(input())
k = [0] * N
for i in range(N):
    if S[i] == "R":
        k[i] = 2
    elif S[i] == "G":
        k[i] = 3
    else:
        k[i] = 5
a = k.count(2)
b = k.count(3)
c = N - a - b
ans = a*b*c
for i in range (1,(N + 1)//2):
    for j in range (N - 2 * i):
        if k[j] * k[j + i] * k[j + 2 * i] == 30:
            ans = ans - 1
print(ans)
# Judge status: Wrong Answer
n=int(input())

x=0
for i in range(n):
    if 2**i<=n:
        x=2**i
        print(x)
# Judge status: Accepted
ABC = sorted(list(map(int, input().split())))
K = int(input())

for _ in range(K):
    ABC[2] = ABC[2] * 2

print(sum(ABC))
# Judge status: Accepted
n,nai,out=map(int,input().split())
b=input()
kokunai=0
kaigai=0
for i in range(n):
  if(b[i]=='c'):
    print('No')
  elif(b[i]=='a'):
    if(kokunai+kaigai>=nai+out):
      print('No')
    else:
      kokunai=kokunai+1
      print('Yes')
  else:
    if(kokunai+kaigai>=nai+out or kaigai>=out):
      print('No')
    else:
      print('Yes')
      kaigai=kaigai+1
# Judge status: Accepted
# -*- coding: utf-8 -*-
a, b = [int(i) for i in input().split()]

if b == 1:
    ans = 0
else:
    ans = 1
    count = a
    while True:
        if count >= b:
            break
        else:
            #count = count - 1 + a
            count += (a - 1)
            ans += 1
print(ans)
# Judge status: Accepted
s = input()
t = input()
memo = {}
ans = 'Yes'
for i in range(len(s)):
    if s[i] in memo:
        if t[i] != memo[s[i]]:
            ans = 'No'
            break
    else:
        memo[s[i]] = t[i]
a = list(memo.values())
b = list(set(a))
if len(b) != len(a):
    ans = 'No'
print(ans)
# Judge status: Accepted
n =int(input())
A = list(map(int,input().split()))

ans = [0]*n

for i in range(n)[::-1]:
  if i >= n//2:
    ans[i] = A[i]
  else:
    tmp = 0
    j = i+1
    while j<=n:
      tmp += ans[j-1]
      j += i+1
    if A[i] == 1:
      if tmp % 2 != A[i]:
        ans[i] = A[i]              
    else:      
      if tmp % 2 == 1:
        ans[i] = 1
    
print(sum(ans))
print(*[i+1 for i in range(n) if ans[i] == 1])
# Judge status: Wrong Answer
import numpy as np
n = int(input())
s = 0
a = np.array(list(map(int, input().split())))
for i in range(len(a)-1):
  s_tmp = np.sum(a[i+1:len(a)])
  s += a[i] * s_tmp
print(s % 1000000007)
# Judge status: Accepted
n = int(input())

for i in range(100): #2重ループでケーキ，ドーナツの数を1個ずつ変えていってnドルになった時に終了させる
    for j in range(100):
        if i * 4 + j * 7 == n:
            print("Yes")
            exit()

print("No")
# Judge status: Accepted
A, B, C = list(map(int, input().split()))
if (A==B or B==C or C==A) and not (A==B==C):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
from bisect import bisect_left
N = int(input())
A = [int(input()) for i in range(N)]
X = [A[0]]

for i in range(1, N):
    if X[0] >= A[i]:
        X.insert(0, A[i])
    else:
        idx = bisect_left(X, A[i])
        X[idx-1] = A[i]

print(len(X))
# Judge status: Wrong Answer
s=input()
l=['Sunny', 'Cloudy', 'Rainy']
print(3-l.index(s))
# Judge status: Wrong Answer
N=int(input())
*A,=map(int,input().split())
A.sort()

ans=A[0]
count=[0]*N
i=0
while i<N:
    count[i]=A[i]%ans
    i+=1

for c in count:
    if c>0:
        ans=min(ans,c)

for a in A:
    if a%ans>0:
        ans=min(ans,a%ans)

print(ans)
# Judge status: Wrong Answer
S = input()
count = 0
for i in range(3):
    if S[i] == "R":
        count += 1
    elif count == 1:
        count = 0
    
print(count)
# Judge status: Accepted
# ABC 114: B – 754
s = input()

min_length = 9999999999

for i in range(len(s) - 2):
    min_length = min(min_length, abs(int(s[i] + s[i + 1] + s[i + 2]) - 753))

print(min_length)
# Judge status: Accepted
s = list(input())

A = s.index("A")

S = list(reversed(s))
Z = S.index("Z")

print(len(s) - Z - A)
# Judge status: Accepted
import re
a=input()
if re.sub(r'[A-Z]',"",a)=="":
  print('A')
else:
  print('a')
# Judge status: Wrong Answer
n=int(input())
a=sorted(list(map(int, input().split())))
l=min(a);h=max(a)
res=0
for i in range(l+1,h):
    ans=0
    for j in a:
        ans+=j>=i
    if ans == n//2:res+=1
print(res)
# Judge status: Wrong Answer
w,h,n = list(map(int, input().split()))
xya = [list(map(int, input().split())) for _ in range(n)]
left = 0
right = w
down = 0
up = h
for i in xya:
    if i[2]==1:
        left = i[0]
    elif i[2]==2:
        right = i[0]
    elif i[2]==3:
        down = i[1]
    else:
        up = i[1]

print(max(up-down, 0) * max(right-left, 0))
# Judge status: Accepted
import itertools

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

def has_duplicates(seq):
    return len(seq) != len(set(seq))

sides = list(itertools.combinations(L, 3))
count = 0
for side in sides:
    if has_duplicates(side):
        continue
    else:
        temp = sorted(side)
        if temp[1]-temp[0] < temp[2] < temp[0]+temp[1]:
            count += 1

print(count)
# Judge status: Accepted
# -*- coding: utf-8 -*-
# import math

X,Y = list(map(int, input().rstrip().split()))
#-----

calc = X
cnt = 0

while calc <= Y:
    calc *= 2
    cnt += 1

print(cnt)


# エラーになる・・・
# calc = math.log( (Y / X) , 2) + 1
# print( int(calc) )