Problem:


Score : 200 points

Problem Statement

There are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.

Takahashi says: "there are X animals in total in the garden, and they have Y legs in total." Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.

Constraints

1 \leq X \leq 100

1 \leq Y \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

If there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.

Sample Input 1

3 8

Sample Output 1

Yes

The statement "there are 3 animals in total in the garden, and they have 8 legs in total" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.

Sample Input 2

2 100

Sample Output 2

No

There is no combination of numbers of cranes and turtles in which this statement is correct.

Sample Input 3

1 2

Sample Output 3

Yes

We also consider the case in which there are only cranes or only turtles.



Sample input:
3 8


Sample output:
Yes

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
result = False
for turtles in range (0,X+1):
    for cranes in range (0,X+1):
        if turtles + cranes == X and turtles*4 + cranes*2 == Y :
            result = True
if result == True:
    print ("Yes")
else:
    print ("No")

Submission status: Accepted

Solution code:
x,y = map(int,input().split())

for i in range(x+1):
    if(i*2 + (x-i)*4) == y:
        print("Yes")
        exit(0)
print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
ans='No'
for a in range(x+1):
    j=x-a
    if 2*a+4*j==y:
        ans='Yes'
print(ans)

Submission status: Accepted

Solution code:
x, y = input().split()
crane = float(x)*2 - float(y)/2
turtle = float(x) - crane
if crane.is_integer() == True:
	if crane >= 0 and turtle >= 0:
		print('Yes')
	else:
		print('No')
else:
	print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

a = list(range(2*X, 4*X+2, 2))

if Y in a:
    print('Yes')

else:
    print('No')

Submission status: Accepted

Solution code:
X,Y = list(map(int,input().split()))

if(Y % 2 == 0):

    if(Y >= 2* X and Y <= 4 * X):
        print("Yes")
    else:
        print("No")

else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
for i in range(x + 1):
    if i * 2 + (x - i) * 4 == y:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
X,Y = map(int, input().split())
crane = 2
turtle = 4
for i in range(X+1):
    legs = crane*(X-i)+turtle*i
    if legs == Y:
        print("Yes")
        break
    if i==X and legs!=Y:
        print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

if y%2!=0 or y>4*x or y<2*x:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

if y % 2 !=0:
  print('No')
elif y>4*x:
  print('No')
elif y<2*x:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
import math
import sys
readline = sys.stdin.readline


def main():
    x, y = map(int, readline().rstrip().split())
    c = y - 2 * x
    a = c % 2 == 0 and c >= 0 and y - 4 * x <= 0
    print('YNeos'[not(a)::2])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b = input().split()
a = int(a)
b = int(b)

conditions = [b%2==0, b>=a*2, b<=a*4]

if all (conditions):
    print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

for a in range(x + 1):
    b = x - a
    if (2 * a + 4 * b) == y:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
ans = "No"
for i in range(x+1):
    if i*2 + (x-i)*4 == y:
        ans ="Yes"
print(ans)

Submission status: Accepted

Solution code:
import sys
x, y = map(int, input().split())

ans = "Yes" if y % 2 == 0 and 4 * x >= y >= 2 * x else "No"
print(ans)

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
if m%2==1 or m>4*n:
  print("No")
elif m:
  for i in range(n+1):
    if m==4*(n-i):
      print("Yes")
      exit()
    m-=2
  print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
tr,km,flag=0,0,0

for i in range(x+1):
  z=x-i
  if i*2+z*4==y:
    flag=1
if flag==1:
  print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
x,y = map(int, input().split())
if y % 2 == 1:
    print("No")
elif 2 * x <= y <= 4 * x:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    x, y = map(int, input().split())
    for i in range(x+1):
        j = x - i
        if i * 2 + j * 4 == y:
            print("Yes")
            return

    print("No")


main()

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
ans=0
for i in range(x+1):
    if y==i*2+(x-i)*4:
        ans+=1
        break
if ans==1: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if y%2==0 and y-2*x>=0 and 4*x-y >=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())  
 
if (y%2==0) and (2*x<=y<=4*x) :
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
T = list(map(int, input().split()))
X = T[0]
Y = T[1]

cnt = 0

for i in range(X+1):
  TT = 2*i+4*(X-i)
  if TT == Y:
    cnt += 1
  else:
    pass

if cnt >0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
x, y=input().split()
X=int(x)
Y=int(y)
Z=Y-2*X
t=Z//2
if Z%2==0 and Z>=0 and X-t>=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
 
if Y%2==0 and Y-2*X>=0 and 4*X-Y>=0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
X,Y =map(int,input().split())

if (Y % 2 == 0) and (4*X >= Y >=2*X):
    print('Yes')

else:
    print('No')

Submission status: Accepted

Solution code:
import sys
X,Y = map(int,input().split())


for i in range(X+1):
    if 2*i + 4*(X-i) == Y:
        print('Yes')
        sys.exit()
print('No')

Submission status: Accepted

Solution code:
XY = input().split(" ")

X = int(XY[0])
Y = int(XY[1])
ans = "No"
for i in range(X + 1):
    crane = 2 * (X - i)
    turtle = 4 * i
    if crane + turtle == Y:
        ans = "Yes"
        break
    
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
a = X * 4

for i in range(X):
    if  Y == a:
        print("Yes")
        break
    else:
        a = a - 2
        if Y == a:
            print("Yes")
            break
if Y != a:
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
flag = False
for i in range(X+1):
  t = 2*i
  k = 4*(X-i)
  if (t+k == Y):
    flag = True

if (flag):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
inputLine = input().split()

X = int(inputLine[0])
Y = int(inputLine[1])

no = "No"
yes = "Yes"

if Y%2 == 1 :
  print(no)
else :
  table = [i*2+(X-i)*4 for i in range(X+1)] 
  if Y in table :
    print(yes)
  else:
    print(no)

Submission status: Accepted

Solution code:
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

X, Y = LI()

for i in range(X + 1):
    if 2 * i + 4 * (X - i) == Y:
        print("Yes")
        sys.exit()

print("No")

Submission status: Accepted

Solution code:
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

X, Y = LI()

for i in range(X):
    if 2 * i + 4 * (X - i) == Y:
        print("Yes")
        sys.exit()
    elif 4 * i + 2 * (X - i) == Y:
        print("Yes")
        sys.exit()


print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ans = "No"
for i in range(x + 1):
    if i * 2 + (x - i) * 4 == y:
        ans = "Yes"
        break
print(ans)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

ans = False

for i in range(x+1):
    if 2*i + 4*(x-i) == y:
        ans = True

if ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

decision = False
for xx in range(100):
	for yy in range(100):
		if xx*2+yy*4 == y and xx+yy == x:
			decision = True

if decision:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
import sys
import numpy as np
from heapq import heappush, heappop 
from bisect import bisect_left as bi_l, bisect_right as bi_r
from collections import deque, Counter, defaultdict
from itertools import combinations, product
inf = float('inf')
MOD = 10**9+7
# MOD = 998244353


class ABC001():
  def A():
    h1, h2 = map(int, sys.stdin.read().split())
    print(h1-h2)

  def B(): pass
  def C(): pass 
  def D(): pass 


class ABC002():
  def A():
    x, y = map(int, sys.stdin.readline().split())
    print(max(x, y))

  def B():
    vowels = set('aeiou')
    s = sys.stdin.readline().rstrip() 
    t = ''
    for c in s:
      if c in vowels: continue 
      t += c 
    print(t)

  def C():
    *coords, = map(int, sys.stdin.readline().split())
    def triangle_area(x0, y0, x1, y1, x2, y2):
      x1 -= x0; x2 -= x0; y1 -= y0; y2 -= y0;
      return abs(x1*y2 - x2*y1) / 2
    print(triangle_area(*coords))

  def D():
    n, m = map(int, sys.stdin.readline().split())
    edges = set()
    for _ in range(m):
      x, y = map(int, sys.stdin.readline().split())
      x -= 1; y -= 1
      edges.add((x, y))
    cand = []
    for i in range(1, 1<<n):
      s = [j for j in range(n) if i>>j & 1]
      for x, y in combinations(s, 2):
        if (x, y) not in edges: break
      else:
        cand.append(len(s))
    print(max(cand))


class ABC003():
  def A():
    n = int(sys.stdin.readline().rstrip())
    print((n+1)*5000)

  def B():
    atcoder = set('atcoder')
    s, t = sys.stdin.read().split()
    for i in range(len(s)):
      if s[i] == t[i]: continue
      if s[i] == '@' and t[i] in atcoder: continue 
      if t[i] == '@' and s[i] in atcoder: continue
      print('You will lose')
      return 
    print('You can win')

  def C():
    n, k, *r = map(int, sys.stdin.read().split())
    res = 0
    for x in sorted(r)[-k:]:
      res = (res+x) / 2
    print(res)

  def D(): pass 


class ABC004():
  def A():
    print(int(sys.stdin.readline().rstrip())*2)

  def B():
    c = [sys.stdin.readline().rstrip() for _ in range(4)]
    for l in c[::-1]:
      print(l[::-1])

  def C():
    n = int(sys.stdin.readline().rstrip())
    n %= 30
    res = list(range(1, 7))
    for i in range(n):
      i %= 5
      res[i], res[i+1] = res[i+1], res[i]
    print(''.join(map(str, res)))

  def D(): pass 


class ABC005():
  def A():
    x, y = map(int, sys.stdin.readline().split())
    print(y//x)

  def B():
    n, *t = map(int, sys.stdin.read().split())
    print(min(t))

  def C():
    t = int(sys.stdin.readline().rstrip())
    n = int(sys.stdin.readline().rstrip())
    a = [int(x) for x in sys.stdin.readline().split()]
    m = int(sys.stdin.readline().rstrip())
    b = [int(x) for x in sys.stdin.readline().split()]
    i = 0
    for p in b:
      if i == n: print('no'); return 
      while p-a[i] > t:
        i += 1
        if i == n: print('no'); return 
      if a[i] > p: print('no'); return 
      i += 1
    print('yes')

  def D():
    n = int(sys.stdin.readline().rstrip())
    d = np.array([sys.stdin.readline().split() for _ in range(n)], np.int64)
    s = d.cumsum(axis=0).cumsum(axis=1)
    s = np.pad(s, 1)
    max_del = np.zeros((n+1, n+1), dtype=np.int64)
    for y in range(1, n+1):
      for x in range(1, n+1):
        max_del[y, x] = np.amax(s[y:n+1, x:n+1] - s[0:n-y+1, x:n+1] - s[y:n+1, 0:n-x+1] + s[0:n-y+1, 0:n-x+1])
    res = np.arange(n**2+1)[:, None]
    i = np.arange(1, n+1)
    res = max_del[i, np.minimum(res//i, n)].max(axis=1)
    q = int(sys.stdin.readline().rstrip())
    p = np.array(sys.stdin.read().split(), dtype=np.int64)
    print(*res[p], sep='\n')


class ABC006():
  def A():
    n = sys.stdin.readline().rstrip()
    if '3' in n: print('YES')
    elif int(n)%3 == 0: print('YES')
    else: print('NO')

  def B():
    mod = 10007
    t = [0, 0, 1]
    for _ in range(1001001):
      t.append(t[-1]+t[-2]+t[-3]); t[-1] %= mod
    n = int(sys.stdin.readline().rstrip())
    print(t[n-1])
    
  def C():
    n, m = map(int, sys.stdin.readline().split())
    cnt = [0, 0, 0]
    if m == 1: cnt = [-1, -1, -1]
    else:
      if m & 1: m -= 3; cnt[1] += 1; n -= 1
      cnt[2] = m//2 - n 
      cnt[0] = n - cnt[2]
    if cnt[0]<0 or cnt[1]<0 or cnt[2]<0: print(-1, -1, -1)
    else: print(*cnt, sep=' ')
      
  def D():
    n, *c = map(int, sys.stdin.read().split())
    inf = float('inf')
    lis = [inf]*n 
    for x in c: lis[bi_l(lis, x)] = x 
    print(n - bi_l(lis, inf))


class ABC007():
  def A():
    n = int(sys.stdin.readline().rstrip())
    print(n-1)

  def B():
    s = sys.stdin.readline().rstrip()
    if s == 'a': print(-1)
    else: print('a')

  def C():
    r, c = map(int, sys.stdin.readline().split())
    sy, sx = map(int, sys.stdin.readline().split())
    gy, gx = map(int, sys.stdin.readline().split())
    sy -= 1; sx -=1; gy -= 1; gx -= 1
    maze = [sys.stdin.readline().rstrip() for _ in range(r)]
    queue = deque([(sy, sx)])
    dist = np.full((r, c), np.inf); dist[sy, sx] = 0
    while queue:
      y, x = queue.popleft()
      for i, j in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
        i += y; j += x
        if maze[i][j] == '#' or dist[i, j] != np.inf: continue 
        dist[i, j] = dist[y, x] + 1
        queue.append((i, j))
    print(int(dist[gy, gx]))
  
  def D(): pass 


class ABC008():
  def A():
    s, t = map(int, sys.stdin.readline().split())
    print(t-s+1)

  def B():
    n, *s = sys.stdin.read().split()
    res = defaultdict(int)
    for name in s: res[name] += 1
    print(sorted(res.items(), key=lambda x: x[1])[-1][0])

  def C():
    n, *a = map(int, sys.stdin.read().split())
    a = np.array(a)
    c = n - np.count_nonzero(a[:, None]%a, axis=1)
    print(np.sum((c+1)//2/c))
  
  def D(): pass

class ABC009():
  def A():
    n = int(sys.stdin.readline().rstrip())
    print((n+1)//2)

  def B():
    n, *a = map(int, sys.stdin.read().split())
    print(sorted(set(a))[-2])
    
  def C():
    n, k = map(int, sys.stdin.readline().split())
    s = list(sys.stdin.readline().rstrip())
    cost = [1]*n
    r = k
    for i in range(n-1):
      q = []
      for j in range(i+1, n):
        if s[j] < s[i] and cost[i]+cost[j] <= r:
          heappush(q, (s[j], cost[i]+cost[j], -j))
      if not q: continue
      _, c, j = heappop(q); j = -j 
      s[i], s[j] = s[j], s[i]
      r -= c 
      cost[i] = cost[j] = 0
    print(''.join(s))
      
  def D(): pass 


class ABC010():
  def A():
    print(sys.stdin.readline().rstrip()+'pp')
  def B():
    n, *a = map(int, sys.stdin.read().split())
    tot = 0
    for x in a:
      c = 0 
      while x%2==0 or x%3==2:
        x -= 1
        c += 1
      tot += c
    print(tot)

  def C():
    sx, sy, gx, gy, t, v, n, *xy = map(int, sys.stdin.read().split())
    x, y = np.array(xy).reshape(-1, 2).T
    def dist(x1, y1, x2, y2):
      return np.sqrt((x2-x1)**2 + (y2-y1)**2)
    ans = 'YES' if (dist(sx, sy, x, y)+dist(x, y, gx, gy) <= v*t).any() else 'NO'
    print(ans)

  def D(): pass 

class ABC011():
  def A():
    n = int(sys.stdin.readline().rstrip())
    print(n%12+1)

  def B():
    s = sys.stdin.readline().rstrip() 
    print(s[0].upper()+s[1:].lower())

  def C():
    n, *ng = map(int, sys.stdin.read().split())
    ng = set(ng)
    if n in ng: print('NO')
    else:
      r = 100
      while n > 0:
        if r == 0: print('NO'); return
        for i in range(3, 0, -1):
          if (n-i) in ng: continue 
          n -= i
          r -= 1
          break 
        else: print('NO'); return 
      print('YES')

  def D(): pass 


class ABC170():
  def A():
    x = [int(x) for x in sys.stdin.readline().split()]
    for i in range(5):
      if x[i] != i+1:
        print(i+1)
        break
  def B():
    x, y = map(int, sys.stdin.readline().split())
    print('Yes' if 2*x <= y <= 4*x and y%2 == 0 else 'No')
      
  def C(): pass 
  def D(): pass 
  def E(): pass 
  def F(): pass 

if __name__ == '__main__':
  ABC170.B()

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if x * 2 > y:
    flag = False
elif x * 4 < y:
    flag = False
elif (y - x * 2) % 2 == 0:
    flag = True
else:
    flag = False

print('Yes' if flag == True else 'No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

ymax = 4 * x
ymin = 2 * x

if y >= ymin and y <= ymax and y % 2 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if y // 2 * 2 == y and y >= 2 * x and 4 * x >= y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

for a in range(X+1):
    b = X - a
    if a*2 + b*4 == Y:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
def solution():
    user_input = input()
    animals, legs = [int(x) for x in user_input.split()]

    if 4*animals < legs:
        print("No")
        return
    
    if 2*animals > legs:
        print("No")
        return

    turtles = animals 
    cranes = 0 

    while cranes <= animals:
        if 4*turtles + 2*cranes == legs:
            print("Yes")
            return
        
        turtles -= 1
        cranes += 1

    print("No")
        
        
        
solution()

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
#2a+4b = y
#x = a+b
#x-a = b
#2a+4(x-a) = y
#y = 4x-2a

for i in range(x+1):
  if y == 4*x - 2*i:
    print('Yes')
    break
else:
  print('No')

Submission status: Accepted

Solution code:
x,y = map(int,input().split())

ans = "No"
for i in range(x+1):
    c = i * 2 + (x-i) * 4
    if c == y:
        ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
def b170(x, y):

    for i in range(x+1):
        if 4*i + 2*(x-i) == y:
            return "Yes"

    return "No"

def main():
    x, y = map(int, input().split())
    print(b170(x, y))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ret = 'No'
for i in range(x+1):
    rem = y - 2*i
    if 4*(x - i) == rem:
        ret = 'Yes'
        break
print(ret)

Submission status: Accepted

Solution code:
X,Y = list(map(int,input().split()))
if Y > (4 * X) or Y  < (2 * X):
    print("No")
else:
    if Y % 2 == 0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
#from pprint import pprint
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from copy import deepcopy
#from itertools
#from bisect import bisect_right #二分探索用のモジュール bisect_right(a_list,value)

#import sys 
#sys.setrecursionlimit(N) #N回まで再起を許可する。

# = map(int,input().split())

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

# = [list(map(int,input().split())) for _ in range(XXXX)]

x,y = map(int,input().split())


if x*2 <= y <= x*4 and y % 2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int,input().split())

for i in range(0,x+1):
    if i*2+(x-i)*4 == y:
        print('Yes')
        break
    elif i == x:
        print('No')

Submission status: Accepted

Solution code:
animal_sum, animal_leg_sum = map(int, input().split())

turtle_num = (animal_leg_sum - 2 * animal_sum) / 2

if 0 <= turtle_num <= animal_sum and int(turtle_num) == turtle_num:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
X,Y = map(int, input().split())
min_leg = X * 2
max_leg = X * 4
if Y < min_leg or Y > max_leg:
  ans = False
elif Y == min_leg or Y == max_leg:
  ans = True
elif Y % 2 != 0:
  ans = False
else:
  ans = True
  
if ans == True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

if ((y - 2 * x)/2) >= 0 and int((y - 2 * x)/2) == ((y - 2 * x)/2) and (4 * x - y)/2 >= 0 and int((4 * x - y)/2) == (4 * x - y)/2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())


if(X*4 < Y):
  print("No")
  exit()
if(X*2 > Y):
  print("No")
  exit()
  
if((Y-2*X)%2 == 0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
for crane in range(X+1):
    turtle = X - crane
    if crane*2 + turtle*4 == Y:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split(' '))

if Y % 2 == 0 and X * 2 <= Y <= X * 4:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
tsuru = x * 2
diff = y - tsuru

if (diff % 2 == 0) and (diff >= 0):
    if x - (diff / 2) >= 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())

if any([i*2+(x-i)*4==y for i in range(x+1)]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y=map(int, input().split())

flag=0
for a in range(101):
    b=X-a
    if 2*a+4*b==Y and b>=0:
        print("Yes")
        flag=1
        break
    
if flag==0:
    print("No")

Submission status: Accepted

Solution code:
x, y = [int(x) for x in input().split()]
for i in range(222):
  for j in range(222):
    if i + j == x and 4 * i + 2 * j == y:
      print("Yes")
      exit(0)
print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

for i in range(51):
    for j in range(26):
        if i + j == x and 2 * i + 4 * j == y:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
 
for i in range(x+1):
  if 2 * i + 4 * (x - i) == y:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
count = 0
for i in range(x+1):
    for j in range(y+1):
        if i+j == x and 2*i+4*j == y:
            count += 1
        else:
            pass
print(['No','Yes'][count != 0])

Submission status: Accepted

Solution code:
x, y =list(map(int, input().split()))
ans_list = []
for i in range(x+1):
    ans_list.append(2*i+4*(x-i))
if y in ans_list:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def line_to_int(): return int(sys.stdin.readline())
def line_to_each_int(): return map(int, sys.stdin.readline().split())
def line_to_list(): return list(map(int, sys.stdin.readline().split()))
def line_to_list_in_iteration(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
# def dp(init, i, j): return [[init]*i for i2 in range(j)]
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
# from itertools import accumulate #A = [0]+list(accumulate(A))
# import bisect #bisect.bisect_left(B, a), bisect.bisect_right(B,a)

x, y = line_to_each_int()
a = 4*x - y
b = y - 2*x
if a >= 0 and b >= 0 and a % 2 == 0 and b % 2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
x,y = map(int,input().split())

#2a+4b =y
#a+b =x
#b=x-a
#y =2a+4(x-a)=4x-2a

for i in range(x+1):
    if y == 4*x-2*i:
        print("Yes")
        sys.exit()
else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if x * 2 <= y <= x * 4 and y % 2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

for i in range(a+1):
  if i*2 + (a-i)*4 == b:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

minmum_legs = 2*X
maximum_legs = 4*X

if (Y%2 == 0 and minmum_legs<=Y<=maximum_legs):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
count = 0
for a in range(x+1):
  if 2*a + 4*(x-a) == y:
    count += 1
    break
  else:
    count += 0
    
if count == 0 :
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
count = 0

for num in range(x + 1):
   if  num * 4 + (x - num) * 2 == y:
       count += 1

print("Yes" if count > 0 else "No")

Submission status: Accepted

Solution code:
X,Y = [int(x) for x in input().split()]

flag = 0

for x in range(X+1):
    if x*2 + (X-x)*4 == Y:
        print("Yes")
        flag = 1
        break

if flag == 0:
    print("No")

Submission status: Accepted

Solution code:
x, y = list(map(int,input().split()))
print('Yes' if x*2<=y<=x*4 and y%2==0 else 'No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

for i in range(X+1):
    if i*2+(X-i)*4 == Y:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
def solve(a,b):
	for i in range(1,a+1):
		x = i 
		y = a-i
		if (x*2 + y*4 == b) or (x*4 + y*2 == b):
			return True
	return False 
a,b = map(int,input().split())
if solve(a,b):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())

for i in range(0, X+1):
    if 2 * i + 4 * (X - i) == Y:
        print('Yes')
        exit(0)

print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

if 2*x <= y <= 4*x and (4*x-y)%2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x,y = list(map(int,input().split()))

if ((4 * x) - y) % 2 == 0 and y >= 2 * x and  y <= 4 * x:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = "No"
for i in range(2*X, 4*X+2, 2):
  if i == Y:
    ans = "Yes"
    break
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
a=(4*X-Y)/2
b=(Y-2*X)/2
if (a>=0 and a%1==0) and (b>=0 and b%1==0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
a=(4*X-Y)/2
if X<=Y and a.is_integer() and a>=0 and a<=50:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
X, Y = list(map(int, input().split()))

if 2*X<=Y<=4*X and Y%2==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if Y%2==0 and 2*X <= Y and Y <= 4*X:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
x,y = map(int,input().split())
for i in range(0,x+1):
  if 2*i + 4*(x-i) == y:
    print("Yes")
    sys.exit()
print("No")

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
list = []
for y in range(a+1):
  list += [y*4 + (a-y)*2]
  
if b in list:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
#p + q = x
#2p + 4q = y
#2(x-q)+4q = y
#2x+2q = y
#q = 2x-y/2
p = (4*x-y)/2
q = (y-2*x)/2
print('Yes' if p >= 0 and q >= 0 and p.is_integer() == True and q.is_integer() == True else 'No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

for i in range(0, x+1):
    if i * 2 + (x - i) * 4 == y:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split()) 
ans = 'No'
for a in range(X + 1):
	b=X-a
	if 2 * a + 4 * b == Y:
		ans = 'Yes' 
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if (Y - 2 * X) % 2 == 1 or (4 * X - Y) % 2 == 1 or (Y - 2 * X) < 0 or (4 * X - Y) < 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
c = x * 2
for _ in range(x+1):
  if c == y:
    print("Yes")
    quit()
  elif c > y:
    print("No")
    quit()
  c += 2
print("No")

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
for i in range(X+1):
  kame = X-i
  sum_leg = kame*4+i*2
  if sum_leg == Y: 
    print('Yes')
    exit()
    
print('No')

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
for i in range(x+1):
    if 2*i + 4*(x-i) ==y:
        print("Yes")
        exit()
else:print("No")

Submission status: Accepted

Solution code:
x,y = map(int, input().split())

for ts in range(x+1):
  tur = x - ts
  if ts * 2 + tur * 4 == y:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
res = 0
for i in range(x+1):
	if i*2+(x-i)*4 == y:
		res += 1
		break
if res:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
a=Y-2*X
b=4*X-Y
if a%2==0 and b%2==0 and a>=0 and b>=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
def main():
  x, y = list(map(int,input().split()))
  for t in range(0,101):
    if y == (t*2+(x-t)*4) and (x-t)>=0:
#      print(t,(x-t),y)
      ans =('Yes')
      break
    else:
      ans =('No')
  print(ans)     
  
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

X,Y = MI()

ans = "No"
for i in range(X+1):
    j = X - i

    if j*4 + i*2 == Y:
        ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
x,y = map(int,input().split())
a = y-2*x
b = 4*x-y
if a%2==0 and b%2==0 and a>=0 and b>=0:
    print("Yes")
else:
    print("No")