Problem: 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.

Submission attempts (in order):
z=[]
x, y= map(int,input().split())
for i in range(x+1):
    if (2*i)+(4*(x-i))==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')

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')

z=[]
x, y= map(int,input().split())
for i in range(x+1):
    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')

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)
    
b.append(0)
    
for i in b:
    print(i)

for i in b:
    if (4*x)-(2*i)==y:
        z.append('1')
for i in b:
    print((4*x)-(2*i))
    
        
if len(z)>0:
    print('YES')

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

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)
    


for i in b:
    if (4*x)-(2*i)==y:
        z.append('1')
    
        
if len(z)>0:
    print('YES')

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

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')

z=[]
x, y= map(int,input().split())
for i in range(x):
    if (2*i)+(4*(x-i))==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')

z=[]
x, y= map(int,input().split())
for i in range(x):
    if (4*i)+(2*(x-i))==y:
        z.append('1')
        

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

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

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)
    
b.append(0)
    
for i in b:
    print(i)

for i in b:
    if (4*x)-(2*i)==y:
        z.append('1')
for i in b:
    print((4*x)-(2*i))
    
        
if len(z)>0:
    print('Yes')

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

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)


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

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

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)
    
b.append(0)


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

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted