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

k = (a**2-b**2)/(2*(a-b))

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

Submission status: Accepted

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

if abs(b-a)%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:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())

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

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

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:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    A,B = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    if (A+B)%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=list(map(int,input().split()))
if a==b:
  print(0)
else:
  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=sorted(list(map(int,input().split())))
a=A[0]
b=A[1]
if (b-a)%2==0:
    print(a+(b-a)//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tmp = input().split(" ")

A = int(tmp[0])
B = int(tmp[1])

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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:
# -*- coding: utf-8 -*-

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:
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 ** 2 - b **2) / 2 / (a - b)

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
# abc135_a.py
# https://atcoder.jp/contests/abc135/tasks/abc135_a

# A - Harmony /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 相違なる整数 A, Bがあります。
# |A−K|=|B−K|となるような整数 Kを出力してください。
# そのような整数が存在しなければ、代わりに IMPOSSIBLE を出力してください。

# 制約
#     入力は全て整数である。
#     0≤A, B≤109
#     Aと Bは相違なる。

# 入力
# 入力は以下の形式で標準入力から与えられる。
# A B

# 出力
# 条件を満たす整数 Kを出力せよ。
# そのような整数が存在しなければ、代わりに IMPOSSIBLE を出力せよ。

# 入力例 1
# 2 16

# 出力例 1
# 9

# |2−9|=7, |16−9|=7 であるため、9は条件を満たす整数です。

# 入力例 2
# 0 3

# 出力例 2
# IMPOSSIBLE

# 条件を満たす整数は存在しません。

# 入力例 3
# 998244353 99824435

# 出力例 3
# 549034394


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    A, B = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

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

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2 16']
        lines_export = [9]
    if pattern == 2:
        lines_input = ['0 3']
        lines_export = ['IMPOSSIBLE']
    if pattern == 3:
        lines_input = ['998244353 99824435']
        lines_export = [549034394]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if A==B:
  print(0)
else:
  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())
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())

k = a + b

if k % 2 == 0:
    print(int(k / 2))

else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
K=(A+B)/2
if(K.is_integer()==True):
  print(int(K))
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import sys
import math

def input():
    return sys.stdin.readline().rstrip()


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



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=input().split()
A=int(n[0])
B=int(n[1])
K=int((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:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
#Good question
import sys
A,B = map(int,input().split())

if not ( 0 <= A <= 10**9 and 0 <= B <= 10**9 ): sys.exit()

if A % 2 != B % 2:
    print('IMPOSSIBLE')
    sys.exit()
else:
    print(int((A+B)/2))

Submission status: Accepted

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

s = a+b

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

Submission status: Accepted

Solution code:
import sys

[A, B] = [int(x) for x in sys.stdin.readline().split(" ")]
sum = A + B
if sum % 2 == 0:
    print(int(sum / 2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

K = (A+B) / 2
if (A-K) * (B-K) < 0 and K == int(K):
    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())
res = 0
c = a+b
if c % 2 == 1:
  print("IMPOSSIBLE")
else:
  res = int(c/2)
  print(res)

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

Submission status: Accepted

Solution code:
def main():
 a,b = map(int,input().split())
 if abs(a + b) % 2 == 0:
     print(abs(a + b) // 2)
 else:
     print('IMPOSSIBLE')
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())
c=b-a
if c%2==1:
  print("IMPOSSIBLE")
else:
  print(a+int(c/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(min(a,b)+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())

temp = A+B
if temp%2!=0:
  print("IMPOSSIBLE")
else:
  print(temp//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, x =map(int, input().split())
if (a+x)%2 ==0:
  print(int((a+x)/2))
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 = list(map(int, input().split()))

c = ((a**2) - (b**2)) 
d = 2*(a-b)
e = c/d

if int(e) == e:
    print(int(e))
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(round(k))
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:
# abs(a-k)==abs(b-k)
# a-k+b-k=0 or a-k-b+k=0
# a!=bから左
# a+b==2k

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

c=a+b

if c%2==1:
  print("IMPOSSIBLE")
else:
  print(c//2)

Submission status: Accepted

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

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(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:
import sys, math
from collections import defaultdict
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

A, B = rl()

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(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( (A+B)//2 )
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
A, B = [int(i) for i in 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+B)%2==0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

    
if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

flg = False
if (b - a) % 2 == 0:
    flg = True

print((a+b)//2) if flg else print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

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

Submission status: Accepted

Solution code:
# from collections import Counter
# n = int(input())
# li = list(map(int, input().split()))
a, b = map(int, input().split())
print(a+(b-a)//2 if not (b-a)&1 else "IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#create date: 2020-07-05 10:44

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    a, b = na()
    if a > b:
        a, b = b, a
    if (b - a) % 2 != 0:
        print("IMPOSSIBLE")
        quit()
    else:
        print(a + (b-a)//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:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b = rm()
if a & 1 == b & 1:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
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())

c = A + B

K = c // 2



if (c % 2) != 0 :
    print("IMPOSSIBLE")

else:
    print(K)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    a, b = map(int, input().split())
    if (a - b) % 2 == 0:
        print(abs(a - b) // 2 + min(a, b))
    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())
if (a - b) % 2 == 0:
  print(a-(a-b)//2)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

A, B = map(int, sys.stdin.readline().split())
if abs(A - B) % 2 == 0:
    print((A + B) // 2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
c = eval(input().replace(" ", "+"))
print(c // 2 * (c % 2 < 1) or "IMPOSSIBLE")

Submission status: Accepted

Solution code:
a,b = [int(a) for a in input().split()]
k = (a+b)/2
if k==int(k):
  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=eval(input().replace(*' +'))
print(a%2*'IMPOSSIBLE'or a//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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 print("IMPOSSIBLE")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
half=(a+b)/2
if half.is_integer():
  print(int(half))
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 = [int(i) for i in input("").split(" ")]
if a%2 != b%2:
  print('IMPOSSIBLE')
else:
  print(int((a+b)/2))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if (b - a) % 2 == 0:
  print(int(min([a, b]) + (max([a, b]) - min([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:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

a, b = arr[0], arr[1]

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=abs((A+B)/2)
if K.is_integer()==True:
    print(int(K))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
K = (A+B)/2
if K.is_integer():
    print(int(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((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 = (int(x) for x in input().split())

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

else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
inp1,inp2=map(int, input().split())
value=inp1+inp2
if value%2==0:
    print(int(value/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:
# 135 A

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a=sys.stdin.readline()
res=[i for i in a.split()]
r1,r2=float(res[0]),float(res[1])
v1,v2=r1.is_integer(),r2.is_integer()
if v1==v2==True:
    A,B=int(r1),int(r2)
    if 0<=(A and B)<=1000000000:
        w=(A+B)/2
        v3=w.is_integer()
        if v3==True:
            print(int(w))
        elif v3!=True:
            print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

if ((x+y)%2 == 1):
      print("Impossible".upper())
else:
      print((x+y)//2)

Submission status: Accepted

Solution code:
# Sol : (n1 + n2)/2
# Ex : 
# Q : 16 - x = 2 - x
# => 16 + x = 2 + x
# => 16 + 2 = 2x
# => 18/2 = x
# => 9 = x
a = list(map(int, input().split()))
if ((a[0] + a[1]) // 2) * 2 != a[0] + a[1]:
    print("IMPOSSIBLE")
else:
    print(((a[0] + a[1]) // 2))