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:
import sys

X = list(map(int, input().split()))
def no_print():
  print('No')
  sys.exit()
 
def number_check():
  turtle = X[0]
  crane = 0
  i = 0
  while i < X[0]:
    result = turtle * 4 + crane * 2 
    if result > X[1]:
      crane += 1
      turtle -= 1
    if result == X[1]:
      print('Yes')
      break
    if result < X[1]:
      turtle += 1
      crane -= 1
    i += 1

if X[0] > 100 or X[1] > 100:
  no_print()
if X[1] > X[0]*4 or X[1] < X[0]*2:
  no_print()
if X[1] % 2 == 1:
  no_print()
number_check()

Submission status: Wrong Answer

Solution code:
X = list(map(int, input().split()))
def no_print():
  print('No')
  exit
 
def number_check():
  turtle = X[0]
  crane = 0
  i = 0
  while i < X[0]:
    result = turtle * 4 + crane * 2 
    if result > X[1]:
      crane += 1
      turtle -= 1
    if result == X[1]:
      print('Yes')
      break
    if result < X[1]:
      turtle += 1
      crane -= 1
    i += 1

if X[0] > 100 or X[1] > 100:
  no_print()
if X[1] > X[0]*4 or X[1] < X[0]*2:
  no_print()
if X[1] % 2 == 1:
  no_print()
number_check()

Submission status: Wrong Answer

Solution code:
import sys
X,Y=map(int,input().split())
for i in range(X+1):
  if Y==2*i+4*(X-i):
    print("YES")
    sys.exit()
print("NO")

Submission status: Wrong Answer

Solution code:
import sys
X,Y=map(int,input().split())
for i in range(X+1):
  if Y==2*i+4*(X-i):
    print('YES')
    sys.exit()
print('NO')

Submission status: Wrong Answer

Solution code:
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	if len(res)==0:
		res = [n]
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	data = [2]
	#data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	ans = [x for x in data if x!=0]
	#ans = data[:]
	return ans

x,y = readInts()

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

Submission status: Wrong Answer

Solution code:
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	if len(res)==0:
		res = [n]
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	data = [2]
	#data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	ans = [x for x in data if x!=0]
	#ans = data[:]
	return ans

x,y = readInts()

if y/2>=x and y/2<=x:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	if len(res)==0:
		res = [n]
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	data = [2]
	#data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	ans = [x for x in data if x!=0]
	#ans = data[:]
	return ans

x,y = readInts()

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

Submission status: Wrong Answer

Solution code:
def readInts():
 return list(map(int, input().split()))

def main():
  c = input()
  c = c.split(' ')
  x = int(c[0])
  y = int(c[1])
  sa = y - 2 * x
  if sa % 4 == 0:
    print('Yes')
  else:
    print('No')
  
  
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

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

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

if crain >= 0 and turtle >= 0:
    print ("Yes")
else:
    print ("No")

Submission status: Wrong Answer

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

for a in range(0,X) :
  Z = 2 * a + 4 * (X - a)
  print("yes" if Z == Y else "NO")

Submission status: Wrong Answer

Solution code:
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	if len(res)==0:
		res = [n]
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	data = [2]
	#data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	ans = [x for x in data if x!=0]
	#ans = data[:]
	return ans

x,y = readInts()

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

if turu>=0 and turu<=x:
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

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

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

if crain > 0 or turtle > 0:
    print ("Yes")
else:
    print ("No")

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
def s(X,Y):
    for i in range(0,X+1):
        for j in range(i+1,X+1):
            if (2*i+4*j)==Y or (2*j+4*i)==Y:
                return "Yes"
    return "No"
ans=(s(X,Y))
print(ans)

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
def s(X,Y):
    for i in range(0,X+1):
        for j in range(0,X+2):
            if (2*i+4*j)==Y or (2*j+4*i)==Y:
                return "Yes"
    return "No"
string_ans = s(X,Y);
print(string_ans)

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
def s(X,Y):
    for i in range(0,X+1):
        for j in range(i,X+2):
            if (2*i+4*j)==Y or (2*j+4*i)==Y:
                return "Yes"
    return "No"
string_ans = s(X,Y);
print(string_ans)

Submission status: Wrong Answer

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

if Y%2 == 1:
    print('No')
    exit()
else:
    if (Y-2*X)/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:
X,Y = map(int,input().split())
T = False
for i in range(1,X+1):
  p = X-i
  J= 2*i + 4*p
  if J ==Y:
    T = True
if T == True:
  print("Yes")
else: print("No")

Submission status: Wrong Answer

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

if Y%2 == 1:
    print('No')
    exit()
else:
    if 0 > (Y-2*X)/2 or  (Y-2*X)/2 < X:
        print('No')
    else:
        print('Yes')

Submission status: Wrong Answer

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

if Y%2 == 1:
    print('No')
    exit()
else:
    if 0 <= (Y-2*X)/2 < X:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y =map(int, input().split())
def B():
    for i in range(0,x):
        if 4*i+2*(x-i)-y==0:
            return 'Yes'
    return 'No'

print(B())

Submission status: Wrong Answer

Solution code:
import sys

X, Y = map(int, input().split())

for a in range(X+1):
    A = 2*a
    for b in range(X+1):
        B = 4*b
        
        if A + B == Y:
            print("Yes")
            sys.exit()

print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if Y%2 == 1 or X > Y:
    print('No')
    exit()
else:
    if (Y-2*X)/2 > X:
        print('No')
    else:
        print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

X,Y = map(int,input().split())

#print(X)
#print(Y)
#a+b=X
#2a+4b+Y
#2a+2b=2X
#a=(4X-Y)/2
#b=(Y-2X)/2

# if Y-2X=0; b=0; a=X; 2a=Y; print Yes
if (Y-2*X) == 0  :
  print("Yes")
  exit()

if (Y-2*X) < 0 or (4*X-Y) < 0  :
  print("No")
  exit()



b=int((Y-2*X)/2)
a=int(X-b)

# if a>=0 and b>=0 -> Yes, else -> No
if a >= 0 and b >=0 :
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,l=map(int,input().split())
s=0
if l<a or a==0:
	print("NO")
elif l/a==2 or l/a==4:
	print("YES")

else:
	f=a*4
	if f>l:
		for i in range(a):
			f=f-2
			if f==l:
				print("YES")
				break			
		else:
			print("NO")
	else:
		print("NO")

Submission status: Wrong Answer

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

if Y%2 == 1:
    print('No')
    exit()
else:
    if (Y-2*X)/2 > X:
        print('No')
    else:
        print('Yes')

Submission status: Wrong Answer

Solution code:
a,l=map(int,input().split())
s=0
if l/a==2 or l/a==4:
	print("YES")
elif l<a:
	print("NO")
else:
	f=a*4
	if f>l:
		for i in range(a):
			f=f-2
			if f==l:
				print("YES")
				break			
		else:
			print("NO")
	else:
		print("NO")

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
if y % 2 != 0:
    print('NO')
else:
    if x*2<=y<=x*4:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	X,Y = inputMap()

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


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
a,l=map(int,input().split())
s=0
if l/a==2 or l/a==4:
	print("YES")
elif l<a:
	print("NO")
else:
	f=a*4
	if f>l:
		while f>l:
			f=f-2
		if f==l:
			print("YES")			
		else:
			print("NO")
	else:
		print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if(y<(x*4)):
  if(y<6):
    print('No')
  else:
    print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

X,Y = map(int,input().split())

#print(X)
#print(Y)
#a+b=X
#2a+4b+Y
#2a+2b=2X

# if Y-2X=0; b=0; a=X; 2a=Y; print Yes
if (Y-2*X) == 0  :
  print("Yes")
  exit()

b=int((Y-2*X)/2)
a=int(X-b)

# if a>=0 and b>=0 -> Yes, else -> No
if a >= 0 and b >=0 :
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if b%2!=0:
    print('No')
elif b<=a*4:
  print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

X,Y = map(int,input().split())

#print(X)
#print(Y)
#a+b=X
#2a+4b+Y
#2a+2b=2X

# if Y-2X=0; b=0; a=X; 2a=Y; print Yes
if (Y-2*X) == 0 :
  print("Yes")
  exit()

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

# if a>0 and b>0 -> Yes, else -> No
if a >= 0 and b>=0 :
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
def s(X,Y):
    for i in range(0,X+1):
        for j in range(i+1,X+2):
            if (2*i+4*j)==Y or (2*j+4*i)==Y:
                return "Yes"
    return "No"
ans=(s(X,Y))
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,l=map(int,input().split())
s=0
if l/a==2 or l/a==4:
	print("YES")
else:
	f=a*4
	if f>l:
		while f>l:
			f=f-2
		if f==l:
			print("YES")			
		else:
			print("NO")
	else:
		print("NO")

Submission status: Wrong Answer

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

if(Y%2 == 1 or Y > 4*X):
    ans = 0
elif(Y<4*X and Y%2 == 0 and 2*X <= Y):
    ans = 1
    
if(ans == 0):
    print('No')
elif(ans == 1):
    print('Yes')

Submission status: Wrong Answer

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

if(Y%2 == 1 or Y > 4*X):
    ans = 0
elif(Y<4*X and Y%2 == 0 and 2*100 <= Y):
    ans = 1
    
if(ans == 0):
    print('No')
elif(ans == 1):
    print('Yes')

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
def s(X,Y):
    for i in range(0,X+1):
        for j in range(i+1,X+2):
            if (2*i+4*j)==Y or (2*j+4*i)==Y:
                return "Yes"
    return "No"
string_ans = (s(X,Y))
print(string_ans)

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
for c in range(26):
    t_leg = Y - 2 * c
    if t_leg >= 0 and (X - c) * 4 == t_leg:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    x, y = mi()
    print('Yes') if x * 2 <= y <= x * 4 else print('No')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = [int(i) for i in input().split()]
print('Yes' if 2 * X <= Y <= 4 * X else 'No')

Submission status: Wrong Answer

Solution code:
X,Y = map(int, input().split())
ans = 0
i = 0
a1 = Y//4-X
a2 = Y//2-X

if(Y%2 == 1 or Y > 4*X):
    ans = 0
elif(Y<4*X and Y%2 == 0):
    ans = 1
    
if(ans == 0):
    print('No')
elif(ans == 1):
    print('Yes')

Submission status: Wrong Answer

Solution code:
a = input().split()
b = int(a[0])
add = []
lis = []
c = int(a[1])  
 
while b > 0:
  add.append(b * 4)
  b -= 1

b = int(a[0])
while b > 0:
  lis.append(b * 2)
  b -= 1

d = max(add)
e = min(lis)

if  d >= c and e <= c:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

no_flag = -1

if y - (4 * x) == 0:
    print("Yes")
elif y - (2 * x) == 0:
    print("Yes")
else:
    for cnt in range(x):
        if y >= 4 and y - (2 * (x-(cnt))) != 0:
            y -= 4
        elif y >= 2:
            y -= 2

        if y == 0 and cnt == x-1:
            no_flag = 0
        else:
            no_flag = 1

    if no_flag == 0:
        print("Yes")
    elif no_flag == 1:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
for c in range(26):
    t_leg = Y - 2 * c
    if t_leg % 4 == 0 and (t_leg // 4) + c == X:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = b//4
if c>a:
    print("No")
    exit()
elif a ==b//2:
    print("Yes")
    exit()
for i in range(0, a+1):
    for j in range(0, a+1):
        if i*2 + j*4 ==b:
            print("Yes")
            exit()
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

x, y = NextInts()

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

Submission status: Wrong Answer

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

no_flag = 0

if y - (4 * x) == 0:
    print("Yes")
elif y - (2 * x) == 0:
    print("Yes")
else:
    for cnt in range(x):
        if y >= 4 and y - (2 * (x-(cnt))) != 0:
            y -= 4
        elif y >= 2:
            y -= 2

        if y == 0 and cnt == x:
            no_flag = 0
        else:
            no_flag = 1

    if no_flag == 0:
        print("Yes")
    elif no_flag == 1:
        print("No")

Submission status: Wrong Answer

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