TnT/Multi_CodeNet4Repair huggingface dataset:
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):
animals, legs = input().split()
animals = int(animals)
legs = int(legs)

for i in range(0,animals+1):
  print(animals)
  if ((i * 2) + ((animals - i) * 4)) == legs:
    result = True
    break
  result = False

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

animals, legs = input().split()
animals = int(animals)
legs = int(legs)

for i in range(0,animals+1):
  if ((i * 2) + ((animals - i) * 4)) == legs:
    result = True
    break
  result = False

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

Verdicts: Wrong Answer

Accepted
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):
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")

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

Verdicts: Wrong Answer

Accepted
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):
x, y = map(int, input().split())
if y % 2 == 1:
  print('No')
else:
  if y //4 < x or y //2 > x:
    print('No')
  else:
    print('Yes')
  

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

Verdicts: Wrong Answer

Accepted
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):
X, Y = map(int, input().split())

v = -Y + 4 * X
# print('v', v)
if v % 2 != 0:
    print('No')
    exit()

if v < 0:
    print('No')
    exit()

if X < v:
    print('No')
    exit()

print('Yes')

# a: turu, b: kame
# a * 2 + b * 4 = Y
# a + b = X

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

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


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

if X % 2 == 1 and Y % 2 == 1:
    print('No')
    exit()

v = -Y + 4 * X
# print('v', v)
if v % 2 != 0:
    print('No')
    exit()

if v < 0:
    print('No')
    exit()

if X < v:
    print('No')
    exit()

print('Yes')

# a: turu, b: kame
# a * 2 + b * 4 = Y
# a + b = X

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

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


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

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


Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
x,y=map(int,input().split())
for i in range(x+1):
    if 4*i+(x-i)*2=y:
        print("Yes")
        exit()
print("No")

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

Verdicts: Runtime Error

Accepted
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):


b,a =  map(int,input().split())


t=[]


if a%2==0:
	t.append(a//2)
    
if a%4==0:
	t.append(a//4)

if a%6==0:
	t.append(a//6)

if (a%4)%2==0:
  t.append(a//4+(a%4)//2)

if b in t:
  print('Yes')
else:
  print('No')



a,b =  map(int,input().split())

u=0
for k in range(a+1):
  x = a-k

  if k*2+x*4==b:
    print('Yes')
    u+=1
    break

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

Verdicts: Wrong Answer

Accepted
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):
X,Y = map(int,input().split())


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

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


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


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


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


Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
s=list(map(int,input().split()))
if Y-2*X>=0 and (Y-2*X)%2==0:
  a=int((Y-2*X)//2)
  if X-a>=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

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

Verdicts: Runtime Error

Accepted
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):
from sys import stdin,stdout
x,y=map(int,stdin.readline().split())
if y&1:
    print('No')
    exit(0)
t=y//2-1
c=x-t
ans='Yes' if c>0 and t>0 else 'No'
print(ans)

from sys import stdin,stdout
x,y=map(int,stdin.readline().split())
if y&1:
    print('No')
    exit(0)
t=(y//2)-x
c=x-t
ans='Yes' if c>=0 and t>=0 else 'No'
print(ans)

Verdicts: Wrong Answer

Accepted
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):
C:\Users\kouya\Anaconda3\python.exe C:/Users/kouya/pywork/atcoder/past/Contest170.py
2 100
No

Process finished with exit code 0


import sys

def main():
    X,Y=map(int,input().split())
    crane=(Y-2*X)/2
    if crane!=int(crane):
        print("No")
        sys.exit()
    turtle=X-crane
    if crane>=0 and turtle>=0:
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Verdicts: Runtime Error

Accepted
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):
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")
if(l[0]==l[1] and l[1]==0):
    print("Yes")
else:
    print("No")


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

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


Verdicts: Wrong Answer

Runtime Error

Accepted
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):
a,b = map(int,input().split())

turu = 2
kame = 4
flag =0

for x in range(a + 1):
    
    for y in range(a + 1):
        
        if  x +  y == b//2 and (x + y) <= a:
            flag += 1

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

turu = 2
kame = 4
flag =0

for x in range(a + 1):
    for y in range(a + 1):
        if turu * x + kame * y == b and x + y <= a:
            flag += 1

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


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

turu = 2
kame = 4
flag = False
for i in range(0, X + 1): # 0, 1, 2, 3
    
    turu_num = X - i
    
    leg_total = kame * i + turu_num * turu
    
    if(leg_total == Y):
      flag = True
      break
#    for q in range(0, X - i + 1):

#        if kame * i + turu * q == Y and (i + q) <= X:

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

Verdicts: Wrong Answer

Runtime Error

Accepted
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):
x,y= map(int, input().split())
if y %2 == 0:
    if x*4 >=  y >= x*2:
      for i in range(x):
        if (x*4) - ((x-i)*2) == y:
            print("YES")
            break
      else:
        print("NO")
    else:
        print("NO")
else:
      print("NO")

x,y = map(int,input().split())
k = "NO"
for i in range(x+1):
  b=x-i
  if (b*4)+(i*2)==y:
    k="YES"
print(k)

x,y= map(int, input().split())
if y %2 == 0:
    if x*4 >=  y >= x*2:
      for i in range(x+1):
        if (x*4) - ((x-i)*2) == y:
            print("YES")
            break
      else:
        print("NO")
    else:
        print("NO")
else:
      print("NO")

x,y = map(int,input().split())
k = "NO"
for i in range(x+1):
  b=x-i
  if i*4+b*2==y:
    k="YES"
print(k)

x,y= map(int, input().split())
if y %2 == 0:
	if x*4 >=  y >= x*2:
  		print("YES")
else:
  print("NO")

x,y = map(int,input().sprit())
k = "NO"
for i in range(x+1):
  b=x-i
  if i*4+b*2==y:
    k="YES"
print(k)

x,y= map(int, input().split())
if y %2 == 0:
    if x*4 >=  y >= x*2:
        print('YES')
    else:
        print("NO")
else:
      print("NO")

x,y= map(int, input().split())
if y %2 == 0:
    if x*4 >=  y >= x*2:
      for i in range(x):
        if (x*4*i) - ((x-i)*2) == y:
            print("YES")
            break
      else:
        print("NO")
    else:
        print("NO")
else:
      print("NO")

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
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):
X,Y=map(int,input().split())
a=Y%4
b=a/2
c=int(Y/4)
if a%2!=0,b+c>X:
  print("No")
else:
  print("Yes")

X,Y=map(int,input().split())
a=Y%4
b=a/2
c=int(Y/4)
if a%2!=0 or b+c>X or 4*X<Y or 2*X>Y:
  print("No")
else:
  print("Yes")


Verdicts: Runtime Error

Accepted
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):
X,Y = map(int,input().split())

if (2*X - Y/2) > 0 and Y%2 == 0:
    print('YES')
else:
    print('NO')


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

for i in range(X+1):
    if 2*i + 4*(X-i) == Y:
        print('YES')
    if i == X:
        prinnt('NO')

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

if (2*X - Y/2) > 0 and Y%2 == 0:
    print('YES')
else:
    print('NO')


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

if (2*X - Y/2) >= 0 and Y%2 == 0:
    print('YES')
else:
    print('NO')


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

for i in range(X+1):
    if 2*i + 4*(X-i) == Y:
        print('YES')
        break
    if i == X:
        print('NO')

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


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

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
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):
X,Y = map(int,input().split())

flg = False

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

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

flg = False

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


Verdicts: Wrong Answer

Accepted
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):
X,Y = map(int,input().split())
v = Y-(2*X)
if v<0 or v%2==1:
  print('No')
elif 4*X > Y:
  print('No')
else:
  print('Yes')


X,Y = input().split()
v = Y-(2*X)
if v<0 or v%2==1:
  print('No')
else:
  print('Yes')

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


Verdicts: Wrong Answer

Runtime Error

Accepted
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):
x,y=map(int,input().split())
r=4*x
if r>=y y>=2*x and (r-y)%2==0:
  print('Yes')
else:
  print('No')


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


Verdicts: Runtime Error

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

a = (y-2*x)/2
b = (4*x-y/2)
if a == int(a) and b == int(b) and a >= 0 and b >= 0:
    print('YES')
else:
    print('NO')


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

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


Verdicts: Wrong Answer

Accepted
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):
a = input().split()

if int(a[1]) % 2 != 0:
    print('No')
elif int(a[0]) * 4 == int(a[1]) or int(a[0]) * 2 == int(a[1]):
    print('Yes')
elif 2 * int(a[0]) >= int(a[1]) and 2 * int(a[0]) - int(a[1]) / 2 >= 1:
    print('Yes')
else:
    print('No')

a = input().split()
x = int(a[0])
y = int(a[1])
if y % 2 != 0 or 2 * x > y:
    print('No')
elif 2 * x - y / 2 >= 0:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
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):
x,y=map(int, input().split())
flag=0
for i in range(100):
 for j in range(100):
  if i+j==x and i*2+j*4=y:
    flag=1
    exit()
  else:
    pass
if flag==1:
  print("Yes")
else:
  print("No")


a,b=map(int,input().split())
 for i in range(a):
  for j in range(b):
   if i+j=a and i*2+4*j=b:
    print("Yes")
     break
   else:
     print("No")
  

x,y=map(int, input().split())
flag=0
for i in range(100):
 for j in range(100):
  if i+j==x and i*2+j*4==y:
    flag=1
  else:
    pass
  
if flag==1:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Runtime Error

Accepted
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):
if __name__ == "__main__":
    X, Y = list(map(int, input().split()))
    a = Y / 4
    b = Y / 2
    if X >= a and X <= b:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    X, Y = list(map(int, input().split()))
    a = Y / 4
    b = Y / 2
    if Y % 2 != 0:
        print("No")
    else:
        if X >= a and X <= b:
            print("Yes")
        else:
            print("No")

Verdicts: Wrong Answer

Accepted
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):
X, Y = map(int, input().split())

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

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

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

Verdicts: Runtime Error

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

a = 2*x-y/2
b = y/2-x
print(a, b)
if a.is_integer and b.is_integer == True:
    if a >= 0 and b >= 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

a = 2*x-y/2
b = y/2-x
if a.is_integer() and b.is_integer() and a >= 0 and b >= 0:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
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):
x, y = map(int, input().split())
for i in range(x+1):
  z = y - x*2
  if z%4==0:
    print("Yes")
    exit()
print("No")


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


Verdicts: Wrong Answer

Accepted
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):
a,b = map(int,input(). split ())
if not a % 2 == 0 and not b % 2 == 0:
    print('NO')
elif 2 * a <= b <= 4 * a:
    print('YES')
else:
    print('NO')

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 not isinstance(a, int) or not isinstance(b, int):
    print('NO')
elif 2 * a <= b <= 4 * a:
    print('YES')
else:
    print('NO')

a,b = map(int,input(). split ())
if 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')

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
h,l=map(int,input().split())
temp=l//2
temp2=abs(temp-h)
temp1=abs(h-temp2)
if ((temp2*4)+(temp1*2))==l:
  print('YES')
else:
  print('NO')

h,l=map(int,input().split())
temp=l//2
temp2=abs(temp-h)
temp1=abs(h-temp2)
if ((temp2*4)+(temp1*2))==l:
  print('Yes')
else:
  print('No')


Verdicts: Wrong Answer

Accepted
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):
X, Y = map(int, input().split())

if Y > (4*X):
    print('NO')

elif Y < (2*X):
    print('NO')

elif Y % 2 != 0:
    print('NO')

else:
    print('YES')


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

else:
    print('No')

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

else:
    print('No')

Verdicts: Wrong Answer

Runtime Error

Accepted
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):
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)

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

Verdicts: Runtime Error

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

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


import sys

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

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

Verdicts: Wrong Answer

Accepted
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):
x, y = map(int, input().split())
if y % 2 != 0:
    print('NO')
else:
    if x*2<=y<=x*4:
        print('YES')
    else:
        print('NO')

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

Verdicts: Wrong Answer

Accepted
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):
x,y=map(int,input().split())
ans=0
for n in range(x+1):
  if n*2+(x-n)*4==y:
    ans=1
    break
if ans==0:
  print('Yes')
else:
  print('No')

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

Verdicts: Wrong Answer

Accepted
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):
a, b = map(int, input().split())

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


a, b = map(int, input().split())

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

a, b = map(int, input().split())

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
N = int(input())
MM = input().split()
total = 1
for i in MM:
  total = total*int(i)

  if total > 10**18:
    break
for i in MM:
  if int(i) == 0:
    total = 0
if total > 10**18:
  print(-1)
else:
  print(total)
  

X,Y = map(int,input().split())
count = 0
for i in range(X+1):
  for j in range(X+1):
    if 2*i + 4*j == Y and i+j ==X:
      count +=1
if count == 0:
  print('No')
else:
  print('Yes')

Verdicts: Runtime Error

Accepted
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):
def main():

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

        if X*4<Y:
                ans = "No"
        elif X*2>Y:
                ans = "No"
        else:
                for i in range(X+1):
                        temp = i*2 + (X-i)*4
                        if temp==Y:
                                ans = "Yes"
                                break

        return ans

def main():

        X, Y = list(map(int, input().split()))
        ans = 'No'

        for i in range(X+1):
                temp = i*2 + (X-i)*4
                if temp==Y:
                        ans = 'Yes'
                        break

        return ans

def main():

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

        return ans


if __name__=="__main__":
        ans = main()
        print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
X, Y = map(int, input().split())

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


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

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


Verdicts: Wrong Answer

Accepted
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):
X, Y = list(map(int, input().split()))
if Y%2 == 1:
    print('No')
elif X*2 >= Y and X*4 <= Y:
    print('Yes')
else:
    print('No')

X, Y = list(map(int, input().split()))
if Y%2 == 1:
    print('No')
elif X*2 <= Y and X*4 >= Y:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
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):
import numpy as np
x,y = map(int,input(). split ())

turu = 2*x
came = 4*x

if y%2==0:
    if y >= turu and came >= y:
        print("YES")
    else:
        print("NO")
else:
    print("NO")


import numpy as np
x,y = map(int,input(). split ())

turu = 2*x
came = 4*x

if y%2==0:
    if y >= turu and came >= y:
        print("Yes")
    else:
        print("No")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
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):
a, b = map(int, input().split())
if b>=a and b<=2*a:
    print('Yes')
else:
    print('No')


a, b = map(int, input().split())
if 2*a<b+1 or a>b-1:
    print('No')
else:
    print('Yes')


a, b = map(int, input().split())
if 2*a<b or a>b:
    print('No')
else:
    print('Yes')


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


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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
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):
l = [int(i) for i in input().split()]

for i in range(l[0]+1):
  r = (i * 2 + (l[0] - i) * 4
  if r == l[1]:
    print("Yes")
    break
  else:
    if i == l[0]:
      print("No")

l = [int(i) for i in input().split()]

for i in range(l[0]+1):
  r = i * 2 + (l[0] - i) * 4
  if r == l[1]:
    print("Yes")
    break
  else:
    if (l[0] - i) == 0:
      print("No")

Verdicts: Runtime Error

Accepted
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):
x, y = map(int, input().split())
if y % 2 == 0 and y >= 2*x and y <= 4*x:
  print('yes')
else:
  print('no')

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

Verdicts: Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
x,y=map(int,input().split())
a=list(map(int,input().split()))
while True:
  if x not in a:
    break
  else:
    x-=1
print(x)

x,y=map(int,input().split())
a=list(map(int,input().split()))
dif=1
if x not in a:
  print(x)
else:
  while True:
    if x-dif not in a:
      dif*=-1
      break
    elif x+dif not in a:
      break
    else:
      dif+=1
  print(x+dif)

Verdicts: Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
X, N = map(int, input().split())
Y = list(map(int, input().split()))
x = int(X)
print(x)
for i in range(100):
    if x - i in Y:
        print(x + i)
        break
    elif x + i in Y:
        print(x - i)
        break


X, N = map(int, input().split())
if int(N) == 0:
    print(X)
else:
    Y = list(map(int, input().split()))
    x = int(X)
    for i in range(100):
        if x - i in Y:
            print(x + i)
            break
        elif x + i in Y:
            print(x - i)
            break


X, N = map(int, input().split())
if int(N) == 0:
    print(X)
else:
    Y = list(map(int, input().split()))
    x = int(X)
    for i in range(100):
        if x - i not in Y:
            print(x + i)
            break
        elif x + i not in Y:
            print(x - i)
            break


X, N = map(int, input().split())
if int(N) == 0:
    print(X)
else:
    Y = list(map(int, input().split()))
    x = int(X)
    for i in range(100):
        if x - i not in Y:
            print(x - i)
            break
        elif x + i not in Y:
            print(x + i)
            break


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
from bisect import bisect_left

X, N = map(int, input().split())
plist = list(map(int, input().split()))


if N == 0:
    print(X)

else:
    plist.sort()
    not_plist = [x for x in range(plist[0]-1, plist[-1]+2, 1)  if x not in plist]

    print(not_plist)

    idx = bisect_left(not_plist, X)

    if idx == 0:
        print(X)

    elif idx == len(not_plist):
        print(X)

    else:
        left = X - not_plist[idx-1]
        right = not_plist[idx] - X
        if left <= right:
            print(not_plist[idx-1])
        else:
            print(not_plist[idx])


from bisect import bisect_left

X, N = map(int, input().split())
plist = list(map(int, input().split()))


if N == 0:
    print(X)

else:
    plist.sort()
    not_plist = [x for x in range(plist[0]-1, plist[-1]+2, 1)  if x not in plist]
    idx = bisect_left(not_plist, X)

    if idx == 0:
        print(X)

    elif idx == len(not_plist):
        print(X)

    else:
        left = X - not_plist[idx-1]
        right = not_plist[idx] - X
        if left <= right:
            print(not_plist[idx-1])
        else:
            print(not_plist[idx])


Verdicts: Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
l=input()
ls=l.split(" ")
X=int(ls[0])
N=int(ls[1])
lstr=input()
lst=lstr.split(" ")
fl=[];
if(fl!=[]):
    for a in lst:
         fl.append(int(a))
else:
    print(X)
for a in range(len(fl)):
    if(X-a not in fl):
         print(X-a)
         break
    if(X+a not in fl):
         print(X+a)
         break


l=input()
ls=l.split(" ")
X=int(ls[0])
N=int(ls[1])
lstr=input()
lst=lstr.split(" ")
fl=[]
if(N!=0):
    for a in lst:
         fl.append(int(a))
for a in range(101):
    if(X-a not in fl):
         print(X-a)
         break
    if(X+a not in fl):
         print(X+a)
         break

Verdicts: Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
s = input().split()

x = int(s[0])
n = int(s[1])

s = {i for i in range(-100,101)}

p1 = input().split()

p = set()

for i in p1:
    p.add(int(i))

t = s - p

answer = 150

for i in t:
    if (abs(x - abs(int(i))) < abs(x - abs(answer))) or (abs(x - abs(int(i))) == abs(x - abs(answer))) and i < answer:
        answer = int(i)

print(answer)

s = input().split()

x = int(s[0])
n = int(s[1])

s = {i for i in range(-1,102)}

p1 = input().split()

p = set()

for i in p1:
    p.add(int(i))

t = s - p

answer = 20000

for i in t:
    if (x - abs(int(i)) < x - abs(answer)) or (x - abs(int(i)) == x - abs(answer)) and i < answer:
        answer = int(i)

print(answer)

s = input().split()

x = int(s[0])
n = int(s[1])

s = {i for i in range(-1,102)}

p1 = input().split()

p = set()

for i in p1:
    p.add(int(i))

t = s - p

answer = 20000

for i in t:
    if (abs(x - int(i)) < abs(x - answer)) or (abs(x - int(i)) == abs(x - answer)) and i < answer:
        answer = int(i)

print(answer)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
X, N = [int(i) for i in input().split()]
if N == 0:
    print(X)
else:
    Ps = set([int(i) for i in input().split()])
    if not X in Ps:
        print(X)

    print(f'{X} {sorted(Ps)}')
    diff = 0
    while True:
        if not X - diff in Ps:
            print(X - diff)
            break
        if not X + diff in Ps:
            print(X + diff)
            break
        diff += 1

X, N = [int(i) for i in input().split()]
if N == 0:
    print(X)
else:
    Ps = set([int(i) for i in input().split()])

    
    if X not in Ps:
        print(X)
        exit(0)

    
    diff = 0
    while True:
        a = X - diff
        if a not in Ps:
            print(a)
            break
        a = X + diff
        if a not in Ps:
            print(a)
            break
        diff += 1

Verdicts: Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
import sys
sys.setrecursionlimit(10000000)

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

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


if n == 0:print(x);exit()

l=[0] * 101

for i in p:
    l[i] =1

diff=1000
ans=0
for i in range(1,101):
    if l[i] == 0 and diff > abs(x-1):
        diff= abs(x-1)
        ans=i

print(ans)


import sys
sys.setrecursionlimit(10000000)

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

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


if n == 0:print(x);exit()

l=[0] * 100

for i in p:
    l[i-1] =1

print(l)

diff=min(101-x,x)
ans=0 if x < 51 else 101
for i in range(100):
    if l[i] == 0 and diff > abs(x-(i+1)):
        diff= abs(x-(i+1))
        ans=i+1

print(ans)


import sys
sys.setrecursionlimit(10000000)

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

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


if n == 0:print(x);exit()

l=[0] * 102

for i in p:
    l[i] =1

diff=1000
ans=0
for i in range(0,102):
    if l[i] == 0 and diff > abs(x-i):
        diff= abs(x-i)
        ans=i

print(ans)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
import sys
x,n = map(int,input().split())
a = list(map(int,input().split()))
if x in a:
    s = 0; t = 0
    for i in range(x+1,100):
        if i not in a:
            s = i
            sys.exit()
    for j in reversed(range(x-1,-100)):
        if i not in a:
            t = j
            sys.exit()
    if abs(x-s) < abs(x-t):
        print(s)
    elif abs(x-s) > abs(x-t):
        print(t)
else:
    print(x)

x,m = map(int,input().split())
a = list(map(int,input().split()))
for i in range(x+1):
    for s in [-1,1]:
        b = x+i*s
        if a.count(b) == 0:
            print(b)
            exit()

Verdicts: Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
def find_smallest_num(lst):
	X=lst[0]
	for i in range(len(lst)):
		if lst[i]<X: X=lst[i]
	return X

#input x,n and p as intergers. p acts as an array
x,n=int(input()).split()
p=int([]).split()
length=len(p)

#define the closest number
def closestnum(p,length):
    return p[min(range(length))]
#print when x is not it p
for x not in p:
    print(round(closestnum(p,length)))
    
    


import math

if __name__ == "__main__":
    x, n = map(int, input().split())
    a = set(map(int, input().split()))
    p = q = x
    while True:
        if p not in a and q not in a:
            print(min(p, q))
            quit(0)
        if p not in a:
            print(p)
            quit(0)
        elif q not in a:
            print(q)
            quit(0)
        else:
            p -= 1
            q += 1



Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
x, n = [int(s) for s in input().split(" ")]
if n == 0:
  print(x)
else:
  plist = [int(s) for s in input().split(" ")]

  dlist = {}
  for p in plist:
    d = abs(p - x)
    if d in dlist or d == 0:
      dlist[d] = (True, None)
    else:
      dlist[d] = (False, p - x)

  sorted_d = sorted(dlist.items(), key=lambda x:x[0])

  ans = 0
  prevk = 0
  flag = False
  for k, v in sorted_d:
    if not flag and prevk == 0 and k >= 1:
      ans = 0
      break
    elif k - prevk > 1:
      ans = -(prevk + 1)
      break
    elif not v[0]:
      ans = v[1]
      break
    flag = True
    prevk = k
  print(x + ans)

x, n = [int(s) for s in input().split(" ")]
if n == 0:
  print(x)
else:
  plist = [int(s) for s in input().split(" ")]

  dlist = {}
  for p in plist:
    d = abs(p - x)
    if d in dlist or d == 0:
      dlist[d] = (True, None)
    else:
      dlist[d] = (False, p - x)

  sorted_d = sorted(dlist.items(), key=lambda x:x[0])

  ans = 0
  prevk = 0
  flag = False
  for k, v in sorted_d:
    if not flag and prevk == 0 and k >= 1:
      ans = 0
      break
    elif v[0] and k - prevk > 1:
      ans = -(prevk + 1)
      break
    elif not v[0]:
      ans = min(-v[1], v[1])
      break
    flag = True
    prevk = k
    ans = -(k + 1)
  print(x + ans)

x, n = [int(s) for s in input().split(" ")]
if n == 0:
  print(x)
else:
  plist = [int(s) for s in input().split(" ")]

  dlist = {}
  for p in plist:
    d = abs(p - x)
    if d in dlist or d == 0:
      dlist[d] = (True, None)
    else:
      dlist[d] = (False, p - x)

  sorted_d = sorted(dlist.items(), key=lambda x:x[0])

  ans = 0
  prevk = 0
  flag = False
  for k, v in sorted_d:
    if not flag and prevk == 0 and k >= 1:
      ans = 0
      break
    elif k - prevk > 1:
      ans = -(prevk + 1)
      break
    elif not v[0]:
      ans = -v[1]
      break
    flag = True
    prevk = k
    ans = -(k + 1)
  print(x + ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N.  Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.

Submission attempts (in order):
x, n = map(int, input().split())
if n:
	p = list(map(int, input().split()))

	for i in range(n+1):
		if x - i in p:
			print(x-1)
			break
		if x + i in p:
			print(x+1)
			break
else:
	print(x)

x, n = map(int, input().split())
if n:
	p = list(map(int, input().split()))
	for i in range(n+1):
		if not x - i in p:
			print(x-i)
			break
		if not x + i in p:
			print(x+i)
			break
else:
	print(x)

Verdicts: Wrong Answer

Accepted