Problem:


Score: 100 points

Problem Statement

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.

Constraints

All values in input are integers.

0 \leq A,\ B \leq 10^9

A and B are distinct.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the integer K satisfying the condition.

If such an integer does not exist, print IMPOSSIBLE instead.

Sample Input 1

2 16

Sample Output 1

9

|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.

Sample Input 2

0 3

Sample Output 2

IMPOSSIBLE

No integer satisfies the condition.

Sample Input 3

998244353 99824435

Sample Output 3

549034394



Sample input:
2 16


Sample output:
9

Submission status: Time Limit Exceeded

Solution code:
from heapq import heappush, heappop
from collections import deque
import itertools
from itertools import permutations
import sys
import bisect
sys.setrecursionlimit(10**6)
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
YNeos='YNeos'
mo=10**9+7
imp='IMPOSSIBLE'


n,m=MI()
ans=(n+m)//2 if (n-m)%2==0 else imp
for n in range(n):
    0

print(ans)

Submission status: Memory Limit Exceeded

Solution code:
import numpy as np
A=np.ones(1<<27,dtype=np.int64)

Submission status: Memory Limit Exceeded

Solution code:
import random

r = random.randint(1,3)
if r == 1:
  # TLE
  import time
  time.sleep(100000)
elif r == 2:
  # MLE
  x = '01234567' * (1 << 27)
else:
  # RE
  RE

Submission status: Memory Limit Exceeded

Solution code:
import random

r = random.randint(1,3)
if r == 0:
  # TLE
  import time
  time.sleep(100000)
elif r == 1:
  # MLE
  x = '01234567' * (1 << 27)
else:
  # RE
  RE

Submission status: Memory Limit Exceeded

Solution code:
import numpy as np
A = np.arange(1<<27, dtype=np.int64)

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

Submission status: Accepted

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


ans = (a+b)/2

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
K = (A + B) // 2
if abs(K - A) != abs(K - B):
  print('IMPOSSIBLE')
else:
  print(K)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
K = A + B

if K%2 == 0:
  print(K//2)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC135 A

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    a,b = map(int,input().split())
    if a%2 != b%2:
        print('IMPOSSIBLE')
    else:
        print((a+b)//2)
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a == - b :
    print('IMPOSSIBLE')
elif (a+b)//2 != (a+b)/2:
    print('IMPOSSIBLE')
else:
    print((a+b)//2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
A = a[0]
B = a[1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
K = (A + B) // 2
if abs(A - K) == abs(K - B):
    print(K)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################
    
def solve():
    a,b = invr()
    if abs(a - b) % 2 == 0:
        print((a + b) // 2)
    else:
        print("IMPOSSIBLE")
    
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    
#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 
#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#
def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)

def counter_elements(a):
    q = dict()
    for i in range(len(a)):
        if a[i] not in q:
            q[a[i]] = 0
        q[a[i]] = q[a[i]] + 1
    return(q)

def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97],1
    return(q)
 
def factors(n):
    q = []
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0: q.append(i); q.append(n // i)
    return(list(sorted(list(set(q)))))
 
def prime_factors(n):
    q = []
    while n % 2 == 0: q.append(2); n = n // 2
    for i in range(3,int(n ** 0.5) + 1,2):
        while n % i == 0: q.append(i); n = n // i
    if n > 2: q.append(n)
    return(list(sorted(q)))

def transpose(a):
    n,m = len(a),len(a[0])
    b = [[0] * n for i in range(m)]
    for i in range(m): 
        for j in range(n): 
            b[i][j] = a[j][i]
    return(b)

#-----------------------------------------------------------------------#
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if A > B:
  A, B = B, A
if abs(A - B) % 2 != 0:
  print("IMPOSSIBLE")
  exit()
print(A + (abs(A-B) // 2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a= list(map(int,input().split()))
if (a[0]+a[1]) % 2 == 0:
  print((a[0]+a[1])//2)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B = LI()

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
k = (a * a - b * b) / (2 * a - 2 * b)
if k == int(k):
    print(int(k))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    A, B = map(int, readline().split())
    A, B = min(A, B), max(A, B)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = [int(v) for v in input().split()]
if abs(a-b) % 2 == 0:
    print(int((max(a,b)+min(a,b))/2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=sorted(list(map(int,input().split())))
if a[1]%2==a[0]%2:
  print(a[0]+(a[1]-a[0])//2)
else:
  print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
x=(A**2-B**2)/(2*(A-B))
if x%1==0:
    print(int(x))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
tokens = itertools.chain.from_iterable(map(str.split, sys.stdin))

no = 'IMPOSSIBLE'
a = int(next(tokens))
b = int(next(tokens))

# k = (a^2 - b^2) / {2 (a - b)}
k = (a**2 - b**2) // (2 * (a - b))
if abs(a - k) != abs(b - k):
    print(no)
else:
    print(k)

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print('IMPOSSIBLE' if (a ^ b) & 1 else (a + b) >> 1)

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math

#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
a,b = readInts()
print((a+b)//2 if (a+b)%2 == 0 else 'IMPOSSIBLE')

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
# a - k = -b + k or b - k
# a + b == 2k or a - b = 0
if a == b:
    print(0)
elif (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if A > B: A, B = B, A
if (B - A) & 1:
    print('IMPOSSIBLE')
    exit()
print(A + (B - A) // 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
if (a-b)%2 == 1:
    print('IMPOSSIBLE')
else:
    ans = abs(a-b)//2 + min(a,b)
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
K=(A**2-B**2)/(2*(A-B))
if K%1==0:
  print(int(K))
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=[int(x) for x in input().split()]
k=(a+b)//2
if (a+b)%2==0:
  print(k)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
summ = n + k
if summ % 2 != 0:
    print('IMPOSSIBLE')
else:
    print(summ//2)

Submission status: Accepted

Solution code:
a, b = [int(n) for n in input().split()]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if A == B:
    print(0)

elif (A+B)%2 == 0:
    print((A+B)//2)

else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
s=x+y
if(s%2==0):
    print(s//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def main():
    A, B = map(int, input().split())

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc135/tasks/abc135_a

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = sorted(map(int, input().split()))
if a - b == 2 * int((a - b) / 2):
    print(int((a + b) / 2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
a,b = ma()
k2 = abs(b-a)
if k2%2==0:
    print(k2//2+min(b,a))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
nums = list(map(int,input().split()))
A = nums[0]
B = nums[1]
if abs(A-B) % 2 != 0:
  print("IMPOSSIBLE")
else:
  mini = min(A,B)
  print((A+B)//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
x = max(a, b)
y = min(a, b)
if (x - y) % 2:
  print("IMPOSSIBLE")
else:
  print(y + int((x - y) / 2))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
print(min(A,B)+abs(A-B)//2 if abs(A-B)//2*2==abs(A-B) else 'IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

ans=(a+b)//2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    k = (a+b) / 2

    if k==int(k):
        print(int(k))
    else:
        print('IMPOSSIBLE')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if A < B:
    A, B = B, A
if A==B:
    print(0)
elif (A+B)%2 == 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
if (N+M)%2==0:
  print((N+M)//2)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

if A % 2 == B % 2:
    K = abs(B - A) / 2
    if A > B:
        print(A - math.ceil(K))
    else:
        print(B - math.ceil(K))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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