TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
k=a+b
if k%2==0:print(k/2)
else:print('IMPOSSIBLE')

a,b=map(int,input().split())
k=a+b
if k%2==0:print(k//2)
else:print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())
if (a + b) % 2 == 0:
  print((a+b)/2)
else:
  print('IMPOSSIBLE')

a, b = map(int, input().split())
if (a + b) % 2 == 0:
  print(int((a+b)/2))
else:
  print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int, input().split())
print((a+b)/2) if ((a+b)%2 == 0)&(a!=0)&(b!=0) else print("IMPOSSIBLE")

a,b = map(int, input().split())
print((a+b)/2) if (a+b)%2 == 0 else print("IMPOSSIBLE")


a,b = map(int, input().split())
print(int((a+b)/2)) if (a+b)%2 == 0 else print("IMPOSSIBLE")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
if (a+b)%2==0:
    print(a+b//2)
else:
    print('IMPOSSIBLE')


a,b=map(int,input().split())
if (a+b)%2==0:
    print((a+b)//2)
else:
    print('IMPOSSIBLE')


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int,input().split())
if (A-B)%2 == 1:
    print("IMPOSSIBLE")
else:
    print(int((A-B)/2)

A,B = map(int,input().split())
if (A-B)%2 == 1:
    print("IMPOSSIBLE")
else:
    print(int((A-B)/2))

A,B = map(int,input().split())
if (A-B)%2 == 1:
    print("IMPOSSIBLE")
else:
    print(int((A+B)/2))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split()) 
if (a+b)//2 == 0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

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

if (a+b)%2 == 0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
n,a,b = map(int,input().split())
if n*a<=b:
  print(n*a)
elif n*a>=b:
  print(b)  

a,b=map(int,input().split())
if (a+b)%2 == 1:
  print('IMPOSSIBLE')
  else:
    print((a+b)//2)

a,b=map(int,input().split())
if (a+b)%2 ==0:print((a+b)//2)
else:
  print('IMPOSSIBLE')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input());print('IMPOSSIBLE' if (b-a)%2!=0 else int((a+b)/2))

a,b=map(int,input().split());print('IMPOSSIBLE' if (b-a)%2!=0 else int((a+b)/2))

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = input().split()
A = int(A)
B = int(B)

if (A+B)%2==0:
  print((A+B)/2)
else:
  print('IMPOSSIBLE')

A, B = input().split()
A = int(A)
B = int(B)

if (A+B)%2==0:
  print(int((A+B)/2))
else:
  print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):

A = input()
B = input()


A = int(A)
B = int(B)
m = 0


m = ( A + B ) / 2


if m.is_integer():
    print( '%d' %m)
else :
    print('IMPOSSIBLE')



A = input().split()


A[0] = int(A[0])
A[1] = int(A[1])
m = 0


m = ( A[0] + A[1] ) / 2


if m.is_integer():
    print( '%d' %m)
else :
    print('IMPOSSIBLE')


Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())

if (a+b)%2 == 0 :
    print(a*b/2)
else :
    print("IMPOSSIBLE")


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

if (a+b)%2 == 0 :
    print(a+b)/2))
else :
    print("IMPOSSIBLE")


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

if (a+b)%2 == 0 :
    print((a+b)/2)
else :
    print("IMPOSSIBLE")

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

if (a+b)%2 == 0 :
    print((a+b)/2))
else :
    print("IMPOSSIBLE")


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

if (a+b)%2 == 0 :
    print(a+b/2)
else :
    print("IMPOSSIBLE")


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

if (a*b)%2 == 0 :
    print(a*b/2)
else :
    print("IMPOSSIBLE")


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

if (a+b)%2 == 0 :
    print((a+b)//2)
else :
    print("IMPOSSIBLE")


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())

if (a+b) % 2 == 0:
  print((a+b)/2)
  
elif: (a+b)%2 == 1:
  print("IMPOSSIBLE")

a,b=map(int,input().split())
s = (a+b)/2

if (a+b) % 2 == 0:
  print(s)
  
else: 
  print("IMPOSSIBLE")

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

if (a+b) % 2 == 0:
  print((a + b)/2)
  
else:
  print("IMPOSSIBLE")

a,b=map(int,input().split())
s = int((a+b)/2)
u = (a+b)%2

if u == 0:
  print(s)
  
else: 
  print("IMPOSSIBLE")

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())

if a+b%2==0:
    print(int((a+b)/2))
else :
    print('IMPOSSIBLE')

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

if (a+b)%2==0:
    print(int((a+b)/2))
else :
    print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B=map(int,input().split())
if (A+B)%2==0:
    print (A+B/2)
else:
    print ('IMPOSSIBLE')

A,B=map(int,input().split())
if (A+B)%2==0:
    print(A+B//2)
else:
    print('IMPOSSIBLE')

A,B=map(int,input().split())
if (A+B)%2==0:
    print ((A+B)/2)
else:
    print ('IMPOSSIBLE')

A,B=map(int,input().split())
if (A+B)%2==0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split)
if((a + b) % 2 == 0):
    print((a + b) / 2)
else:
    print('IMPOSSIBLE')

a,b = map(int,input().split())
if((a + b) % 2 == 0):
    print((a + b) / 2)
else:
    print('IMPOSSIBLE')

a,b = map(int,input().split())
if((a + b) % 2 == 0):
    print((a + b) // 2)
else:
    print('IMPOSSIBLE')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B=map(int,input().split(" "))

if((A+B)/2 == (A+B)//2):
  print((A+B)/2)
else:
  print("IMPOSSIBLE")  

A,B=map(int,input().split(" "))

if((A+B)/2 == (A+B)//2):
  print(int((A+B)/2))
else:
  print("IMPOSSIBLE")  

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
print((a+b)/2) if (a+b)%2==0 else print("IMPOSSIBLE")

a,b=map(int,input().split())
print(int((a+b)/2)) if (a+b)%2==0 else print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a=int(input())
b=input().split(" ")
sequence=[]
for i in range(0,a):
    sequence.append(int(b[i]))
error=[]
for q in range(0,a-1):
    if sequence[q]-sequence[q+1]>0:
        error.append(q)
        error.append(q+1)

if len(error)==0:
    print("YES")

elif len(error)==2:
    if a==2:
        print("YES")
    elif error[0]==0:
        if sequence[error[0]+2]-sequence[error[0]]>0:
            print("YES")
        else:
            print("NO")
    elif error[1]==a:
        if sequence[error[1]]-sequence[error[1]-2]>0:
            print("YES")
        else:
            print("NO")
    else:
        if  sequence[error[1]]-sequence[error[1]-2]>0 and sequence[error[0]+2]-sequence[error[0]]>0:
            print("YES")
        else:
            print("NO")

elif len(error)==4:
    if error[1]==error[2]:
        if sequence[error[0]]>sequence[error[3]]:
            if error[0]==0 and error[3]==a-1:
                if sequence[error[0]]-sequence[error[3]-1]>0 and sequence[error[0]+1]-sequence[error[3]]>0:
                    print("YES")
                else:
                    print("NO")
            elif error[0]==0:
                if sequence[error[0]+3]-sequence[error[0]]>0:
                    print("YES")
                else:
                    print("NO")
            elif error[1]==a:
                if sequence[error[3]]-sequence[error[3]-3]>0:
                    print("YES")
                else:
                    print("NO")
            else:
                if  sequence[error[3]]-sequence[error[3]-3]>0 and sequence[error[0]+3]-sequence[error[0]]>0:
                    print("YES")
                else:
                    print("NO")
    elif sequence[error[0]]-sequence[error[2]]>0 and sequence[error[1]]-sequence[error[3]]>0:
        if error[0]==0 and error[3]==a-1:
            if sequence[error[0]]-sequence[error[3]-1]>0 and sequence[error[0]+1]-sequence[error[3]]>0:
                print("YES")
            else:
                print("NO")
        elif error[0]==0:
            if sequence[error[3]+1]-sequence[error[0]]>0:
                print("YES")
            else:
                print("NO")
        elif error[3]==a:
            if sequence[error[3]]-sequence[error[0]-1]>0:
                print("YES")
            else:
                print("NO")
        elif sequence[error[3]]-sequence[error[0]-1]>0 and sequence[error[3]+1]-sequence[error[0]]>0:
            print("YES")
        else:
            print("NO")
    else:
        print("NO")

else:
    print("NO")

a=input().split(" ")
A=int(a[0])
B=int(a[1])
answer=(A+B)/2
if (A+B)%2==0 :
    print(answer)
else:
    print("IMPOSSIBLE")


a=input().split(" ")
A=int(a[0])
B=int(a[1])
answer=int((A+B)/2)
if (A+B)%2==0 :
    print(answer)
else:
    print("IMPOSSIBLE")


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = map(int, input().split())
ans = (A+B)/2
print(int(ans)) if ans % 2 == 0 else print("IMPOSSIBLE")


A, B = map(int, input().split())
ans = int((A+B)/2) if (A+B) % 2 == 0 else "IMPOSSIBLE"
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())

print((a+b)//2 if (a+b)% == 0 else 'IMPOSSIBLE')

a, b = map(int, input().split())
     
if (a + b) / 2 == (a + b) // 2:
	print(int((a + b) / 2))
else:
	print('IMPOSSIBLE')

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())

if (b-a)%2==0:
  print(abs((b-a)/2)+min(a,b))
else:
  print("IMPOSSIBLE")

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

if (a+b)%2==0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

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

if (a+b)%2==0:
  print((a+2)/2)
else:
  print("IMPOSSIBLE")

a,b=map(int,input().split())
 
if (a+b)%2==0:
  print(int((a+b)/2))
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
#!/bin/python3

a, b = input().split(" ")

if a % 2 == b % 2:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")


# -*- coding: utf-8 -*-

a, b = map(int, input().split(" "))
if a % 2 == b % 2:
    print(int((a + b) / 2))
else:
    print("IMPOSSIBLE")


Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
int a=int(input())
int b=int(input())
if abs(a-b)%2==0:
  print(abs(a-b)/2)
else:
  print('IMPOSSIBLE')

a,b=map(int,input().split())
if  (a+b)%2==0:
    print((a+b)//2)
         
else:
    print('IMPOSSIBLE')


Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = input().split()

if ((a + b) % 2) == 0:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")

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

if ((a + b) % 2) == 0:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")

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

k = (a + b) / 2

if ((((a + b) % 2) == 0) and (a >= k) and (k >= b)) :
    print(k)
else:
    print("IMPOSSIBLE")

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

if ((a + b) % 2) == 0:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")

a, b = input().split()

if (a + b) % 2 == 0:
    print((a + b) % 2)
else:
    print("IMPOSSIBLE")

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

if ((a + b) % 2) == 0:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")

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

if(a < b):
  swap = b
  b = a
  a = swap

k = (a + b) // 2

if ((((a + b) % 2) == 0) and (a >= k) and (k >= b)) :
    print(k)
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())

if abs(a-b)//2 == abs(a-b)/2:
  print(int(abs(a-b)/2))
else:
  print('IMPOSSIBLE')

a,b = map(int,input().split())
if (a+b)//2==(a+b)/2: print((a+b)//2)
else: print('IMPOSSIBLE')


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):

    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
a, b=map(int,imput().split()))

if a/b==a//b:
	print(a//b)
	
else:
	print("IMPOSSIBLE")


    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
a, b=map(int,input().split())

if  (a+b)/2 == (a+b)//2:
	print((a+b)//2)
	
else:
	print("IMPOSSIBLE")

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())
diff = b-a
if diff < 0:
    diff = a-b
if diff%2 == 0:
    print(diff//2)
else:
    print('IMPOSSIBLE')

a, b = map(int, input().split())
if b < a:
    a, b = b, a
diff = b-a
if diff%2 == 0:
    print((a+b) // 2)
else:
    print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int,input().split())

ans = "IMPOSSIBLE"
if ((a+b)%2 == 0):
    ans = abs((a+b)/2)
print(ans)

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

ans = "IMPOSSIBLE"
if ((a+b)%2 == 0):
    ans = round((a+b)/2)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B=map(int,input().split())
if (A-B)%2==1:
    print("IMPOSSIBLE")
else:
  	print((A+B)/2)

A,B=map(int,input().split())
if (A*B)%2==1:
  print(IMPOSSIBLE)
  else
  	print((A+B)/2)


A,B=map(int,input().split())
if (A-B)%2==1:
    print("IMPOSSIBLE")
else:
  	print(int((A+B)/2))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
# OLE?
a = input()
print(10 ** (10 ** (10 ** (10 ** (10 ** (10 ** 10))))))

# OLE?
a = input()
b = input()

a, b = map(int, input().split())
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

Verdicts: Time Limit Exceeded

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=sorted(map(int,input().split()))
print((b-a)//2 if (b-a)%2==0 else "IMPOSSIBLE" )

a,b=sorted(map(int,input().split()))
print((b+a)//2 if (b+a)%2==0 else "IMPOSSIBLE" )

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
num = a - b
if num < 0:
  num = -num
if num % 2 == 0:
  print(num/2)
else:
  print("IMPOSSIBLE") 

import math
a,b = map(int,input().split())
num = a + b
if num < 0:
  num = -num
if num % 2 == 0:
  print(math.floor(num/2))
else:
  print("IMPOSSIBLE") 

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=input().split()
k=(a+b)/2
g=int(k)
if(k==g):
    print(k)
else:
    print("IMPOSSIBLE")

l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
k=(a+b)/2
g=int(k)
if(k==g):
    print(k)
else:
    print("IMPOSSIBLE")

a,b=input().split()
k=(a+b)/2
g=(a+b)//2
if(k==g):
    print(k)
else:
    print("IMPOSSIBLE")

l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
k=(a+b)/2
g=int(k)
if(k==g):
    print(g)
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
import math
a, b = [int(i) for i in input().split()]
r = a - b
if r % 2 is 0:
  print(abs(int(r / 2)))
else:
  print("IMPOSSIBLE")
  


import math
a, b = [int(i) for i in input().split()]
r = a - b if a > b else b - a
if r % 2 is 0:
  print(abs(int(r / 2)))
else:
  print("IMPOSSIBLE")

import math
a, b = [int(i) for i in input().split()]
r = a - b if a > b else b - a
if r % 2 is 0:
  print(abs(int(r / 2)) + (a if a < b else b))
  else:
    print("IMPOSSIBLE")

import math
a, b = [int(i) for i in input().split()]
r = a - b if a > b else b - a
if r % 2 is 0:
  print(abs(int(r / 2)) + (a if a < b else b))
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
if (b-a)%2==0:
  print((b-a)/2)
else:
  print('IMPOSSIBLE')

a,b = map(int,input().split())
if (b-a)%2==0:
  print(int((b-a)/2))
else:
  print('IMPOSSIBLE')

a,b = map(int,input().split())
if (b-a)%2==0:
  print(int((b+a)/2))
else:
  print('IMPOSSIBLE')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
N = int(input())
ps = list(map(int, input().split()))
 
count = 0
 
for p,n in zip(ps,range(N)):
    if p != n:
        count += 1
if count == 2:
    print('YES')
else:
    print('NO')

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

if (a+b) % 2 != 0:
    print('IMPOSSIBLE')
else:
    print((a+b)//2)

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
def harmony(a, b):

    return "IMPOSSIBLE" if abs(a-b)%2 != 0 else int(abs(a-b)//2)
def main():
    a, b = map(int, input().split())
    print(harmony(a, b))

if __name__ == '__main__':
    main()


def harmony(a, b):

    return "IMPOSSIBLE" if abs(a-b)%2 != 0 else int(abs(a-b)//2)+min(a,b)
def main():
    a, b = map(int, input().split())
    print(harmony(a, b))

if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())

from sympy import *

x = sympy.Symbol('x') 
f = 2*x -a-b 

solutions=sympy.solve(f,x) 
print(solutions)

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

if (a+b)%2 == 0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())
if (a + b) % 2 == 0:
  print((a + b) / 2)
else:
  print('IMPOSSIBLE')

a, b = map(int, input().split())
if (a + b) % 2 == 0:
  print(int((a + b) / 2))
else:
  print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())
print((a + b)/ 2 if (a + b) % 2  == 0 else 'IMPOSSIBLE')

a, b = map(int, input().split())
print((a + b) // 2 if (a + b) % 2  == 0 else 'IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
import sys
A, B = map(int, input().split())
tmp = 0

if (abs(A)-abs(B))%2 == 1:
  print("IMPOSSIBLE")
  sys.exit()

if A < B:
  tmp = A
  A = B
  B = tmp

if A > 0 and B > 0:
  K = (A+B)/2
elif A < 0 and B < 0:
  K = -(abs(A)+abs(B))/2
else:
  K = A-(abs(A)+abs(B))/2

print(K)

import sys
A, B = map(int, input().split())
tmp = 0

if (abs(A)-abs(B))%2 == 1:
  print("IMPOSSIBLE")
  sys.exit()

if A < B:
  tmp = A
  A = B
  B = tmp

if A > 0 and B > 0:
  K = (A+B)/2
elif A < 0 and B < 0:
  K = -(abs(A)+abs(B))/2
else:
  K = A-(abs(A)+abs(B))/2

print(int(K))

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
# -*- coding: utf-8 -*-
a, b = map(int, input().split())

k = a+b
if k%2==0:
  return k/2
else:
  print('IMPOSSIBLE')
      


# -*- coding: utf-8 -*-
a, b = map(int, input().split())

k = a+b
if k%2==0:
  return k/2
else:
  return 'IMPOSSIBLE'
      


# -*- coding: utf-8 -*-
a, b = map(int, input().split())

k = a+b
if k%2==0:
  print(k/2)
else:
  print('IMPOSSIBLE')
      


# -*- coding: utf-8 -*-
a, b = map(int, input().split())
 
k = a+b
if k%2==0:
  print(k//2)
else:
  print('IMPOSSIBLE')
      

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=list(map(int,input().split()))
c=a+b
if (c)%2 !=0:
    print("IMPOSSIBLE")
else:
    print(c/2)

a,b=list(map(int,input().split()))
c=a+b
if (c)%2 !=0:
    print("IMPOSSIBLE")
else:
    print(c//2)

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = map(int, input().split())
print('IMPOSSIBLE' if A%2 != B%2 else abs(B-A) // 2)

A, B = map(int, input().split())
print('IMPOSSIBLE' if A%2 != B%2 else min(A, B) + abs(B-A) // 2)

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int, input().split())
a = min(A,B)
b = max(A,B)
if (a+b) % 2 == 0:
	print(int((b-a)/2))
else:
	print("IMPOSSIBLE")


A,B = map(int, input().split())
a = min(A,B)
b = max(A,B)
if (a+b) % 2 == 0:
	print(int((b-a)/2 + a))
else:
	print("IMPOSSIBLE")


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
import math
a, b = map(int, input().split())
if (b-a) % 2 == 0:
    print(floor((a+b) / 2))
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())
if (b-a) % 2 == 0:
    print((a+b) / 2)
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())
if (b-a) % 2 == 0:
    print((a+b) // 2)
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
m, n = map(int, input.split())
total = m + n
if total % 2 == 0:
  print(total // 2)
else:
  print('IMPOSSIBLE')

m, n = map(int, input().split())
total = m + n
if total % 2 == 0:
  print(total // 2)
else:
  print('IMPOSSIBLE')


Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int, input().split())
if (a+b)%2==0:
  print(str((a+b)/2))
else:
  print("IMPOSSIBLE")

a,b=map(int, input().split())
print(str((a+b)/2))

a,b=map(int, input().split())
if (a+b)%2==0:
  print(str((a+b)/2))
else:
  print("IMPOSSIBLE")

a,b=map(int, input().split())
if (a+b)%2==0:
  print(str((a+b)//2))
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int, input().split())

if (A+B)%2 == 0 :
	print((A+B)/2)
else :
	print('IMPOSSIBLE')

A,B = map(int, input().split())

if A%2 == 0 and B%2 == 0 :
	print((A+B)/2)
else :
	print('IMPOSSIBLE')

A,B = map(int, input().split())

if (A+B)%0 :
	print((A+B)/2)
else :
	print('IMPOSSIBLE')

n = int(input())
a = [int, for i in input().split()]
b = [int, for i in input().split()]
c = 0

for i in range(n):
	if a[i] >= b[i]:
		c += b[i]
	else:
		c += a[i]
		c += min(a[i+1],b[i]-a[i])
		if a[i+1] >= b[i]-a[i]:
			a[i+1] = a[i+1] - (b[i] - a[i])
		else:
			a[i+1] = 0
print(c)

A,B = map(int, input().split())

if (A+B)%2 == 1 :
	print('IMPOSSIBLE')
else :
	print((A+B)/2)

A,B = map(int,input().split())

K = int()

if (A+B)%2 ==0 :
	K=(A+B)//2
	print(K)
else:
	print('IMPOSSIBLE')

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split(" "))
print((a + b)/2) if (a + b) % 2 == 0 else print("IMPOSSIBLE")

a, b = map(int, input().split(" "))
print((a + b) // 2) if (a + b) % 2 == 0 else print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())

if a == b or ((a + b) % 2) == 1:
    print('IMPOSSIBLE')

else:
    print((a + b) / 2)


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

if ((a + b) % 2) == 1:
    print('IMPOSSIBLE')

else:
    print((a + b) / 2)

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

if ((a + b) % 2) == 1:
    print('IMPOSSIBLE')

else:
    print((a + b) // 2)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
k=(a+b)/2
print(k if ((a>=k and b<=k) or (a<=K and b>=k)) and k%2==0 else "IMPOSSIBLE")

a,b=map(int,input().split())
print((a+b)/2 if (a+b)%2==0 else "IMPOSSIBLE")

a,b=map(int,input().split())
k=(a+b)//2
print(k if ((a>=k and b<=k) or (a<=K and b>=k)) and k%2==0 else "IMPOSSIBLE")

a,b=map(int,input().split())
print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())
k = 1
while True:
  if a - k == b - k:
    print(k)
    exit()
  if a < k or b < k:
    print('IMPOSSIBLE')
    exit()
  k += 1

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

while True:
  if abs(a - k) == abs(b - k):
    print(k)
    exit()
  if a < k or b < k:
    print('IMPOSSIBLE')
    exit()
  k += 1

a, b = map(int,input().split())
if (a + b) % 2 == 0:
  print((a + b) // 2)
else:
  print("IMPOSSIBLE")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())

def kansu_return_flag(a,b):
    
    flag = 0

    for i in range(10**9):
        a_ans = abs(a-i)
        b_ans = abs(b-i)
        if a_ans == b_ans:
            ans = i
            flag = 1
            break
    return flag

flag = kansu_return_flag(a,b)

if flag == 1:
    print(ans)
else:
    print('IMPOSSIBLE')

a, b = map(int, input().split())
def kansu_return_flag(a,b):
    ans = 0
    flag = 0

    if abs(a-b)%2 != 0:
        flag = 0
        print('aaaa')
    else:
        ans = abs(a-b)/2 + a
        flag = 1
    return flag,ans

flag,ans = kansu_return_flag(a,b)

if flag == 1:
    print(ans)
else:
    print('IMPOSSIBLE')

a, b = map(int, input().split())
def kansu_return_flag(a,b):
    
    flag = 0
    if a>b:
        big = a
        small = b
    else:
        big = b
        small = a
        
    for i in range(big):
        a_ans = abs(big-i)
        b_ans = abs(small-i)
        if a_ans == b_ans:
            ans = i
            flag = 1
            break
    return flag

flag = kansu_return_flag(a,b)

if flag == 1:
    print(ans)
else:
    print('IMPOSSIBLE')

a, b = map(int, input().split())
def kansu_return_flag(a,b):
    ans = 0
    flag = 0

    if abs(a-b)%2 != 0:
        flag = 0
    else:
        ans = (a+b)/2
        flag = 1
    return flag,ans

flag,ans = kansu_return_flag(a,b)

if flag == 1:
    print(int(ans))
else:
    print('IMPOSSIBLE')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = map(int, input().split())

ans = (A+B)/2
if ans % int(ans) != 0:
    ans = "IMPOSSIBLE"

print(ans)

A, B = map(int, input().split())

if (A+B)%2 == 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
c=a%2
d=b%2
if (c-d)==0:
  print((a+b)/2)
else:
  print("'IMPOSSIBLE'")


a,b=map(int,input().split())
c=a%2
d=b%2
if (c-d)==0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

a,b=map(int,input().split())
c=a%2
d=b%2
if (c-d)==0:
  print(int((a+b)/2))
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int, input().strip().split(' '))
if (A+B)%2 == 0:
  print((A+B)/2)
else:
  print('IMPOSSIBLE')

A,B = map(int, input().strip().split(' '))
if (A+B)%2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = map(int, input().split())

if (A+B)%2 == 0:
    print( (A+B)/2 )
else:
    print('IMPOSSIBLE')

A, B = map(int, input().split())

if (A+B)%2 == 0:
    print( int((A+B)/2) )
else:
    print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
L,R = map(int,input().split())

ans = (L+R)/2

if ans.is_integer():
  return int(ans)
else:
  return "IMPOSSIBLE"

L,R = map(int,input().split())

ans = (L+R)/2

if ans.is_integer():
  print(int(ans))
else:
  print("IMPOSSIBLE")

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B=map(int,input().split())

A,B=map(int,input().split())

if (A+B)%2==0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')

A,B=map(int,input().split())

A,B=map(int,input().split())

if (A+B)%2==0:
    print((A+B)/2)
else:
    print('impossible')

A,B=map(int,input().split())

if (A+B)%2==0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = input().split()
a=int(a)
b=int(b)

if (a+b)%2 ==0:
    print(int(a+b)/2)
else:
    print("IMPOSSIBLE")

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

if (a+b)%2 ==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())
k = (a**2 + b**2)/(2*a-2*b)

if isinstance(k, float):
    print("IMPOSSIBLE")
else:
    print(k)

a, b = map(int, input().split())
k = (a*a - b*b)/(2*a-2*b)

if float.is_integer(k):
    print(k)
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())
k = (a*a - b*b)/(2*a-2*b)

if float.is_integer(k):
    print(int(k))
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int,input().split())
 
K=(A+B)/2
 
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False
 
if is_integer_num(K)==False:
  print("IMPOSSIBLE")
else:
  print(K)

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

K=(A+B)/2

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

if is_integer_num(K)==False:
  print(IMPOSSIBLE)
else:
  print(K)

A,B = map(int,input().split())
 
K=(A+B)/2
 
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False
 
if is_integer_num(K)==False:
  print(IMPOSSIBLE)
else:
  print(K)

A,B = map(int,input().split())
 
K=(A+B)/2
 
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False
 
if is_integer_num(K)==False:
  print("IMPOSSIBLE")
else:
  print(int(K))

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

S=list(ns())
S.reverse()

modmap=[[0]*10 for i in range(10**5)]
for i in range(10):
    modmap[0][i]=i

for i in range(1,10**5):
    for j in range(10):
        modmap[i][j]=(modmap[i-1][j]*10)%13


q_list=[]
moda=0
for i in range(len(S)):
    if(S[i]=='?'):
        q_list.append(i)
    else:
        moda=(moda+modmap[i][int(S[i])])%13


modlist=[[0]*13 for i in range(len(q_list))]
mlist=[i for i in range(13)]

for i in range(10):
    modlist[0][modmap[q_list[0]][i]]=1

for i in range(1,len(q_list)):
    for j in range(10):
        tmpmod=modmap[q_list[i]][j]
        for k in range(13):
            modlist[i][(tmpmod+k)%13]+=(modlist[i-1][k]%(10**9+7))

print(modlist[len(q_list)-1][mlist[5-moda]]%(10**9+7))

import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

A,B=nm()

print((A+B)//2 if (A+B)%2==0 else 'IMPOSSIBLE')

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)/2)
else:
  print('IMPOSSIBLE')

a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
n=a+b
if n%2==0:print(n/2)
else:print("IMPOSSIBLE")

a,b = map(int,input().split())
n=a+b
if n%2==0:print(int(n/2))
else:print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a = [int(s) for s in input().split()]
p = (a[0] + a[1]) / 2
if p == int(p):
  print(p)
else:
  print("IMPOSSIBLE")

a = [int(s) for s in input().split()]
p = (a[0] + a[1]) / 2
if p == int(p):
  print(int(p))
else:
  print("IMPOSSIBLE")


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
N = int(input())
A = list(int(x) for x in input().split())
B = list(int(x) for x in input().split())
a = 0
b = 0
for x in range(N):
    B[x] = B[x] + a
    if A[x] > B[x]:
        b = b + B[x]
        a = 0
    else:
        b = b + A[x]
        if A[x] > a:
            a = B[x] - A[x]
        else:
            a = B[x]
if A[N - 1] > B[N - 1]:
    print(b)
else:
    if A[N] > a:
        print(b + a)
    else:
        print(b + A[N])

A , B = (int(x) for x in input().split())
k = (B + A) / 2
K = (B + A) % 2
if K == 0:
    print(k)
else:
    print("IMPOSSIBLE")

N = int(input())
A = list(int(x) for x in input().split())
B = list(int(x) for x in input().split())
a = 0
b = 0
for x in range(N):
    B[x] = B[x] + a
    if A[x] > B[x]:
        b = b + B[x]
        a = 0
    else:
        b = b + A[x]
        if A[x] > a:
            a = B[x] - A[x]
        else:
            a = B[x]
if A[N - 1] > B[N - 1]:
    print(b)
else:
    if A[N] > a:
        print(b + a)
    else:
        print(b + A[N])

A , B = (int(x) for x in input().split())
k = (B + A) / 2
K = (B + A) % 2
if K == 0:
    print(int(k))
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
# coding: utf-8

A,B = map(int, input().split())

if (A+B)%2 == 0:
  print((A+B)/2)
else:
  print("IMPOSSIBLE")

A, B = map(int, input().split())

if (A + B) % 2 == 0:
    print(int((A + B) / 2))
    
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
if abs(a-b)%2==0:
  print(abs(a-b)//2)
else:
  print('IMPOSSIBLE')

a,b = map(int,input().split())
if abs(a-b)%2==0:
  print(abs(abs(a-b)//2-a))
else:
  print('IMPOSSIBLE')

a,b = map(int,input().split())
if abs(a-b)%2==0:
  print(max(a,b)-abs(a-b)//2)
else:
  print('IMPOSSIBLE')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b=map(int, input().split())
if abs(a+b)%2==0:
    print(abs(a+b)/2)
else:
    print("IMPOSSIBLE")



a, b=map(int, input().split())
if (abs(a)+abs(b))%2 == 0:
    print(int((abs(a)+abs(b))/2))
else:
    print("IMPOSSIBLE")



Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
x, y = map(int, input().split())

if (x + y) % 2 == 0:
    print((x+y)/2)
else:
    print('IMPOSSIBLE')

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

if (x + y) % 2 == 0:
    print(round((x+y)/2))
else:
    print('IMPOSSIBLE')


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
ab = int(input().split())
a = ab[1]
b = ab[2]

mid2 = a + b
if mid2 % 2 == 0:
    mid = str(mid2 / 2)
   else:
    mid = 'IMPOSSIBLE'
    
print(mid)   

ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]

mid2 = a + b

if mid2 % 2 == 0:
    mid = mid2 / 2
  else:
    mid = 'IMPOSSIBLE'
    
print(mid)

ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]

mid2 = a + b

if mid2 % 2 == 0:
    mid = int(mid2 / 2)
else:
    mid = 'IMPOSSIBLE'
    
print(mid)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
#!/usr/bin/env python
# coding: utf-8

from collections import namedtuple

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def dist(pf, pt):
    return abs(pf[0]-pt[0]) + abs(pf[1]-pt[1])

def print_ans(sx, sy, ans):
    print(len(ans))
    for p in ans:
        print(sx*p[0], sy*p[1])

def move(k, pf, pt):
    assert(pt[1]>pf[1])
    d = min(pt[0]-pf[0], k)
    return [pf[0]+d,pf[1]+k-d]

def main():
    k = ri()
    x, y = rli()
    sx = 1 if x >= 0 else -1
    sy = 1 if y >= 0 else -1
    x = abs(x)
    y = abs(y)

    pf = [0, 0]
    pt = [x, y]
    if k % 2 == 0 and (x+y) % 2 == 1:
        print(-1)
        return
    d = dist(pf, pt)

    ans = []

    
    if d < k and d % 2 == 1:
        ans.append(((x+y-k)//2, (k+x+y)//2))
        ans.append((x+y-k, 0))
        ans.append((x, y))
        print_ans(sx, sy, ans)
        return

    n = (x+y+k-1) // k
    d = (n*k-(x+y))//2
    if d > 0:
        pf = [k-d, -d]
        ans.append(tuple(pf))
    while dist(pf, pt) > 0:
        pf = move(k, pf, pt)
        ans.append(tuple(pf))
    print_ans(sx, sy, ans)
    assert(pf[0] == x and pf[1] == y)



if __name__ == '__main__':
    main()


#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    a, b = rli()
    if (a + b) % 2 == 1:
        print("IMPOSSIBLE")
    else:
        print((a+b) // 2)


if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int,input().split())
if (A+B)%2 == 0:
  pint(int((A+B)//2))
else:
  print(('IMPOSSIBLE')

A,B = map(int,input().split())
if (A+B)%2 == 0:
  pint(int((A+B)//2))
else:
  print('IMPOSSIBLE')

A,B = map(int,input().split())
if (A+B)%2 == 0:
  print(int((A+B)//2))
else:
  print('IMPOSSIBLE')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a , b = map(int, input().split())
if (a+b)%2 == 0:
    print((a+b)/2)
else :
    print("IMPOSSIBLE")


a , b = map(int, input().split())
if (a+b)%2 == 0:
    print(int((a+b)/2))
else :
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())
sub = (a+b)/2
if sub % 1 != 0:
  print("IIMPOSSIBLE")
else:
  print(sub)

a, b = map(int, input().split())
sub = (a+b)/2
if sub % 1 != 0:
  print("IMPOSSIBLE")
else:
  print(int(sub))

Verdicts: Wrong Answer

Accepted