peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
Q, H, S, D = map(int, input().split())
N = int(input())

min_1l = min([4 * Q, 2 * H, 1 * S])
min_2l = min([8 * Q, 4 * H, 2 * S, D])

ans = 0
if min_2l == D:
  ans = D * (N // 2) + (N % 2) * min_1l
else:
  ans = N * min_1l

print(ans)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
t = 0
result = 0
for i in range(n - 1):
  if h[i + 1] <= h[i]:
    t += 1
  else:
    result = max(t, result)
    t = 0
result = max(t, result)
print(result)
# Judge status: Wrong Answer
N, T = map(int, input().split())
M = 10000
for n in range(N):
    c, t = map(int, input().split())
    if T >= t:
        M = min(M, c)
print(M)
# Judge status: Wrong Answer
N=int(input())
a=input().split()
A=[int(number) for number in a]
pluss=[]
minuss=[]
number=1
for a in A:
    plus=a+number
    minus=abs(a-number)
    pluss.append(plus)
    minuss.append(minus)
    number+=1
answer=0
suuji=0
for n in pluss:
    answers=minuss[suuji:]
    answer+=answers.count(n)
    suuji+=1


print(answer)
# Judge status: Accepted
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
 
a, b = map(int, input().split())
print(len(set(prime_factorize(a)) & set(prime_factorize(b))) + 1)
# Judge status: Accepted
import math
n, k = map(int, input().split())
ans = 0.0
if n >= k:
  ans += (n-k+1)/n
  
for i in range(1, min(n+1, k)):
  now = i
  p = 1/n
  while(now <k):
    now *= 2
    p /= 2
  ans += p
  
print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        C = int((x - 500 * i - 100 * j) / 50)
        if C >= 0 and C <= c:
            cnt += 1
            
print(cnt)
# Judge status: Accepted
n, k = map(int, input().split())
MOD = 1e9+7

def s(i,n):
    s1 = (2 * i * i)
    s2 = (3 * n * (i+1)) 
    s3 = 8

    d = (s2 + s3 - s1)

    ans = ( int((i * d)/6 + 0.5) )
    
    return ans

ans = int(s(n+1,n) - s(k-1,n)) % MOD
if ans < 0:
    ans += MOD

print(int(ans))
# Judge status: Accepted
a,b,k = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

from itertools import accumulate

A = list(accumulate(A))
B = list(accumulate(B))
A = [0] + A
B = [0] + B

ans = 0
num = b
for i in range(a+1):
    if A[i] > k:
        continue
    while True :
        if A[i] + B[num] > k:
            num -=1
        else:
            ans = max(ans,i+num)
            break
print(ans)
# Judge status: Accepted
N = int(input())

l = [i for i in range(1, N+1)]
l1 = l.copy()
c = [0]*N

while True:
    exist_even = False
    for i in range(N):
        if l[i] % 2 == 0:
            exist_even = True
    if not exist_even:
        break

    for i in range(N):
        if l[i] % 2 == 0:
            l[i] = l[i] // 2
            c[i] += 1

idx = c.index(max(c))
print(l1[idx])
# Judge status: Wrong Answer
N,M = map(int,input().split())

if(N==1):
    if M==1:
       print(1)
    elif M==2:
        print(0)
    else:
        print(M-2)
elif(N==2):
    print(0)
else:
    if M==1:
       print(1)
    elif M==2:
        print(0)
    else:
        print((N-2)*(M-2))
# Judge status: Accepted
import math

h = int(input())
w = int(input())
n = int(input())

if h > w:
  h, w = w, h
print(math.ceil(n / w))
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

L = abs(A-B)
S = V - W
if S * T >= L:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a, b = map(int, input().split())

if a>8 or b>8:
    print(':(')
else:
    print('Yay!')
# Judge status: Wrong Answer
def solve(s):
  suma = 0
  for x in s:
    suma += int(x)
  if suma % 9 == 0:
    print("YES")
  else: print("NO")
s = input()
solve(s)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().split()))

def minimize(list):
    min = 0
    for i in range(-100,101):
        num = 0
        for j in range(len(list)):
            num = num + (int(list[j]) - i)**2
        if min == 0:
            min = num
        elif min > num:
            min = num
    return min

print(minimize(a))
# Judge status: Accepted
#coding:utf-8

import queue



def main():
    s = input()
    t = ''
    for _ in range(10):
        t += 'hi'
        if t == s:
            print('Yes')
            break
    else:
        print('No')
    
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
ans = 'AB'
if n <= 999:
  ans += 'C'
else:
  ans += 'D'
  n -= 999
print(ans+'{:03}'.format(n))
# Judge status: Wrong Answer
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
s = input()
t = input()

if s==t and len(s)>=n:
  print(n)
  exit()
if n>=len(s)+len(t):
  print(n)
  exit()

de = 0
for i in range(min(len(s),len(t))):
  if s[i*-1-1]==t[i]:
    de+=1
  else:
    break

print(len(s)+len(t)-de)
# Judge status: Accepted
a,b = map(int,input().split())
s = list(input())
for i in range(a+b+1):
    if i < a and not s[i].isdigit():
        print('No')
        exit()
    elif i == a and s[i] != '-':
        print('No')
        exit()
    elif i > a and not s[i].isdigit():
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort()
M = max(a)
m = M / 2

diff = 10 ** 9
r = None
for i in range(n):
    if a[i] == M:
        continue
    else:
        if abs(m - a[i]) < diff:
            diff = abs(m - a[i])
            r = a[i]

print(M, r)
# Judge status: Wrong Answer
a = int(input())
for n in range(1,9):
  for k in range(1,9):
    if n*k==a:
      print('Yes')
      break
  else:
    continue
  break
else:
  print('No')
# Judge status: Wrong Answer
s=list(input())
ans,c,f=0,0,0
for i in range(len(s)):
    if s[i]=='A' and f==0:f=1
    if f==1: c+=1
    if i<len(s)-1:
        if s[i]=='Z' and s[i+1]!='Z' and f==1:
            ans=max(ans,c); c=0
print(ans)
# Judge status: Wrong Answer
n, d = map(int, input().split())

cnt = 0
for i in range(n):
  x, y = map(int, input().split())
  if d * d > x * x + y * y:
    cnt += 1

print(cnt)
# Judge status: Wrong Answer
N, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

count = 0
for ai in a:
    if ai <= x:
        x -= ai
        count += 1
    else:
        break

if x > 0:
    count -= 1

print(count)
# Judge status: Accepted
n = int(input())
l = list(int(input()) for _ in range(n))
num = 1
ans = -1

for i in range(n):
    if num == 2: 
        ans = i
        break
    num = l[num-1]
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
dic = {}
for a in A:
  if a in dic:
    dic[a] += 1
  else:
    dic[a] = 1
  if a-1 in dic:
    dic[a - 1] += 1
  else:
    dic[a - 1] = 1
  if a + 1 in dic:
    dic[a + 1] += 1
  else:
    dic[a + 1] = 1
m = 0
for v in dic.values():
  if m < v:
    m = v
print(m)
# Judge status: Wrong Answer
n, c, k = map(int, input().split())
tList = [int(input()) for _ in range(n)]
tList.sort()
ans = []
while 1:
    limit = tList[0] + k
    for i in range(min(c, len(tList))):
        mark = i
        if tList[i] > limit:
            break
    ans.append(tList[:mark + 1])
    tList = tList[mark + 1:]
    if tList == []:
        break
print(len(ans))
# Judge status: Wrong Answer
n, *a = map(int, open(0).read().split())
a += 1,
m = 1000
from itertools import*
for i in [list(k) for p, k in groupby(range(n+1), key = lambda j:a[j] >= a[j-1]) if p]:
  m = m // a[i[0]] * a[i[-1]] + m % a[i[0]]
print(m)
# Judge status: Accepted
n,m=map(int,input().split())
student=[]
for _ in range(n):
    a,b=map(int,input().split())
    student.append([a,b])

checkpoint =[]
for _ in range(m):
    c,d = map(int,input().split())
    checkpoint.append([c,d])

for i in range(n):
    s = student[i]
    dist = float('inf')

    num=0
    for j in range(m):
        c=checkpoint[j]
        tmp = abs(s[0]-c[0]) + abs(s[1]-c[1])

        if tmp < dist:
            dist = tmp
            num=j+1

    print(num)
# Judge status: Accepted
s = str(input())

if s == "ABC":
    print("ARC")
else:
    print("ABC")
# Judge status: Wrong Answer
N = 127
N = str(N)
list_N = list(N)
list_N = [int(s) for s in list_N]
print(list_N)

if(list_N[0] != 7 and list_N[1] != 7 and list_N[2] != 7):
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
A,B = map(int,input().split())

if A >= 13:
  print(B)
elif 6<=A<=12:
  print(B/2)
else:
  print("0")
# Judge status: Accepted
N = int(input())
H = list(map(int,input().split()))
b = [0]*N
mb = 0
for i in range(N-2,-1,-1):
    if H[i+1] <= H[i]:
        b[i] = b[i+1]+1
    else:
        b[i]= 0
    mb = max(mb,b[i])
print(mb)
# Judge status: Accepted
import math
N,D = map(int,input().split())
print(math.ceil(N/(D*2+1)))
# Judge status: Accepted
from fractions import gcd
n,m=map(int,input().split())
*a,=map(int,input().split())

g=a[0]
lcm=a[0]

for i in range(1,n):
    g=gcd(lcm,a[i])
    lcm*=a[i]
    lcm//=g

for i in range(n):
    if lcm//a[i]%2==0:
        print(0)
        exit(0)

print((2*m//lcm+1)//2)
# Judge status: Wrong Answer
N=int(input())
S=input()
ans=""
for s in S:
  if ord("Z") < ord(s)+N:
    ans+=chr(ord("A")+ord("Z")-(ord(s)+N))
  else:
    ans+=chr(ord(s)+N)
print(ans)
# Judge status: Accepted
import math

n=int(input())
M=[]
for i in range(n):
    x,y=map(int,input().split())
    M.append([x,y])

D=[]
for i in range(n-1):
    for j in range(i+1,n):
        D.append(math.sqrt((M[i][0]-M[j][0])**2+(M[i][1]-M[j][1])**2))

print(sum(D)*2/n)
# Judge status: Wrong Answer
n,k=map(int,input().split())
h=[int(input())for _ in range(n)]
h.sort()
ls=[]

for i in range(n-2):
  ls+=str(abs(h[i]-h[i+2]))

print(min(ls))
# Judge status: Wrong Answer
n=int(input())
s=input()

cntw=[0]*(n+1)
totr=0
totw=0

for i in range(n):
    if s[i]=='W':
        cntw[i+1]=cntw[i]+1
        totr+=1
    else:
        cntw[i+1]=cntw[i]
        totw+=1
ans=10**6
for i in range(n):
    w=cntw[i]
    r=n-i-(totw-cntw[i])
    ans=min(ans,max(w,r))

print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python
# coding: utf-8

# In[26]:


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


# In[33]:


ans = max([abs(y) for y in x])
for i in range(N-K+1):
    tmp = x[i:i+K]
    ans = min(abs(tmp[0])+(tmp[K-1]-tmp[0]),abs(tmp[K-1])+(tmp[K-1]-tmp[0]))
print(ans)


# In[ ]:
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a + b > 24:
    print((a + b) - 24)
else:
    print(a + b)
# Judge status: Accepted
import sys
import math

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

try:
    if S[0:K] =='1'*K:
        print(1)
    else:
        S=list(S)
        print([i for i in S if i  != '1'][0])
except:
    if S[0:100] =='1'*100:
        print(1)
    else:
        S=list(S)
        print([i for i in S if i  != '1'][0])
# Judge status: Accepted
S = input()
T = input()

result = 0
for s, t in zip(S, T):
    result += s != t
print(result)
# Judge status: Wrong Answer
K, S = map(int, input().split())

res = 0

for ed in range(min(S, K), -1, -1):
    res += (S-ed)*(S-ed-1)//2 # Σ^n{k} = n*(n+1)/2
print(res)
# Judge status: Accepted
def main():
    input() #n
    a = list(map(int, input().split()))
    prod = 1

    if 0 in a:
        print(0)
        return
    for i in a:
        prod *= i
        if prod > 1e+18:
            print(-1)
            break
    else:
        print(prod)

if __name__ == "__main__":
    main()
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))

for k in range(1,min(K+1,45)):
    B = [0]*N
    for i in range(N):
        l = max(0,i-A[i])
        r = min(N-1,i+A[i])
        B[l] += 1
        if r+1 < N:
            B[r+1] -= 1
            
    for i in range(1,N):
        B[i] += B[i-1]
    A = B
print(*A)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**6)

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

newa=sorted(a)

#print(a)
#print(newa)
#print(newa[2])

if newa[2]%2==0 or newa[1]%2==0 or newa[0]%2==0:
    print("0")
else:
    print(a[0]*a[1])
# Judge status: Accepted
x = int(input())
print(2 * (x // 11) + ((x % 11 - 1) // 6 + 1))
# Judge status: Wrong Answer
A=input()
if A=="a":
  print("vowel")
if A=="i":
  print("vowel")
if A=="u":
  print("vowel")
if A=="e":
  print("vowel")
if A=="o":
  print("vowel")
else :
  print("consonant")
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
l = [i + a[i] for i in range(n)]
r = [i - a[i] for i in range(n)]
countl = Counter(l)
countr = Counter(r)
ans = sum([countl[i]*countr[i] for i in countl.keys()])
print(ans)
# Judge status: Wrong Answer
N = int(input())
c = input()
ans = 0
fs = 0
ls = N - 1
for _ in range(N):
    for i, ci in enumerate(c[fs:ls]):
        if ci == 'W':
            break
        fs += 1
    for i , ci in enumerate(c[fs:ls:-1]):
        if ci == 'R':
            break
        ls -= 1
    if fs == ls:
        break
    ans += 1
    fs += 1
    ls -= 1
    #print(c[fs:ls] + 1)
    if len(c[fs:ls + 1]) <= 1:
        break
print(ans)
# Judge status: Wrong Answer
n = int(input())
if 1 <= n < 100:
  ans = 800 * n - 200 * (n // 15)
  print(ans)
# Judge status: Accepted
n = int(input())
s = input()

x = 0

ans = 0
for c in s:
    if c == "I":
        x += 1
    else:
        x -= 1
    ans = max(x, ans)

print(ans)
# Judge status: Wrong Answer
import fractions
n,x = map(int,input().split())
s = set(map(int,input().split()))
s.add(x)
l = list(s)
l.sort()
t = set([])
for i in range(len(l)-1):
  t.add(l[i+1]-l[i])
u = list(t)
if len(u) == 1:
  print(u[0])
  exit()
y = fractions.gcd(u[0],u[1])
if len(u) == 2:
  print(y)
  exit()
else:
  for i in range(1,len(u)-1):
    y = fractions.gcd(y,l[i+1])
  print(y)
# Judge status: Accepted
n, r= map(int, input().split())
ans = 0
if n < 10: ans = 100 * (10 - n) + r
else: ans = r
print(ans)
# Judge status: Accepted
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0:
        cnt+=1
        temp //= i
      arr.append(cnt)
  if temp!=1:
    arr.append(1)
  if n==1:
    arr.append(0)
  return arr
def kak(n):
  return ((1+8*n)**(1/2)-1)//2
  
A=factorization(int(input()))
print(int(sum([kak(i) for i in A])))
# Judge status: Accepted
a = list(map(int, input().split()))
k = int(input())

am = max(a)
mp = a.index(am)

for i in range(k):
  am = am*2

a[mp] = am
print(sum(a))
# Judge status: Accepted
x, y = map(int, input().split())

l = [4,6,9,11]
t = [1,3,5,7,8,10,12]


if x == y:
	print("Yes")
elif x in l and y in l or x in t and y in t:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
import math
n = int(input())
lis = []
for i in range(2,math.ceil(math.sqrt(n))+1):
    cnt = 0
    while n % i == 0:
        n //= i
        cnt += 1
    if cnt:lis.append(cnt)
if n != 1:
    lis.append(1)
ans = 0

if lis == []:
    if n == 1:
        print(0)
        exit()
    else:
        print(1)
        exit()
for num in lis:
    go = 1
    while num >= go:
        ans += 1
        num -= go
        go += 1
print(ans)
# Judge status: Accepted
s = int(input())

if s % 10 == 2 or s % 10 == 4 or s % 10 == 5 or s % 10 == 7 or s % 10 == 9:
    print("hon")
elif s % 10 == 0 or s % 10 == 1 or s % 10 == 6 or s % 10 == 8:
    print("pon")
else:
    print("bon")
# Judge status: Accepted
n = int(input())
l = [int(i) for i in input().split()]

total = 0
ct = 0
min_num = 10**9
for i in l:
    total += abs(i)
    ct += 1 if i < 0 else 0
    min_num = min(min_num,abs(i))

if ct%2:
    print(total - min_num*2)
else:
    print(total)
# Judge status: Accepted
from collections import Counter
N, M = map(int, input().split())
cnt = Counter(map(int, input().split()))

for _ in range(M):
    B, C = map(int, input().split())
    cnt[C] += B

ans = 0
for n, c in sorted(cnt.items(), reverse=True):
    if N == 0:
        break
    mi = min(c, N)
    ans += mi * n
    N -= mi
print(ans)
# Judge status: Accepted
import itertools
X = int(input())

l = [i for i in range(-1000, 1000)]
c = itertools.permutations(l, 2)
for a, b in c:
    if a**5 - b**5 == X:
        print(a, b)
        break
# Judge status: Wrong Answer
s = int(input())
q, r = divmod(s, 10**9)
print(0, 0, 10**9, 10**9-r, 1, q+1)
# Judge status: Accepted
n=int(input())
a=int(input())
if n%500<=a:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s = input()
if s[0] == s[1] == s[2] or s[1] == s[2] == s[3]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n, w = map(int, input().split())
a = [[int(i) for i in input().split(" ")] for j in range(n)]
dp = [[0]*(w+1) for i in range(n+1)]
for i in range(1, n+1):
    w_, v_ = a[i-1]
    for j in range(1, w+1):
        if j < w_:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i-1][j-w_]+v_, dp[i-1][w])
print(dp[n][w])
# Judge status: Accepted
N = int(input())
kyu = 1
for i in range(1800, 0, -200):
    if i <= N:
        break
    kyu += 1
print(kyu)
# Judge status: Accepted
N=input()
if "7" in N:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
s=list(input())
from collections import Counter
d=Counter(s)
print(min(d[0], d[1]))
# Judge status: Accepted
p,q,x,y=map(int,input().split())
x-=p
y-=q
u='U'*y+'R'*x
d='D'*y+'L'*x+'LU'
print(u+d+u+'RDRD'+d)
# Judge status: Accepted
N = int(input())
c = []
for i in range(10):
    c.append([0] * 10)
for i in range(N):
    s = str(i+1)
    i1 = int(s[0])
    i2 = int(s[-1])
    c[i1][i2] += 1
total = 0
for i in range(10):
    for j in range(10):
        total += c[i][j] * c[j][i]
print(total)
# Judge status: Accepted
s = list(map(int, input().split()))
s.sort()
print('Yes' if s[0] + s[1] == s[2] else'No')
# Judge status: Accepted
n=int(input())
ans=10**n-2*9**n+8**n
print(ans%(10**9+7))
# Judge status: Accepted
N = int(input())
a = list(map(int,input().rstrip().split(" ")))
K = sum(a)
now = 0
ans = 10 ** 15
for i in range(N -1):
    now += a[i]
    K -= a[i]
    ans = min(ans,abs(K - now))
print(ans)
# Judge status: Accepted
l = list(input())
l2 = []
for i in l[::-1]:
    l2.append(int(i))

l2.append(0)
count = 0

for i in range(len(l2)):
    if l2[i] <= 4:
        count += l2[i]
    elif l2[i] == 5:
        if l2[i+1] <=4:
            count += 5
        else:
            count += 5
            l2[i+1] += 1
    else:
        count += 10-l2[i]
        l2[i+1] += 1
print(count)
# Judge status: Accepted
X, Y, Z = map(int, input().split())
ans = 0

X -= Z
while True:
    if X >= Y+Z:
        ans += 1
        X -= (Y+Z)
    else:
        break

print(ans)
# Judge status: Wrong Answer
hp,kind = input().split(" ")
sp_atk = [int(i) for i in input().split()]

if int(hp) < sum(sp_atk):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math
n,k = map(int, input().split())
a = list(map(int,input().split()))
for i in range(n):
    if n/(k+((k-1)*i)) <= 1:
        print(i+1)
        break
# Judge status: Accepted
a, b, n = list(map(int, input().split()))
if n < b:
    t = n
else:
    t = b - 1
mx = a * (t) // b - a * ((t) // b)
print(mx)
# Judge status: Wrong Answer
s = input()
if s[:4] != "2018":
    s = "2018" + s[3:]
print(s)
# Judge status: Accepted
S = input()
f = int(S[:2])
s = int(S[2:])
if 1 <= f <= 12:
  if 1 <= s <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif 1 <= s <= 12:
  print('YYMM')
else:
  print('NA')
# Judge status: Accepted
alphabet=input() # 入力アルファベット

if alphabet.isupper(): # 入力アルファベットが大文字のとき
    print("A")
else: # 小文字のとき
    print("a")
# Judge status: Accepted
S = input()
for i in range(len(S) - 1):
    if (S[i] == S[i + 1]):
        print('Bad')
        exit(0)
print('Good')
# Judge status: Accepted
def solve():
    S = input()
    l = int(S[:2])
    r = int(S[2:])
    
    if 1 <= l <= 12:
        if 1 <= r <= 12:
            return 'AMBIGUOUS'
        else:
            return 'MMYY'
    else:
        if 1 <= r <= 12:
            return 'YYMM'
        else:
            return 'NA'

print(solve())
# Judge status: Accepted
n,m = map(int, input().split())
l = list(map(int, input().split()))
a = sum(l)

if a > n:
    print('-1')
else:
    print(n - a)
# Judge status: Accepted
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    x,y = map(int, readline().split())

    a = 4 * x - y
    b = y - 2 * x

    if a % 2 == 0 and b % 2 == 0:
        if a >= 0 and b >= 0:
            print("Yes")
        else:
            print("No")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import Counter

def prime_fact(n):
    P = []
    for i in range(2, int(n**0.5)+1):
        while n % i == 0:
            P.append(i)
            n //= i
    if n != 1:
        P.append(n)
    return P
  
n = int(input())
cnt = Counter(prime_fact(n))
#print(cnt)

ans = 0
for c in cnt.values():
    tmp = 1
    while c >= tmp:
        c -= tmp
        ans += 1
        tmp += 1
        
print(ans)
# Judge status: Accepted
def f(A,B):
    if A*500>=B:
        return "Yes"
    else:
        return "No"
A,B=map(int,input().split())
print(f(A,B))
# Judge status: Accepted
n=int(input())
def fibonacci(n):
    fib = [2, 1]
    for i in range(2, n):
        fib.append(fib[i - 2] + fib[i - 1])
        
    return fib[n -1]
print(fibonacci(n+1))
# Judge status: Accepted
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
if sum(s) % 10 != 0:
    print(sum(s))
else:
    for i in range(n):
        if s[i] % 10 != 0:
            print(sum(s)-s[i])
            exit()
    print(0)
# Judge status: Accepted
H,W,N=[int(input()) for i in range(3)]
print(-(-N//max(H,W)))
# Judge status: Wrong Answer
x=list(map(int,input().split()))
for i in range(4):
  if x[i]==0:
    print(i+1)
    break
# Judge status: Wrong Answer
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 or y < 0:
	ans += 1
print(ans)
# Judge status: Accepted
S=input()

for i in range(len(S)):
  if S[i]=='A':
    S=S[i:]
    break

for i in range(len(S)-1,0,-1):
  if S[i]=='Z':
    S=S[:i+1]
    break
    
print(len(S))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
Ans = [0]*N

for i, a in enumerate(A):
    Ans[a-1] = str(i+1)

print(' '.join(Ans))
# Judge status: Accepted
h=int(input())
w=int(input())
n=int(input())
if h<w:
	w,h=h,w
from math import ceil
print(ceil(n/h))
# Judge status: Wrong Answer
A, B = map(int, input().split())
print(A, B)
# Judge status: Wrong Answer
N = input()
N = int(N)
A = input().split()

M = 10 ** 18
Y = 1
for i in range(N):
    X = A[i]
    X = int(X)
    Y = Y * X
    if Y > M:
        break

if Y > M:
    print(-1)
else:
    print(Y)
# Judge status: Wrong Answer
n=int(input())
ans=10**12
a=1
while n**0.5>a:
  if a*(n//a)==n:
    ans=min(ans,a+n//a-2)
  a+=1
print(ans)
# Judge status: Accepted


n = int(input())

A = sorted([int(x) for x in input().split()])

a = (A[0] + A[1]) / 2

for q in A[2:]:
    a = (a + q) / 2

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

MOD = 1000000007

if abs(N - M) > 1:
    print(0)
    exit(0)

dogs = 1
for i in range(1, N + 1):
    dogs *= i
    dogs %= MOD

monks = 1
for i in range(1, M + 1):
    monks *= i
    monks %= MOD

res = (dogs * monks) % MOD
if (N + M) % 2 == 0:
    res *= 2
    res %= MOD

print(res)
# Judge status: Wrong Answer
N, M = map(int, input().split())
AB = []
for i in range(N):
  tmp = list(map(int, input().split()))
  eff = [tmp[1]/tmp[0]]
  AB.append(eff+tmp)
AB.sort(reverse=True)
#print(AB)

left_data = M-1
i = 0
r = 0
while left_data > 0:
  if AB[i][1] <= left_data:
    r += AB[i][2]
    left_data -= 1
  else:
    i += 1
    if i == N:
      break
print(r)