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 math
x,y=map(int,input().split())

q = (2*x-y)/2
print('Yes' if q == math.ceil(q) and q >= 0 else 'No')

Submission status: Wrong Answer

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

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

print('No')

Submission status: Wrong Answer

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

print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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):
      ans =('Yes')
      break
    else:
      ans =('No')
  print(ans)     
  
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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):
      ans =('Yes')
      sys.exit()
    else:
      ans =('No')
  print(ans)     
  
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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):
    j = X - i

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if (y/2 - x) > x or (y/2 - x) < 0:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

if (y/2 - x) > x:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

ans = 'No'
for i in range(x+1) :
  j = x-i
  if i*2+j*3 == y :
    ans = 'Yes'

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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







if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

z = 0
for a in range(X):
    if Y == 4 * a + 2 * (X - a):
        z += 1

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

Submission status: Wrong Answer

Solution code:
def function(ar):
    va=False
    if ar[0]>=ar[1]:
        print('No')
        va=True
    if va==False:
        i=0
        m1=ar[1]
        result=0
        l=[m1]
        while i<=10**5:
            if m1%4==0:
                m1/=4
            if m1==1.0:
                print('Yes')
                break
            if m1<1.0:
                print('No')
                break
            else:
                m1/=2
            i+=1
            print(m1)


if __name__ == '__main__':
    ar = list(map(int, input().rstrip().split()))
    function(ar)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def function(ar):
    i=0
    m1=ar[1]
    result=0
    l=[m1]
    while i<=10**5:
        if m1%4==0:
            m1/=4
        if m1==1.0:
            print('Yes')
            break
        if m1<1.0:
            print('No')
            break
        else:
            m1/=2
        i+=1


if __name__ == '__main__':
    ar = list(map(int, input().rstrip().split()))
    function(ar)

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
from time import time
read = stdin.readline
write = stdout.write
flush = stdout.flush
xr = xrange

def main():
	animals, legs = map(int,read().split())
	if (animals * 4 < legs) or (animals * 2 > legs) or (legs / 2 - animals > animals):
		print 'No'
	else:
		print 'Yes'

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
from time import time
read = stdin.readline
write = stdout.write
flush = stdout.flush
xr = xrange

def main():
	animals, legs = map(int,read().split())
	if (animals * 4 < legs) or (animals * 2 > legs) or (legs ^ 1):
		print 'No'
	else:
		print 'Yes'

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
from time import time
read = stdin.readline
write = stdout.write
flush = stdout.flush
xr = xrange

def main():
	animals, legs = map(int,read().split())
	if (animals * 4 < legs) or (animals * 2 > legs):
		print 'No'
	else:
		print 'Yes'

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if X*2 <= Y <= X*3:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

x,y=list(map(int,input().split()))
a = (y-2*x)/2
print('Yes' if a == int(a) and a<=x else 'No')

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())

amari = m - n*2
if amari%2 == 0 and amari <= n and amari >= 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())

amari = m - n*2
if amari%2 == 0 and amari <= n:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a):
    if (i*2) + ((a-i)*4) == b:
        c+=1
if c>0:
    print("Yes")
elif a==1 and ((b==2) or (b==4)):
    print("Yes")
elif b==0:
    print("No")
elif a>b:
    print("No")
elif a<=0 or b<=0:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a):
    if (i*2) + ((a-i)*4) == b:
        c+=1
if c>0:
    print("Yes")
elif a==1 and ((b==2) or (b==4)):
    print("Yes")
elif b==0:
    print("No")
elif a>b:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a):
    if (i*2) + (a-i)*4 == b:
        c+=1
if c>0:
    print("Yes")
elif a==1 and ((b==2) or (b==4)):
    print("Yes")
elif b==0:
    print("No")
elif a>b:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a):
    if (i*2) + (a-i)*4 == b:
        c+=1
if c>0:
    print("Yes")
elif a==1 and ((b==2) or (b==4)):
    print("Yes")
elif b==0:
    print("No")
elif a==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a):
    if (i*2) + (a-i)*4 == b:
        c+=1
if c>0:
    print("Yes")
elif a==1 and ((b==2) or (b==4)):
    print("Yes")
elif b==0:
    print("No")
elif a==0:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a):
    if (i*2) + (a-i)*4 == b:
        c+=1
if c>0:
    print("Yes")
elif a==1 and ((b==2) or (b==4)):
    print("Yes")
elif b==0:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a):
    if (i*2) + (a-i)*4 == b:
        c+=1
if c>0:
    print("Yes")
elif a==1 and ((b==2) or (b==4)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    na, nl = (int(i) for i in input().split())
    nc = (4*na - nl) / 2

    pos = nc == int(nc) and nc >= 0 and nc <= na

    if pos:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

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

pos = nc >= 0 and nc <= x

if pos:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

pos = (4*x - y) // 2 >= 0

if pos:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
k=[]
j=a+1
for i in range(a-1):
    k.append(2*j)
    j=j+1
if(b in k):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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')
        break
    else:
        if i==x-1:
            print('No')
        pass

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp = list(map(int,input().split()))
x=inp[0]
y=inp[1]
flag=1
if 4*x<y or (4*x-y)%2!=0:
  flag=0
  print ('No')
if (y<2*x  or (y-2*x)%2!=0 )and flag==1:
  flag=0
  print ('No')
else:
  print ('Yes')

Submission status: Wrong Answer

Solution code:
import sys

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = input().split()
a = (2 * int(x)) - (int(y)/2)
b = (int(y)/2) - int(x)

if (a + b == int(x)) and ((2*a) + (4*b) == int(y)) and a>=0 and b>=0:
    print("Yes") 
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x,y = input().split()
a = (2 * int(x)) - (int(y)/2)
b = (int(y)/2) - int(x)

if (a + b == int(x)) and ((2*a) + (4*b) == int(y)) and a>=0 and b>=0:
    print("yes") 
else:
    print("no")

Submission status: Wrong Answer

Solution code:
x,y = input().split()
a = (2 * int(x)) - (int(y)/2)
b = (int(y)/2) - int(x)

print(f"turu = {a}")
print(f"kame = {b}")
if (a + b == int(x)) and ((2*a) + (4*b) == int(y)) and a>=0 and b>=0:
    print("yes") 
else:
    print("no")

Submission status: Wrong Answer

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

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

print(state)

Submission status: Wrong Answer

Solution code:
import sys

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

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

Submission status: Wrong Answer

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

n = x * 4
m = n - y
z = m / 2

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
b = y / 2 - x
a = x - b
print("Yes" if a >= 0 and b >= 0 else "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-1))) != 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:
num_animals, num_legs = list(map(int, input().split()))

num_turtles = (num_legs / 2) - num_animals
num_cranes = num_animals - num_turtles

ans = 'Yes'

if num_turtles < 0 or num_animals < num_turtles:
    ans = 'No'

if num_cranes < 0 or num_animals < num_cranes:
    ans = 'No'

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
flg = 0
for i in range(1, X):
    j = X - i
    ans = i*2 + j * 4

    if Y == ans:
        print("Yes")
        flg = 1
        break

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

Submission status: Wrong Answer

Solution code:
L, R = map(int,input().split())
for a in range(L):
    L1=L-a
    if R==a*2+L1*4:
        han="Yes"
    else:
        han="No"
print(han)

Submission status: Wrong Answer

Solution code:
L, R = map(int,input().split())
for a in range(L):
    L1=L-a
    if R==L*2+L1*4:
        han="Yes"
    else:
        han="No"
print(han)

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split()) #input for x=animals, y=legs

c=2 #crane has 2 legs
t=4 #turtle has 4 legs

for i in range (x+1): #loop the number of animals

    a=x-i #the subtraction to get the number of turtle available for every loop starting from i=0

    if i*c +a*t==y: #the formula to get the amount of legs for both animals in a loop
        print ("yes") #if equals to y then there is a combination of both animals
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
#Take the value of X
#Take the value of Y
#Do double equation

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

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

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

total = int(T + C)

if (T<0) or (C<0):
    print("No")
elif (T%1 != 0) or (C%1 != 0):
    print("No")
elif (T+C) == X and (4*T + 2*C) == Y:
    print("Yes")
else:
    print("No")

print(T,C)

Submission status: Wrong Answer

Solution code:
x,y=input().split(" ") #get input for X and Y

if x*2==y: 
    print ("YES")
elif x*4==y:
    print ("YES")
else:
    print ("NO")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split()) #input for x=animals, y=legs

c=2 #crane has 2 legs
t=4 #turtle has 4 legs

for i in range (x+1): #loop the number of animals

    a=x-i #the subtraction to get the number of turtle available for every loop starting from i=0

    if (i*c) +(a*t)==y: #the formula to get the amount of legs for both animals in a loop
        print ("yes") #if equals to y then there is a combination of both animals
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split()) #input for x=animals, y=legs

c=2 #crane has 2 legs
t=4 #turtle has 4 legs

for i in range (x): #loop the number of animals

    a=x-i #the subtraction to get the number of turtle available for every loop starting from i=0

    if (i*c) +(t*a)==y: #the formula to get the amount of legs for both animals in a loop
        print ("yes") #if equals to y then there is a combination of both animals
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split()) #input for x=animals, y=legs

c=2 #crane has 2 legs
t=4 #turtle has 4 legs

for i in range (x+1): #loop the number of animals

    a=x-i #the subtraction to get the number of turtle available for every loop starting from i=0

    if (i*c) +(x*a)==y: #the formula to get the amount of legs for both animals in a loop
        print ("yes") #if equals to y then there is a combination of both animals
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split()) #input for x=animals, y=legs

c=2 #crane has 2 legs
t=4 #turtle has 4 legs

for i in range (x): #loop the number of animals

    a=x-i #the subtraction to get the number of turtle available for every loop starting from i=0

    if (i*c) +(x*a)==y: #the formula to get the amount of legs for both animals in a loop
        print ("yes") #if equals to y then there is a combination of both animals
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split()) #input for x=animals, y=legs

c=2 #crane has 2 legs
t=4 #turtle has 4 legs

for i in range (x+1): #loop the number of animals

    a=x-i #the subtraction to get the number of turtle available for every loop starting from i=0

    if (i*c) +(x*t)==y: #the formula to get the amount of legs for both animals in a loop
        print ("yes") #if equals to y then there is a combination of both animals
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split()) #input for x=animals, y=legs

c=2 #crane has 2 legs
t=4 #turtle has 4 legs

for i in range (x): #loop the number of animals

    a=x-i #the subtraction to get the number of turtle available for every loop starting from i=0

    if (i*c) +(x*t)==y: #the formula to get the amount of legs for both animals in a loop
        print ("yes") #if equals to y then there is a combination of both animals
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
#Take the value of X
#Take the value of Y
#Do double equation

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

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

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

total = int(T + C)

if (T<0) or (C<0):
    print("No")
elif (T%1 != 1) or (C%1 != 1):
    print("No")
elif (T+C) == X and (4*T + 2*C) == Y:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#Take the value of X
#Take the value of Y
#Do double equation

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

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

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

total = int(T + C)

if (T<0) or (C<0):
    print("No")
elif (T>X) or (C>Y):
    print("No")
elif (T+C) == X and (4*T + 2*C) == Y:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#Take the value of X
#Take the value of Y
#Do double equation

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

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

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

total = int(T + C)

if (T<0) or (C<0):
    print("No")
elif (T+C) == X and (4*T + 2*C) == Y:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if (a % 4 != 0) and (a % 2 != 0):
    print('Yes')
else: print('NO')

Submission status: Wrong Answer

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

if (a * 2 != b) and (a * 4 != b):
    print('Yes')
else: print('No')

Submission status: Wrong Answer

Solution code:
x,y=map(int,input('').split()) #Take input animal and leg

s1=y/4  #Divide with the highest number first (4 legs)
s2=s1/2 #Divide with the balance of legs
total=s1+s2 #sum the s1 and s2

k1=y%4 #Divide with highest number of legs (4legs )
k2=k1%2 #divide with the balance

if x>1 and x<100: #make sure input X is 1<X<100
    if y>0 and y<100: #make sure input Y is 1<Y<100
        if total==x: #If the total is same with the input x, it will proceed to the next becase the combination is true 
            if k2==0: #If the k2 is same with 0, its mean that the combination is true
                print('Yes') #print yes because it is true
            else:
                print('No') #print yes because it is false
        else:
            print('No') #print yes because it is false
    else:
        print('Wrong input') #tell the user that the input is wrong
else:
    print('Wrong input') #tell the user that the input is wrong

Submission status: Wrong Answer

Solution code:
a,b=input().split(" ")
c=0 #number of crane
t=0 #number of turtle
f=0
temp=0
if int(b)%2 == 0: #check even number of leg
    for i in range(int(a)):
        if (int(b)//2)<=int(a):#check number of animal proportion with leg [crane ]   
            temp = int(b)-2 #update number of leg available
            b=temp
            c=c+1
            
        elif (int(b)//4)<=int(a):#check number of animal proportion with leg  [ turtle]
            temp =int(b)-4#update number of leg available
            b=temp
            t=t+1
    f=c+t
    if f==int(a):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input('').split()) #Take input animal and leg

s1=y/4  #Divide with the highest number first (4 legs)
s2=s1/2 #Divide with the balance of legs
total=s1+s2 #sum the s1 and s2

k1=y%4 #Divide with highest number of legs (4legs )
k2=k1%2 #divide with the balance

if total==x: #If the total is same with the input x, it will proceed to the next becase the combination is true 
    if k2==0: #If the k2 is same with 0, its mean that the combination is true
        print('Yes') #print yes because it is true
    else:
        print('No') #print yes because it is false
else:
        print('No') #print yes because it is false

Submission status: Wrong Answer

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

Crane = 2
Turtle = 4


X=i[0]
Y=i[1]

C=0
T=0
noAnimal = 0

def Calculate (C,T,Crane,Turtle,X,Y):
    if X > 100:
        print ("No")
        return
    if Y > 100:
        print ("No")
        return
    
    for C in range(50):
                
        for T in range(25):
            Leg = (T*Turtle)+(C*Crane)
            if Leg > 100:
                print ("No")
                return

            if C+T > 100:
                print ("No")
                return
            
            if Leg == Y:
                print ("Yes")
                return


Calculate (C,T,Crane,Turtle,X,Y)

Submission status: Wrong Answer

Solution code:
#getting input from user
A,B=input().split(' ')

A=int(A)
B=int(B)

num=4*A

if B>num:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Crane = 2
Turtle = 4


X=i[0]
Y=i[1]

C=0
T=0
noAnimal = 0

def Calculate (C,T,Crane,Turtle,X,Y):
    if X > 100:
        return False
    if Y > 100:
        return False
    
    for C in range(50):
                
        for T in range(25):
            Leg = (T*Turtle)+(C*Crane)
            if Leg > 100:
                return False
            
            if Leg == Y:
                noAnimal = C+T
                return True

    return False
            
print (Calculate(C,T,Crane,Turtle,X,Y))

Submission status: Wrong Answer

Solution code:
A,B=input().split(' ')

A=int(A)
B=int(B)

num=4*A

if B>num:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
vals1,vals2 = input().split(' ') #ask input in one line

vals1 = int(vals1) #animals
vals2 = int(vals2) #actual legs

possible= vals1*4 #highest possible legs


if possible<vals2 : 
    print("No")

else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
vals1,vals2 = input().split(' ') #ask input in one line

vals1 = int(vals1) #animals
vals2 = int(vals2) #actual legs

possible= vals1*4 #highest possible legs


if possible<vals2 : 
    print("no")

else:
    print("yes")

Submission status: Wrong Answer

Solution code:
X, Y = input().split(' ')
#No of animal
X = int(X)
#No of legs
Y = int(Y)

Ani = 4*X

if Y > Ani:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
vals1,vals2 = input().split(" ") #ask input in one line

vals1 = int(vals1) #animals
vals2 = int(vals2) #actual legs

possible= vals1*4 #highest possible legs


if possible<vals2 : 
    print("no")

else:
    print("yes")

Submission status: Wrong Answer

Solution code:
vals1,vals2 = input().split(" ") #ask input in one line

a = int(vals1) #animals
b = int(vals2) #actual legs

possible= a*4 #highest possible legs


if possible<b : 
    print("no")

else:
    print("yes")

Submission status: Wrong Answer

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

Crane = 2
Turtle = 4


X=i[0]
Y=i[1]

C=0
T=0
noAnimal = 0

def Calculate (C,T,Crane,Turtle):
    for C in range(100):
                
        for T in range(100):
            Leg = (T*Turtle)+(C*Crane)
            if Leg > 100:
                return False
            
            if Leg == Y:
                noAnimal = C+T
                return True
    return False
            


print (Calculate(C,T,Crane,Turtle))

Submission status: Wrong Answer

Solution code:
a,b=input().split(' ') #asking 2 input in one line

a=int(a)
b=int(b)

num=4*a     #maximum number of legs

if b>num:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

x=int(x)
y=int(y)

num=4*x

if y>num:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

a=int(a)
b=int(b)

num=4*a

if b>num:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

crane = 2
turtle = 4
ans = 'No'

for i in range(x):
    for j in range(x+1):
        if crane*i+turtle*j == y and i+j == x:
            ans = 'Yes'
            print(ans)
            exit()
else:
    print(ans)

Submission status: Wrong Answer

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

crane = 2
turtle = 4
ans = 'No'

for i in range(x):
    for j in range(x+1):
        if crane*i+turtle*j == y and i+j == x:
            print('Yes')
            exit()
else:
    print(ans)

Submission status: Wrong Answer

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

x = (a-(2*b))/2
y = ((4*b)-a)/2

if x >= 0 and y >= 0:
    if float(x).is_integer() and float(y).is_integer():
            print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

x = (a-(2*b))/2
y = ((4*b)-a)/2

if x > 0 and y > 0:
    if float(x).is_integer() and float(y).is_integer():
            print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

x = (a-(2*b))/2
y = ((4*b)-a)/2

if float(x).is_integer() and float(y).is_integer():
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

cnt = 0 

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

if cnt == 0:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
if (b%2 != 0):
  print("No")
  exit()
max = 4*a
if (b <= max):
  for _ in range(a+1):
    if(max==b):
      print("Yes")
      exit()
    max-=2
  print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
if (b%2 != 0):
  print("No")
  exit()
max = 4*a
if (b <= max):
  for _ in range(a):
    if(max==b):
      print("Yes")
      exit()
    max-=2
  print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
if (b%2 != 0):
  print("No")
  exit()
max = 4*a
if (b < max):
  for _ in range(a):
    max-=2
    if(max==b):
      print("Yes")
      exit()
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = Y/2 - X
b = -Y/2 + 2*X

a = round(a)
b = round(b)

flag = False
if(a >= 0 and b >=0):
    if(a + b == X and 4*a + 2*b == Y):
        flag = True

if flag:
    print('yes')
else:
    print('No')