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: Wrong Answer

Solution code:

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

if x * 2 == y or x * 4 == y:
    print ('Yes')
elif (x / 2 * 2 + x / 2 * 4) == y:
    print ('Yes')
else:

    c = x
    v = y

    while x > 0:
        if y - 4 != 0:
            y -= 2
            x-= 1
        else:
            y -= 4
            x -=1


    if x == y == 0:
        print ('Yes')


    else:
        while c > 0:
            if v - 2 != 0:
                v -= 4
                c-= 1
            else:
                v -= 2
                c -=1

        if c == v == 0:
            print('Yes')
        else:
            print ('No')

Submission status: Wrong Answer

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

c = 0

while x >= 0:
    if c * 2 + x * 4 == y:
        break 
    c += 1
    x -= 1
else:
    print("No")

print("Yes")

Submission status: Wrong Answer

Solution code:
def main():
    X, Y = map(int, input().split())
    
    sets_2 = {i * 2 for i, _ in enumerate(range(3), start=1)}
    sets_4 = {i * 4 for i, _ in enumerate(range(3), start=1)}
    
    result = map(lambda x: x - Y, sets_2 | sets_4)

    print('YES' if any(x==0 for x in result) else 'NO')

main()

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())
for i in range(1, N+1):
    # 足の数
    f = 2 * i + 4 * (N - i)
    if f == M:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

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

crane = (4 * X - Y) / 2
turtle = (Y - 2 * X) / 2


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


if is_integer_num(crane) and crane > 0 and turtle > 0:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

k = y/2-x
p = -y/2+2*x

if k > -1 and p > -1 and k*4+2*p == y: print("Yes")
else: print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

ans = "No"
flag = False
x , y = map(int, read().split())

for i in range(x+1):
  for j in range(x+1):
    tmp = i*4 + j*2
    print(tmp,i,j)
    if tmp is y:
      flag = True
      ans = "Yes"
      break
    elif tmp > y:
      break
  if flag is True:
    break


print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    sum, leg = map(int, input().split())
    
    if leg / sum == 2:
        print('Yes')
        return
    elif leg / sum == 4:
        print('Yes')
        return

    for i in range(sum):
        for x in range(sum - i):
            crane = i * 2
            turtle = x * 4
            total = crane + turtle
            if total == leg:
                print('Yes')
                return
    print('No')
    
main()

Submission status: Wrong Answer

Solution code:
import numpy as np
X, Y = map(int,input().split())

a = np.matrix([[1,1],[2,4]])
b = np.matrix([[X],[Y]])

x,y = np.linalg.solve(a, b)
if x > 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if X*4 < Y or X*2 > Y or Y % 2 != 0:
  print('no')
  exit()

min=X*2
max=X*4
if min <= Y and Y <= max:
  if isinstance(Y/2-X,int):
    if Y/2-X < X:
      print('yes')
      exit()
print('no')

Submission status: Wrong Answer

Solution code:
from numpy.linalg import solve

X, Y = map(int, input().split())
 
left = [[1, 1],
        [2, 4]]
 
right = [X, Y]
 
if int(solve(left, right)[0]) <= 0 and int(solve(left, right)[1]) <= 0:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
c = 4*X - Y
if(c>=0 and c%2==0):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict

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

Submission status: Wrong Answer

Solution code:
def checkIfCorrect(x, y):
    if x < 0:
        return False
    if y < 0:
        return False
    if y == 0:
        if x == 0:
            return True
        else:
            return False
    return (checkIfCorrect(x-1, y-2) or checkIfCorrect(x-1, y-4))


x, y = map(int, input().split())
if y % 2 != 0:
    print("NO")
else:
    ans = checkIfCorrect(x, y)
    if(ans):
        print("YES")
    else:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input().split()
b = int(a[0])
c = int(a[1])

X = 2
Y = 4
for i in range(b):
    if b == 1 and c == 2:
        print('Yes')
        break
    elif b == 1 and c == 4:
        print('Yes')
        break
    d = b-i
    if X*i + Y*d == c:
        print('Yes')
        break
    elif i == b-1:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = 1/2*(i[1]-2*i[0])
print(x)
if x < i[0] & isinstance(x, int):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
z=[]
a=[]
b=[]
x, y= map(int,input().split())
for i in range(x):
    a.append(i)


for i in a:
    b.append(i+1)

print(b)
    

for i in b:
    if (2*(i+1))+(4*(x-i+1))==y:
        z.append('1')
    if (4*i)+(2*(x-i))==y:
        z.append('1')
        

        
if len(z)>0:
    print('YES')

if len(z)<=0:
    print('NO')

Submission status: Wrong Answer

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

if Y > 2 * X and Y > 4 * X:
    print("No")
else:
    if Y % 2 == 0 or Y % 4 == 0:
        print("Yes")
    if X == 1:
        if Y == 2 or Y == 4 :
            print("Yes")

Submission status: Wrong Answer

Solution code:
c = input()
c = c.split(' ')
x = int(c[0])
y = int(c[1])
sa = 4 * x -y
sa /=2
sb = x - sa
all = sa * 2 + sb * 4
if all == y and sa >=0 and sb >= 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

array = []
for i in range(X):
    legs = (2*(i+1))+(4*(X-(i+1)))
    array.append(legs)

for j in range(0, len(array)):
    if Y not in array:
        print('No')
    else:
        print('Yes')
        break

Submission status: Wrong Answer

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

if x == 1:
    if y == 2 or y == 4:
        print('Yes')
        exit()
    else:
        print('No')
        exit()
    
if y > 4*x:
    print('No')
    exit()
elif y//4 == x:
    print('Yes')
    exit()

for i in range(x):
    if (y-i*2)%((x-i)*4):
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,X+1):
    foot = 2*i+4*(X-i)
    if foot==Y:
        print('Yes')
        break
    elif X==1 and Y==4:
        print('Yes')
        break
    elif X==3 and Y==12:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

Solution code:
l=list(map(int,input().split()))
n=l[0]
legs=l[1]
if(l[1]%2!=0):
    print("No")
if(l[1]%2==0 and l[0]*4>=l[1] and l[0]*2<=l[1]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def crane_and_turtle():
    input_value = [int(i) for i in input().split()]
    animals = input_value[0]
    legs = input_value[1]

    turtle = (legs - (2 * animals)) / 2
    crane = animals - turtle

    if animals >= legs:
        print("No")
    else:     
        if crane >= 0:
            print("Yes")
        elif crane < 0:
            print("No")
        
    

crane_and_turtle()

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
ans = False
if (a[1] / 6 * 2) == a[0]:
  ans = True
elif (a[1] / 2 ) == a[0]:
  ans = True
elif (a[1] / 4 ) == a[0]:
  ans = True
else:
  for i in range(a[0]):
    if ((a[1] - i * 4) %2 == 0) and((a[1] - i * 4) //2 + i) == a[0]:
      ans = True
    elif((a[1] - i * 4) %4 == 0) and ((a[1] - i * 2) //4 + i) == a[0]:
      ans = True
if ans:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

if y % 2 == 1 or x * 4 < y:
    print("No")
    exit() 
asi = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

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

Submission status: Wrong Answer

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

if x == 1:
    if y == 2 or y == 4:
        print('Yes')
        exit()
    else:
        print('No')
        exit()
    
if y > 4*x:
    print('No')
    exit()
elif y//4 == x:
    print('Yes')
    exit()

for i in range(x):
    if (y-x*2)%((x-i)*4):
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

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

print("No")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
a=x
while(x!=0):
    x=x-1
    y=y-2
if(y%2==0):
    if(y//4<=a):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c = input()
c = c.split(' ')
x = int(c[0])
y = int(c[1])
sa = 4 * x -y
sa /=2
sb = x - sa
all = sa * 2 + sb * 4
print(all)
if all == y and sa >=0 and sb >= 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input(). split ())
if not a % 2 == 0 and not b % 2 == 0:
    print('No')
elif a > 100:
    print('No')
elif b > 100:
    print('No')
elif a < 1:
    print('No')
elif b < 1:
    print('No')
elif not isinstance(a, int):
    print('No')
elif not isinstance(b, int):
    print('No')
elif 2 * a <= b <= 4 * a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
z=[]
a=[]
b=[]
x, y= map(int,input().split())
for i in range(x):
    a.append(i)


for i in a:
    b.append(i+1)

print(b)
    

for i in a:
    if (2*(i+1))+(4*(x-i+1))==y:
        z.append('1')
    if (4*i)+(2*(x-i))==y:
        z.append('1')
        

        
if len(z)>0:
    print('YES')

if len(z)<=0:
    print('NO')

Submission status: Wrong Answer

Solution code:
def animal(x,y):
    if x==0 or y==0:
        return("No")
    if x==1 and y==2:
        return("Yes")
    if x==1 and y==4:
        return("Yes")
    for i in range(101):
        for j in range(101):
            if i*2+j*4==y and i+j==x:
                print(i, j)
                return("Yes")
    return("No")


x,y=map(int,input().split())
ans=animal(x,y)
print(ans)

Submission status: Wrong Answer

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

if X*4 < Y or X*2 > Y or Y % 2 != 0:
  print('no')
  exit()

min=X*2
max=X*4
if min <= Y and Y <= max:
  if Y/2-X < X:
    print('yes')
  exit()
print('no')

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
a = 0
b = 0
flag = True
while flag:
    for a in range(50):
        for b in range(25):
            if x - a == b and y - 2*a == 4*b and b != 0 and a != 0:
                flag = False
                break
            else:
                continue
    break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
n = (4*x-y)/2
m = (y-2*x)/2

if n <0 or m <0:
  print("No")
else:
  if n+m==x and 2*n+4*m==y:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

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

a = (Y-X*2)/(4-2)

if X-a >= 0:
    print("Yes")
    exit()

print("No")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
a=x
while(x!=0):
    x=x-1
    y=y-2
if(y%2==0):
    if(y<=a):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X,Y= map(int,input().split())
x = 2*X-Y//2
y = Y//2-X

if Y%2 ==1:
    print("No")
elif x>=0 and y>=0:
    print("Yes")
else:
    print("Yes")

Submission status: Wrong Answer

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

for i in range(1,X+1):
    foot = 2*i+4*(X-i)
    if foot==Y:
        print('Yes')
        break
    elif X==1 and Y==4:
        print('Yes')
        break
    elif X==2 and Y==8:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

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

if Y > 2 * X and Y > 4 * X:
    print("No")
else:
    if Y % 2 == 0 and Y % 4 == 0:
        print("Yes")
    if X == 1:
        if Y == 2 or Y == 4 :
            print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x == 1:
    if y == 2 or y == 4:
        print('Yes')
        exit()
    else:
        print('No')
        exit()
    
if y > 4*x:
    print('No')
    exit()
elif y%4 == x:
    print('Yes')
    exit()

for i in range(x):
    if (y-x*2)%((x-i)*4):
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
from numpy.linalg import solve

X, Y = map(int, input().split())
 
left = [[1, 1],
        [2, 4]]
 
right = [X, Y]
 
if int(solve(left, right)[0]) >= 0 and int(solve(left, right)[1]) >= 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict

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

for i in range(1, x+1):
    # 足の数
    f = 2 * i + 4 * (x - i)
    if f == y:
        print('Yes')
        sys.exit()
print('No')

Submission status: Wrong Answer

Solution code:
import os
import sys
from io import BytesIO, IOBase
import math


def inputIntArray():
    return list(map(int, input().rstrip().split()))


def inputArray():
    return input().rstrip().split()


def inputVars():
    return map(int, input().rstrip().split())


def inputNum():
    return int(input())


def main():
    totalAnimals, noOfLegs = inputVars()
    if noOfLegs > totalAnimals*4:
        print('No')
    else:
        temp = noOfLegs//4
        check1 = noOfLegs%4==0 and noOfLegs//4==totalAnimals
        check2 = noOfLegs//2 == totalAnimals
        if noOfLegs%2 == 0 and (noOfLegs > temp or check2 or check1):
            print('Yes')
        else:
            print('No')


#.........................................FAST INPUT OUTPUT.......................................
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

#....................................END OF FAST I/O............................................

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = 0
for i in list(range(0, 50)):
    for m in list(range(0, 25)):
        if i * 2 + m * 4 == y and i + m == x:
            a += 1
if 50 < x:
    a = 0
if a == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if y % 2 == 1:
    print("No")
    exit() 
asi = 0

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

Submission status: Wrong Answer

Solution code:
n = [int(i) for i in input().split()]
if n[0]*4 < n[1] or n[1]%2 == 1 or n[1] < n[0]:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict

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

for i in range(1, x+1):
    # 足の数
    f = 2 * i + 4 * (x - i)
    if f == y:
        print('Yes')
        sys.exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for x in range(A1):
  y = A2-2
  if y <=4:
    break

ans = A2-(A1-x)*4
if ans <=0:
  print("Yes")
elif ans == 4:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

print("No")

Submission status: Wrong Answer

Solution code:
x, y = [int(i) for i in input().split()]
print("Yes") if (((4*x)-y)/(2) >= 0 and (y-(2*x))/(2) >= 0) else print("No")

Submission status: Wrong Answer

Solution code:
X, Y = list(map(int, input().split()))
Sum = X+Y
if Sum%4 == 0:
    print("Yes")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
import sys
import bisect
INF=1e9
def get_int(): return int(stdin.readline().strip())
def get_ints(): return map(int,stdin.readline().strip().split()) 
def get_array(): return list(map(int,stdin.readline().strip().split()))
def get_string(): return stdin.readline().strip()
def op(c): return stdout.write(c)
#from collections import defaultdict 
#for _ in range(int(stdin.readline())):
x,y=get_ints()
if y%2==0:
    if y>=2*x and y<=4*x:
        print("YES")
    else:
        print("NO")
else:
    print('NO')

Submission status: Wrong Answer

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

turu_all = 2 * x
kame = (y - turu_all) / 2

turu = x - kame
if x == turu + kame:
    ans = "Yes"
    if turu < 0 or kame < 0 or type(kame) == float:
        ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict

x,y = map(int,input().split())
if x*4 < y:
    print('No')
    sys.exit()
elif y%2 == 1:
    print('No')
    sys.exit()

for i in range(1, x+1):
    # 足の数
    f = 2 * i + 4 * (x - i)
    if f == y:
        print('Yes')
        sys.exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
l=list(map(int,input().split()))
n=l[0]
legs=l[1]
if(l[1]%2!=0):
    print("No")
if(l[1]%2==0 and l[0]*4>=l[1]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

X = XY[0]
Y = XY[1]

A = np.array([
    [1,1],
    [2,4]
])

b = np.array([X,Y])

x = np.linalg.solve(A,b)

if x[0] >= 0 and x[1] >= 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
x, y = [int(x) for x in input().split()]
CRANE = 2
TURTLE = 4

if y % 2 != 0:
    print("No")
    sys.exit()


if y < (CRANE * x):
    print("No")
    sys.exit()

if y > (TURTLE * x):
    print("No")
    sys.exit()

print("YES")

Submission status: Wrong Answer

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

if x == 1 and (y == 2 or y == 4):
    print('Yes')
    quit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

crain=(4*X-Y)/2
if crain.is_integer() and crain>0:
    crain = int(crain)
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nb == 0 or (nl % 2 == 1) or nl == 0 or nl > nb:
    print('No')
    return
  for i in range(1, nb + 1):
    if ((nb - i) * 4 + i * 2) == nl:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
z =-2
for i in range(x):
    if i % 2 == 0:
        z +=4
    else:
        z +=2
if z == y or z == (y-2) or (z-2)==y:
        print("Yes")
elif z!=y :
        print("No")

Submission status: Wrong Answer

Solution code:
x,y = input().split(' ')
X = float(x)
Y = float(y)

b = Y * (-0.5) + 2 * X
t = Y * (0.5) - X

if(b >= 0 and t >= 0):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
if n%2!=0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

x = 1/2*(i[1]-2*i[0])

if x < i[0]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

if Y % 2 != 0:
    print('No')
elif Y/4 >= X:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

turtles = (Y - 2*X) / (4 - 2)
cranes = (4*X - Y) / (4 - 2)
check = int(turtles + cranes)

if X == check and 0 <= turtles and 0 <= cranes:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

turu = (4*x-y)//2
#print(turu)

if (turu < 0) or (2*x >= y):
    print("No")
    exit()

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
input = stdin.readline

X, Y = map(int,input().split())
t = 2*X - Y/2
k = Y/2 - X
if (k >= 0 and t >= 0 and k <= X and t <= X):
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

x,y=list(map(int,input().split()))
i=0; j=0;
for i in range(x):
  for j in range(x):
    if(2*i+4*j==y):
      print("Yes")
      sys.exit()
print("No")

Submission status: Wrong Answer

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

print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input(). split ())
if not a % 2 == 0 and not b % 2 == 0:
    print('No')
elif a > 100 or b > 100:
    print('No')
elif a < 1 or b < 1:
    print('No')
elif not isinstance(a, int) or not isinstance(b, int):
    print('No')
elif 2 * a <= b <= 4 * a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

c = b - 2*a
w=b-4*a
d = c / 2
r = w*2

if(a==(c+d)):
    print("Yes")

elif(a==(w+r)):
    print("Yes")

elif(c==0 or w==0):
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
import os
import sys
from io import BytesIO, IOBase
import math


def inputIntArray():
    return list(map(int, input().rstrip().split()))


def inputArray():
    return input().rstrip().split()


def inputVars():
    return map(int, input().rstrip().split())


def inputNum():
    return int(input())


def main():
    totalAnimals, noOfLegs = inputVars()
    if noOfLegs > totalAnimals*4:
        print('No')
    else:
        temp = noOfLegs//4
        check1 = noOfLegs%4==0 and noOfLegs//4==totalAnimals
        check2 = noOfLegs//2 == totalAnimals
        if noOfLegs%2 == 0 and (noOfLegs >= temp or check2 or check1):
            print('Yes')
        else:
            print('No')


#.........................................FAST INPUT OUTPUT.......................................
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

#....................................END OF FAST I/O............................................

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x,y = input().split(' ')
X = float(x)
Y = float(y)

b = Y * (-0.5) + 2 * X
t = Y * (0.5) - X

if(b >= 0 and t >= 0):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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