peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
S = int(input())
A = [S]
if (A[0]%2) == 0:
  A.append(int(A[0]/2))
else:
  A.append(int(3*A[0]+1))
i = 1
while i >0:
  if A[i]%2 == 0:
    X = int(A[i]/2)
    if X in A:
      A.append(X)
      break
    else:
      A.append(X)
    i += 1
  else:
    X = int(3*A[i]+1)
    if X in A:
      A.append(X)
      break
    else:
      A.append(X)
    i += 1
print(len(A))
# Judge status: Accepted
from collections import defaultdict
N, M = map(int, input().split())
D = defaultdict(int)
acd = set()
ac = 0
pen = 0
for i in range(M):
    p, S = input().split()
    p = int(p)
    if S == "WA":
        D[p] += 1
    else:
        if p not in acd:
            acd.add(p)
            ac += 1
            pen += D[p]
print(ac, pen)
# Judge status: Accepted
#coding: utf-8
A, B, N = map(int, input().split())
if N >= B:
    print((A*(B-1)//B) - A * ((B-1)//B))
else:
    print((A * N) // B - A * (N // B))
# Judge status: Accepted
n,m = map(int,input().split())
*a, = map(int,input().split())
bc =[list(map(int,input().split()))for _ in [0]*m]
 
a.sort()
bc.sort(key=lambda x:-x[1])
i =0
for b,c in bc:
    for j in range(i,min(n,i+b)):
        if a[j]< c:a[j]=c
    i = i+b
print(sum(a))
# Judge status: Accepted
# -*- coding: utf-8 -*-
n, d = map(int,input().split())
x = []
for i in range(n):
    x.append([int(i) for i in input().split()])

ans = 0
for i in range(n): #iは1個目の点
    for j in range(i + 1, n): #jは２つ目の点
        tmp = 0
        for k in range(d): #dは次元
            tmp += pow(x[i][k] - x[j][k], 2)
        #print(tmp)
        if pow(tmp, 0.5) % 1 == 0:
            ans += 1
print(ans)
# Judge status: Accepted
import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
import copy
k = int(input())
#n, d = map(int, sys.stdin.readline().split())
#s = input()
#a = list(map(int, sys.stdin.readline().split()))

m = 7
for i in range(1, 10 ** 6):
    if m % k == 0:
        print(i)
        sys.exit()

    m *= 10
    m += 7
    if m > k:
        m %= k

print(-1)
# Judge status: Accepted
n,m = map(int,input().split())
x = list(map(int,input().split()))
if n >= m:
    print(0)
    exit()
x.sort()
y = [x[i+1]-x[i] for i in range(m-1)]
y.sort(reverse = True)
count = x[m-1]-x[0]
count -= sum(y[:n-1])
print(count)
# Judge status: Accepted
x,y = map(int,input().split())
ans = abs(abs(x)-abs(y))
if x > 0 and y > 0:
    if x > y:
        ans += 2
elif x > 0 and y < 0:
    ans += 1
elif x < 0 and y > 0:
    ans += 1
elif x < 0 and y < 0:
    if x > y:
        ans += 2
else:
    if x > y:
        ans += 1
print(ans)
# Judge status: Wrong Answer
x,y,a,b,c, = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
s = p[:x]+q[:y]+r
s.sort(reverse=True)
print(sum(s[:x+y]))
# Judge status: Accepted
# | Its_Rashid | #
a , b , x = map(int , input() . split())
print('YES' if a <= x and a + b >= x else 'NO')
# Judge status: Accepted
flag = 0
X = int(input())
for A in range(1000):
    if flag!=0:
        break
    for B in range(1000):
        if A**5 - B**5 == X:
            print(str(A) + " " + str(B))
            flag=1
            break
        elif A**5 + B**5 == X:
            print(str(A) + " " + str(-B))
            flag=1
            break
# Judge status: Wrong Answer
def main():
    N = int(input())
    S = []
    c = {}
    for i in range(N):
        S.append(input())
    S = sorted(S)
    for i in range(N):
        s = S[i]
        c[s] = c[s] + 1 if (s in c)  else 1
    m = max(list(c.values()))
    for s in c.keys():
        if c[s] == m:
            print(s)

if __name__ == "__main__":
    main()
# Judge status: Accepted
x = int(input())

for i in range(1, x+1):
  wa = int(i*(i+1)/2)
  if wa > x:
    break
  if wa == x:
    print(i)
    exit()

print(i)
# Judge status: Wrong Answer
x,y = map(int,input().split())
if y%x == 0:
    print(-1)
else:
    print(x*2)
# Judge status: Accepted
N = int(input())
ans = 0
for i in range(1, N+1, 2):
	c = 0
	for j in range(1, i+1):
		if i % j == 0:
			c += 1
	if c == 8:
		ans += 1
print(ans)
# Judge status: Accepted
N = input()
N = int(N)
A = list(map(int, input().split()))
# S =[1]*N
stock = 0 #株の数
money = 1000 #所持金
for i in range(N):
  if i>0:
    if A[i-1]<A[i]: #売る
      money += stock*A[i]
      stock = 0
  if i!=N-1:
    if A[i]<A[i+1]: #買う
      stock += int(money/A[i])
      money -= stock*A[i]
print(money)
# Judge status: Accepted
k = int(input())
l = 10
A = [str(i+1) for i in range(9)]
B= ["0"]+A
ans = []

def dfs(num):
    if len(num)>=l:
        ans.append(int(num))
    else:
        ans.append(int(num))
        for i in B:
            if abs(int(num[-1])-int(i))<2:
                dfs(num+i)
if k<=9:
    print(k)
else:
    for i in A:
        dfs(i)
    ans = sorted(ans)
    print(ans[k-1])
# Judge status: Wrong Answer
import collections

n = int(input())
l = [input() for _ in range(n)]

c = collections.Counter(l)
print(c)
# Judge status: Accepted
a,b,c=map(int,raw_input().split())
if a==b and a!=c or b==c and b!=a or c==a and c!=b:
  print "2"
elif a==b and b==c:
  print "1"
else:
  print "3"
# Judge status: Accepted
a = "zabcdefghijklmnopqrstuvwxy"
number = int(input())
result = ""
for i in range(13):
    result += a[int(number % 26)]
    if number % 26 == 0:
        number -= 26
    if number // 26  == 0:
        break
    number = number // 26
result = result[::-1]
print(result)
# Judge status: Accepted
x = int(input())
kouho = {1}
for i in range(2,32):
    p = i**2
    while p <= x:
        kouho.add(p)
        p *= i
print(max(kouho))
# Judge status: Wrong Answer
from fractions import gcd

a,b,c,d = map(int,input().split())
count = (b-(b//c+b//d-b//(c*d/gcd(c,d)))) - ((a-1)-((a-1)//c+(a-1)//d-(a-1)//(c*d/gcd(c,d))))
print(int(count))
# Judge status: Accepted
import sys
input = sys.stdin.readline

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

cnt =0
for ai,bi in zip(a,b):
    if ai<=bi:
        cnt+= (bi-ai)//2
    else:
        cnt+= bi-ai

if cnt>=0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import math
a, b = map(int, input().split())
li = []
n = math.floor(math.sqrt(max(a,b)))

for i in range(1,n+1):
    if a%i == 0 and b%i == 0:
        li.append(i)

ans = 0
n = math.floor(math.sqrt(li[-1]))

for i in li:
    flag = True
    for j in range(2, n+1):
        if i<=j:
            break
        else:
            if i % j == 0:
                flag = False
    if flag:
        ans += 1

print(ans)
# Judge status: Accepted
s,w = map(int, input().split())

if s <= w:
  print('unsafe')
else:
  print('safe')
# Judge status: Accepted
A,B = map(int,input().split())
if A < 10 and B < 10:
    print(A*B)
else:
    print(-1)
# Judge status: Wrong Answer
n=int(input())
num=[int(i) for i in input().split()]

if len(num)==len(set(num)):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import collections


s = input()
t = input()
s = collections.Counter(s)
t = collections.Counter(t)

if sorted(s.values()) == sorted(t.values()):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()

if s.islower():
    print("a")
else:
    print("A")
# Judge status: Accepted
N = int(input())

i=0
while True:
    listN = list(str(N))
    #print(listN)
    if listN[0]==listN[1] and listN[1]==listN[2]:
        print(N)
        break
    N+=1
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())
X = X // 50

ans = 0
for ai in range(A+1):
  for bi in range(B+1):
    for ci in range(C+1):
      if 10*ai + 2*bi + ci == X:
        ans += 1
        
print(ans)
# Judge status: Accepted
C=input()+input()
print("YNEOS"[1 in[1 for i in range(3)if C[i]!=C[-i-1]]::2])
# Judge status: Wrong Answer
n , k = map(int, input().split())
hp = input().split()

sum_hp = 0

hp.sort()

for i in range(k):
    if(len(hp)> 0):
        hp.pop()


for j in hp:
    sum_hp = sum_hp + int(j)

print(str(sum_hp))
# Judge status: Accepted
n, m = map(int, input().split())
l_lst = []
r_lst = []
for i in range(m):
    l, r = map(int, input().split())
    l_lst.append(l)
    r_lst.append(r)
print(max(0, min(r_lst) - max(l_lst) + 1))
# Judge status: Accepted
A, B = map(int, input().split())
S = input()

ans = 'Yes'
for i, s in enumerate(S):
    if i == A:
        if s != '-':
            ans = 'No'
            break
    else:
        if s not in '0123456789':
            ans = 'No'
            break

print(ans)
# Judge status: Accepted
X=int(input())
dp=[0]*(X+106)
dp[0]=1
for i in range(X):
    if dp[i]==1:
        for j in range(100,106):
            dp[i+j]=1
print(dp[X])
# Judge status: Accepted
N,K,S = map(int,input().split())
ans = []
if S == 10**9:
    for i in range(K):
        ans.append(S)
    for i in range(N-K):
        ans.append(1)
else:
    for i in range(K):
        ans.append(S)
    for i in range(N-K):
        ans.append(S+1)
print(" ".join(map(str,ans)))
# Judge status: Accepted
import math
n, d = map(int,input().split())
ans = 0
for i in range(n):
  x, y = map(int,input().split())
  z = math.sqrt(x**2 + y**2)
  if (z <= d):
    ans = ans + 1
print(ans)
# Judge status: Accepted
import math
li = input().split()

a = ''.join(li)
b = math.pow(int(a),0.5)
if b % int(b) == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from math import pi, sin, cos, sqrt
a,b,h,m=map(int,input().split())
c=2*pi/12*h + pi/6/60*m
d=2*pi/60*m
ax=a*cos(c)
ay=a*sin(c)
bx=b*cos(d)
by=b*sin(d)
print(sqrt((ax-bx)**2 + (ay-by)**2))
# Judge status: Accepted
s=input()
t=input()
strs=[]
S=len(s)
T=len(t)
for i in range(S-T+1):
  flag=0
  for j in range(T):
    if s[i+j]=="?":
      continue
    if s[i+j]!=t[j]:
      flag=1;break
  if flag==0:
    posstr=s[:i]+t+s[i+T:]
    strs.append(posstr.replace("?","a",50))
strs.sort()
if strs==[]:print("UNRESTORABLE")
else:print(strs[0])
# Judge status: Accepted
x = int(input())

if x == 7 or x == 5 or x == 3:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
import statistics
import math
N = int(input())

n =[]
m =[]

for i in range(N):
    a,b = list(map(int,input().split()))
    n.append(a)
    m.append(b)

nmean = statistics.median(n)
mmean =statistics.median(m)

if N%2 == 1:
    print(mmean - nmean + 1)
else:
    print(int(mmean - nmean)*2 +1 )
# Judge status: Accepted
N, A, B, C, D = map(int, input().split())
N-=1
A-=1
B-=1
C-=1
D-=1
S = input()

overtakeFlag = False 
proceedableFlag = True
if C > D:
    for i in range(B, D+1):
        if S[i-1] == "." and S[i] == "." and S[i+1] == ".":
            overtakeFlag = True
else:
    overtakeFlag = True

for i in range(A, max(C, D)-1):
    if S[i]=="#" and S[i+1]=="#":
        proceedableFlag = False

if overtakeFlag and proceedableFlag:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,r=map(int,input().split())
if n>=10:
  print(r)
else:
  print(r-100*(10-n))
# Judge status: Wrong Answer
N,A,B = list(map(int,input().split()))
a = A - 1
b = N - B
c = B - A
if c%2==0:
  res = c/2
elif a<b:
  res = (B + a)/2
else:
  res = (N - (A - b) + 1) /2
print(int(res))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a<=0 and b>=0:
    print("Zero")
elif a<0 and b<0:
    if abs(b-a)%2==0:
        print("Negative")
    else:
        ("Positive")
else:
    print("Positive")
# Judge status: Accepted
st = []
S = input()
ans = 0
for c in S:
    if st != [] and c != st[-1]:
        st.pop(-1)
        ans += 2
    else:
        st.append(c)
print(ans)
# Judge status: Accepted
n = int(input())

dices = []

successive_cnt = 0

for i in range(n):
    d, e = [int(x) for x in input().split(' ')]

    if d == e:
        successive_cnt += 1
    else:
        successive_cnt = 0

    if successive_cnt == 3:
        break

if successive_cnt == 3:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
input = sys.stdin.readline


def log(*args):
    print(*args, file=sys.stderr)


def main():
    _, k = map(int, input().strip().split())
    ps = sorted(map(int, input().strip().split()))
    print(sum(ps[:k]))


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
a_sum = 0
b_sum = 0
for i in range(n):
    c.append(b[i]-a[i])
    if c[i] < 0:
        b_sum += c[i]
    else:
        a_sum += c[i]//2

if a_sum < abs(b_sum):
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for l in range(n)]
flag = True
ans = 0
i = a[0]
while flag:
  i = a[i-1]
  ans += 1
  if i == 2:
    print(ans+1)
    flag = False
 
  if ans > n-1:
    print(-1)
    flag = False
# Judge status: Accepted
N = int(input())
A = []
A = list(map(int, input().split()))

c_amount = 1000
for i in range(N-1):
    if(A[i]>=A[i+1]):
        pass
    else:
        c_amount+=(c_amount//A[i])*(A[i+1]-A[i])

print(c_amount)
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
c = Counter(a)
d = [0,0]
for i in c:
    if c[i]>1:
        d.append(i)
    if c[i]>3:
        d.append(i)
d.sort(reverse=True)
print(d[-1]*d[-2])
# Judge status: Accepted
import math

num = int(input())
step = []
sqrt_num = int(math.sqrt(num))
count=0

while True:
  for i in range(2,sqrt_num+2):
    if num == 2:
      count=1
      break
      
    if num%i == 0:
      count = 0
      break
      
    count=1
    
  if count == 1:
    break
    
  num = num+1
  sqrt_num = int(math.sqrt(num))

print(num)
# Judge status: Accepted
from decimal import Decimal
A, B = list(map(float, input().split()))
a = Decimal(str(A))*Decimal(str(B))
print(int(a//1))
# Judge status: Accepted
def main(n):
    for i in range(1,10):
        x,y = divmod(n, i)
        if y == 0 and (0 < x and x < 10):
            return True
    return False

n = int(input())
print("Yes" if main(n) else "No")
# Judge status: Accepted
a,b=map(int,input().split())
m=min(a,b)
kouyakusuu=1
for i in range(1,m+1):
    if a%i==0 and b%i==0:
        kouyakusuu=i
print(a*b//kouyakusuu)
# Judge status: Accepted
import numpy as np
N = int(input())
A = np.array(input().split(), dtype=np.int64)

neg = np.count_nonzero(A[A < 0])
ans = np.abs(A).sum()
if neg % 2 == 1:
    v = np.abs(A).min()
    ans -= 2 * v

print(ans)
# Judge status: Accepted
from sys import stdin
 
r = int(stdin.readline().rstrip())
 
print(r ** 2)
# Judge status: Accepted
n = int(input())
S = input()

ans = S.count('R') * S.count('G') * S.count('B')

for i in range(n-2):
    for j in range(i+1,n-1):
        if 2*j-i >= n:
            break
        elif S[i] != S[j] and S[j]!=S[2*j-i] and S[i] != S[2*j-i]:
            ans -=1

print(ans)
# Judge status: Accepted
s=int(input())
A=[111,222,333,444,555,666,777,888,999]
for i in A:
  if i-s>=0:
    print(i)
    exit()
# Judge status: Accepted
n,l=map(int,input().split())
a=list(range(l,n+l))
m=list(map(abs,a))
print(sum(a)-a[m.index(min(m))])
# Judge status: Accepted
n,h = map(int,input().split())
a = []
b = []
for i in range(n):
    ai,bi = map(int,input().split())
    a.append(ai)
    b.append(bi)
a.sort(reverse=True)
b.sort(reverse=True)
ans = 0
damage = 0
for i in b:
    if i > a[0]:
        damage += i
        ans += 1
        if damage >= h:
            print(ans)
            exit()
h -= damage
print(ans + (h+a[0]-1)//a[0])
# Judge status: Accepted
n = int(input())
dat = list(map(int, input().split()))
t = sum(dat)
target = t//2
c = 0
c2 = t
res = 99999999999999999
for i in range(n):
    c += dat[i]
    c2 -= dat[i]
    res = min(res, abs(c-c2))

print(res)
# Judge status: Accepted
N,K,S=map(int,input().split())
if S==10**9:
    l=[10**9]*K + [1]*(N-K)
    print(*l)
else:
    l=[S]*K+[10**9]*(N-K)
    print(*l)
# Judge status: Accepted
# -*- coding: utf-8 -*-
a,b,c,d = map(int, input().split())
start_later = max(a,c)
stop_earlier = min(b,d)
res = stop_earlier - start_later
print(res if res > 0 else 0)
# Judge status: Wrong Answer
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
b = a - np.arange(1, n+1)
print(int(np.median(b)))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

m = 0
b = []
for i in range(n):
    if a[i] < 0:
        m += 1
        b.append(-a[i])
    else:
        b.append(a[i])

if m % 2 == 1:
    print(sum(b) - 2*min(b))
else:
    print(sum((b)))
# Judge status: Accepted
n = int(input())
pw = 1
for i in range(n):
  pw *= (i+1)
  pw %= 10**9+7
print(pw)
# Judge status: Accepted
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

for i in range(N):
    A[i] -= i + 1

A.sort()
central = A[N // 2]

ans = 0
for i in range(N):
    ans += abs(central - A[i])
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline

N = int(input())
S = list(input().rstrip())

A = [0]
a = 0
for s in S:
    if s == ".":
        a += 1
    A.append(a)

B = A[-1]

ans = N+1
for i, a in enumerate(A):
    score = (i - a) + B - a
    ans = min(ans, score)

print(ans)
# Judge status: Wrong Answer
n, k, s = map(int, input().split())

arr = [s] * k + [s + 1, s - 1] * ((n - k) // 2) + [s + 1] * ((n - k) % 2)

print(*arr)
# Judge status: Accepted
def dfs(s, mx, N):
    if len(s) == N:
        print s
    else:
        for ch in range(ord('a'), ord(mx) + 1):
            if chr(ch) == mx:
                dfs(s + chr(ch), chr(ord(mx) + 1), N)
            else:
                dfs(s + chr(ch), mx, N)

def solve2():
    N = int(raw_input())
    dfs('', 'a', N)

if __name__ == '__main__':
    solve2()
# Judge status: Wrong Answer
from math import floor


def main():
    N, M = map(int, input().split(" "))
    A = list(map(int, input().split(" ")))
    A.sort(reverse=True)
    while M > 0:
        for i in range(0, N):
            if A[i] > 2 and M > 0:
                A[i] = floor(A[i] / 2)
                M -= 1
    print(sum(A))


if __name__ == '__main__':
    main()
# Judge status: Accepted
A = input()
N = len(A)
for i in range(N):
    if A[i] == "A":
        posA = A.index(A[i])
        break
p = 0
for j in range(0, N):
    if A[j] == "Z" and j > p:
        p = j
p += 1
print(len(A[posA:p]))
# Judge status: Accepted
class Robot:
    def __init__(self, left, right):
        self.left = left
        self.right = right
    
    def __lt__(self, other):
        return self.right < other.right

n = int(input().rstrip())
robos = [None] * n

for i in range(n):
    line = input().rstrip().split(' ')
    robos[i] = Robot(int(line[0]) - int(line[1]), int(line[0]) + int(line[1]))

robos.sort()

cur = -1000000000
ans = 0
for i in range(n):
    if cur <= robos[i].left:
        ans += 1
        cur = robos[i].right

print(ans)
# Judge status: Accepted
N,X,Y = map(int,input().split())
L = []
for i in range(N-1):
     L.append(0)
for A in range(1,N):
    for B in range(A+1,N+1):
        a_1 = B-A
        a_2 = abs(X-A)+1+abs(Y-B)
        a = min([a_1,a_2])
        L[a-1]+=1 
for j in range(N-1):
    print(L[j])
# Judge status: Accepted
import math
mod=10**9+7
factorial=[1 for _ in range(10**5+10)]
for i in range(1, 10**5+10):
    factorial[i]=i*factorial[i-1] % mod
n,m=map(int,input().split())
if abs(n-m)>1:
    print(0)
elif abs(n-m)==0:
    print(2*factorial[n]*factorial[m]%mod)
else:
    print(factorial[n]*factorial[m]%mod)
# Judge status: Accepted
#abc137 c
n=int(input())
table=dict()
for i in range(n):
    s=str(sorted(input()))
    if s not in table:
        table[s]=1
    else:
        table[s]+=1
ans=0

for x in table.values():
    kumi=(x*(x-1))/2
    ans+=int(kumi)
print(ans)
# Judge status: Wrong Answer
import sys

N = int(sys.stdin.readline().rstrip())

A = []
for _ in range(N):
    A.append(int(sys.stdin.readline().rstrip()))

pairs = 0
pre_res = 0
for a_i in A:
    r = a_i // 2
    pairs += r
    res = a_i - 2*r
    if res + pre_res == 2:
        pairs += 1
        res = 0
    
    pre_res = res

print(pairs)
# Judge status: Accepted
n = int(input())
s = input()
countr, countl = 0, 0

for i in range(n-1, -1, -1):
    if s[i] == ')': countr += 1
    elif countr > 0: countr -= 1
s = '('*countr+s
n = len(s)

for i in range(n):
    if s[i] == '(': countl += 1
    elif countl > 0: countl -= 1
s += ')'*countl

print(s)
# Judge status: Accepted
from collections import Counter


N = int(input())
D = list(map(int, input().split()))
p = 998244353
count = Counter(D)

if D[0] != 0 or len(set(D)) != max(D) + 1 or count[0] > 1:
    ans = 0
else:
    count = sorted(count.items(), key=lambda x: x[0])
    ans = 1
    for i in range(len(count) - 1):
        x = count[i][1]
        y = count[i + 1][1]
        ans *= x ** y
        ans %= p

print(ans)
# Judge status: Accepted
X, Y = [int(i) for i in input().split()]

ans = "No"
for i in range(101):
    if ans != "No":
        break
    for j in range(101):
        if i+j != X:
            continue
        if i*2 + j*4 == Y:
            ans = "Yes"
            break
print(ans)
# Judge status: Wrong Answer
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

A_res = A + V * T
B_res = B + W * T
if A > B:
    print("NO")
elif A_res >= B_res:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N = int(input())
S = set()
ans = 0
for i in range(N):
    a = int(input())
    if a in S:
        ans -= 1
        S.remove(a)
    else:
        ans += 1
        S.add(a)
print(ans)
# Judge status: Accepted
n=int(input())
a=[0]
for _ in range(n):
    a.append(int(input()))
b=[0]*(n+1)
i=1
ans=0
while b[i]==0 and i!=2:
    b[i]=1
    i=a[i]
    ans+=1
print(ans if i==2 else -1)
# Judge status: Wrong Answer
a,b=map(int,input().split())
count=0
while b>0:
    b=b-a
    count=count+1
     
print(count)
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]

sm = sum(a)
acc = [0]
for i in range(n):
  acc.append(acc[-1] + a[i])

ans = 10000000000
for i in range(1,n):
  ans = min(ans,abs(sm - acc[i] * 2))
print(ans)
# Judge status: Wrong Answer
from math import pi
def cicle(r):
    return 2 * r * pi
# Judge status: Accepted

n = int(input())

ans = 0

a = 1

while a <= n:
 
    if a == 1 :
        ans =  ans + (n - 1)
    else :
        if n % a == 0 :
            ans = ans + ( (n // a) - 1)
        else :
            ans = ans + ( (n // a) )

    a += 1

print(ans)
# Judge status: Accepted
N = input()
N = int(N)

if (N <= 999):
	print("ABC")
else:
	print("ABD")
# Judge status: Accepted
N, K = map(int, input().split())
H = list(map(int, input().split()))

H = [0] + H
dp = [0] * (N+1)

for i in range(2, N+1):
    dp[i] = dp[i-1] + abs(H[i]-H[i-1])
    for k in range(2, K+1):
        if i-k >= 1:
            dp[i] = min(dp[i], dp[i-k]+abs(H[i]-H[i-k]))

res = dp[N]
print(res)
# Judge status: Accepted
## coding: UTF-8
import math

N, X, T = map(int,input().split())
ans = math.ceil(N/X) * T
print(ans)
# Judge status: Accepted
N = int(input())
a = [0] + list(map(int,input().split()))
ans = [0]*(N+1)
for k in range(N,0,-1):
    temp = 0
    l = k
    while l <= N:
        temp += ans[l]
        l += k
    if a[k] == 1 and temp%2 == 0:
        ans[k] = 1
    elif a[k] == 0 and temp%2 == 1:
        ans[k] = 1
b = []
for k in range(1,N+1):
    if ans[k] == 1:
        b.append(k)
print(len(b))
print(*b)
# Judge status: Accepted
import copy

n, q = map(int, input().split())
s = input()

cnt = [0]
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        cnt.append(cnt[-1] + 1)
    else:
        cnt.append(cnt[-1])

for i in range(q):
    l, r = map(int, input().split())
    print(cnt[r-1] - cnt[l-1])
# Judge status: Wrong Answer
import math

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

A=[int(b) for b in a]

place=A.index(min(A))

if place==0:
    answer=N//2
    print(answer)
else:
    answer=math.ceil((N-place)/2)
    answer+=math.ceil(place/2)
    print(answer)
# Judge status: Accepted
a,b = input().split()
a = int(a)
b = int(b[0] + b[2:])
print(a*b//100)
# Judge status: Accepted
G = [set([1,3,5,7,8,10,12]), set([4,6,9,11]), set([2])]
def check(x, y):
  for g in G:
    if x in g and y in g:
      return True
  return False
x, y = map(int, input().split())
print("Yes" if check(x, y) else "No")