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

Solution code:
#!/usr/bin/env python3

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4


def main():
    mod = 1000000007                  # 10^9+7
    inf = float('inf')
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    a, b = mi()
    print('IMPOSSIBLE') if (a + b) % 2 == 1 else print((a + b) // 2)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
X = A + B
if X % 2 == 0:
    print(X // 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+b)//2
if((a+b)%2==0):
    print(k)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

if abs(A-K) == abs(B-K):
  print(K)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
K = (A**2-B**2)//(2*(A-B))

if abs(A-K) == abs(B-K):
  print(K)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

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())
if (a%2 == 0 and b%2 == 0) or (a%2 != 0 and b%2 != 0):
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
icase=0
if icase==0:
    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==(a+b)/2: print((a+b)//2)
else: print('IMPOSSIBLE')

Submission status: Accepted

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

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

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
a,b = map(int,input().split())
k = (a+b) // 2
if abs(a-k) == abs(b-k):
    print(k)
    
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
x = a + b
if x % 2 == 0:
    print(x // 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=list(map(int,input().split()))
a.sort()


if (a[1]-a[0])%2==0:
    print(int((a[1]-a[0])/2+a[0]))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

if tmp % 2 == 0:
    print(int(tmp/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  = list(map(int, input().split()))
b = abs(a[0] - a[1])
 
if b % 2 == 0:
  print(max(a[0], a[1]) - 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 == 0:
    print((a+b) // 2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
K = 0
L = (A + B) 
if L % 2 == 1:
    print("IMPOSSIBLE")
else:
    print(L // 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:
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())
k=(a+b)/2
if int(k)<(a+b)/2:
    print('IMPOSSIBLE')
else:
    print(int(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, raw_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 % 2 + b % 2) % 2 == 1:
	print('IMPOSSIBLE')
else:
	print(min(a,b) + (max(a,b) - min(a,b)) // 2)

Submission status: Accepted

Solution code:
a, b = list(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+b) % 2 == 0:
  print((abs(a)+abs(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:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p = lambda x: print(x)


a,b = MI()
if a%2 != b%2:
    p("IMPOSSIBLE")
else:
    p(int((a+b)/2))

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=[int(x) for x in input().rstrip().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('{:.0f}'.format((a+b)/2))
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
[A,B] = list(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())

X = min(A,B)
Y = max(A,B)

n = Y - X

if n%2 == 1:
  print("IMPOSSIBLE")
else:
  print(X+(n//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:
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')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math
import collections
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

a,b=MI()
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) % 1 == 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((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:
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
print(int(ans) if ans % 1 == 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:
import math
A, B = map(int, input().split())
K = (A + B)
if K % 2 == 0:
    print(math.floor(K/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%2 == b%2 else '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 = map(int, input().split())

ans = (A+B)/2

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A= list(map(int,input().split()))
if (A[0]+A[1])%2 == 0:
    print(int((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((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((a + b) // 2)

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:
def q1():
    A, B = (int(i) for i in input().split())
    d,m = divmod(A+B, 2)
    if m == 1:
        print('IMPOSSIBLE')
    else:
        print(d)


if __name__ == '__main__':
    q1()

Submission status: Accepted

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

average = lambda a, b: (a + b) / 2

ave = average(A, B)
answer = int(ave) if ave.is_integer() else 'IMPOSSIBLE'

print(answer)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
Amod2 = A%2
Bmod2 = B%2
if (Amod2 == Bmod2):
    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 abs(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(int((a + b) / 2))
    exit()
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%2 == b%2:
    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 (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= input().split()
a, b= int(a),int(b)
eq= (a+b)//2
eq2=(a+b)%2
if eq2==0:
	print(eq)
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 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( int((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 a%2 != b%2:
    print("IMPOSSIBLE")
    exit()
print((a**2-b**2)//((2*a)-(2*b)))

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==1:
    print('IMPOSSIBLE')
else:
    print((a+b)//2)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    A, B = input_nums()
    if A == B:
        ans = 0
    else:
        if (A+B)%2 == 0:
            ans = (A+B)//2
        else:
            ans = 'impossible'.upper()
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
print(str(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(int((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:
# coding: utf-8
# Your code here!
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 = (a+b)/2
if c.is_integer():
  print(int(c))
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
# ABC 135: A – Harmony
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 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==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:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')

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

Submission status: Accepted

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

Submission status: Accepted

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

x = abs(a-b)

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

Submission status: Accepted

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

if N % 2 == 0:
    print((A+B)//2)
elif N % 2 != 0:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
m = (A+B)/2
if int(m)==m:
    print(int(m))
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 == 1):
    print('IMPOSSIBLE')
else:
    print((a+b)//2)

Submission status: Accepted

Solution code:
import sys

a, b = map(int, sys.stdin.readline().split())

def main():
    d = abs(b - a)
    if d & 1:
        ans = "IMPOSSIBLE"
    else:
        ans = min(a, b) + d // 2
    print(ans)

if __name__ ==  '__main__':
    main()

Submission status: Accepted

Solution code:
import itertools
import fractions
def main():
  a,b = map(int,input().split())
  print((a+b)//2 if (a+b)%2 == 0 else 'IMPOSSIBLE')
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
D=(A-B)/2

if (A-B)//2==D:
  if D<0:
    D=D*(-1)
  print(max(A,B)-int(D))
else:
  print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

    if A > B:
        A,B = B,A
    k = A + (abs(A-B) // 2)

    if abs(A - k) == abs(B - k):
        print(k)
    else:
        print('IMPOSSIBLE')


if __name__ == "__main__":
    main()

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())
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 abs(a-b)%2 == 1:
  print("IMPOSSIBLE")
else:
  print(int((a+b)/2))

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

a,b = iim()
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(abs(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())
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((a + b) // 2)
else:
     print('IMPOSSIBLE')

Submission status: Accepted

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

K=(A+B)/2

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((a+b) // 2)
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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())
a=A+B
if a%2==1:
  print('IMPOSSIBLE')
else:
  print(a//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)%1 == 0:
  print(int((A+B)/2))
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import os, sys, re, math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(s) for s in input().split(' ')]
K = abs(A + B)
print('IMPOSSIBLE' if K % 2 else K // 2)

Submission status: Accepted

Solution code:
import os, sys, re, math

(A, B) = [int(n) for n in input().split()]

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

Submission status: Accepted

Solution code:
import sys
A,B = [int(s) for s in input().split()]

if abs(A-B) % 2 != 0:
  print('IMPOSSIBLE')
  sys.exit()
  
print((A + B) // 2)

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]
small = min(b, a)
range = abs(b - a)
if range / 2 != int(range / 2):
	print ('IMPOSSIBLE')
else:
	print (int(small + range / 2))

Submission status: Accepted

Solution code:
a, b = list(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==1:
    print('IMPOSSIBLE')
else:
    print((a+b)//2)

Submission status: Accepted

Solution code:
#A
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 abs(a-k) == abs(b-k):
    print(k)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=sum(map(int,input().split()));print('IMPOSSIBLE' if s%2 else s//2)

Submission status: Accepted

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

K = A+B

print(K//2 if K//2 == K/2 else 'IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

k = (A + B) / 2

answer = 0

if A != B and (A + B) % 2 == 0 and (A - k) * (B - k) < 0:
	print(int(k))
else:
	print("IMPOSSIBLE")

Submission status: Accepted

Solution code:

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

answer = 0
K= (A+B)/2

if A!= B and (A+B)%2 == 0 and (A-K)*(B-K)<0:
	print(int(K))
else:
  	print("IMPOSSIBLE")

Submission status: Accepted

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

if a > b:
  K = a+b
else:
  K = b+a

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

Submission status: Accepted

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
answer = (A+B) / 2
if int(answer) != answer:
    print('IMPOSSIBLE')
else:
    print(int(answer))

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:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
a,b = map(int,input().split())

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

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

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

if (a - b) % 2 == 0:
    print(int(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(abs(A+B)//2)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
print("IMPOSSIBLE" if (a+b)%2==1 else (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==1:
  print("IMPOSSIBLE")
else:
  print((A+B)//2)

Submission status: Accepted

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

# aとbの差が奇数かどうか判定
if diff%2 == 1:
    print("IMPOSSIBLE")
else:
    print(int((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=a+b
d=c//2 if c%2==0 else 'IMPOSSIBLE'
print(d)

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = list(map(int, sys.stdin.buffer.readline().split()))
    print((A+B)//2 if (A+B)%2 == 0 else 'IMPOSSIBLE')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b = [int(x) for x in 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())
if (a+b) % 2 == 0:
    print(round((a+b)/2))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if((A+B)//2 == (A+B)/2):
    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")