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=(int(x) for x in input().split())
C = int((A + B))

if(C%2 == 1):
    print("IMPOSSIBLE")
else:
    K = C / 2
    print(int(K))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    
    a, b = map(int,input().split())
    q, mod = divmod(a+b, 2)
    if mod == 0:
        print(q)
    else:
        print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

if (A+B)%2 ==0:
    if A <= (A+B)//2 <= B or B <= (A+B)//2 <= A:
        print((A+B)//2)
        exit()
print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import sys
# n=int(input())  #数値入力 「N」だけの入力のとき
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき
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:
N=list(map(int,input().split()))
#A=list(map(int,input().split()))
a=N[0]+N[1]
if a%2==0:
    print(int(a/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:
ab = input().split()
A, B = int(ab[0]), int(ab[1])

out = None
if A == B:
    out = None
elif A % 2 != B % 2:
    out = "IMPOSSIBLE"
else:
    K = (A+B) // 2
    if abs(A-K) == abs(B-K):
        out = K
    else:
        out = "IMPOSSIBLE"

print(out)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B=[int(x) for x in input().split()]
S=A+B
if S%2==0:
  print(S//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 = list(map(int,input().split()))
if sum(A) % 2 == 0:
    print(int(sum(A) / 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 = list(map(int,input().split()))

if (A+B)%2 == 0:
	print((A+B)//2)
	exit()
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('{}'.format(int((a+b)/2)))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

Solution code:
def iread():
    return int(input())


def sread():
    return input()


def aread_int():
    tmp = input().split()
    ret = [int(i) for i in tmp]
    return ret


def aread_str():
    return input().split()


if __name__ == '__main__':
    nums = aread_int()
    if (nums[0] + nums[1]) % 2:
        print("IMPOSSIBLE")
    else:
        ans = int(((nums[0] + nums[1]) / 2))
        print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())
ret = (a + b) // 2

# 出力
#if isinstance(ret, int):
if ret * 2 == a + b:
    print(ret)
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 = list(map(int, input().split()))

ans = (a + b)/2

if ans == int(ans):
    print(int(ans))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

def main():
    a, b = map(int,input().split())

    k = (a + b) / 2

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

# solve & output
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==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 == 0:
    print(c // 2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
a, b = [int(i) for i in 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())
if((a + b) % 2 == 1):
    print("IMPOSSIBLE")
else:
    ans = (a + b) // 2
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a,b = list(map(int, input().split()))
ab = abs(a-b)
_max = max(a,b)
print(_max - int(ab/2) if ab % 2 == 0 else "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 = [int(_) for _ in input().split()]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

c=a-b

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

Submission status: Accepted

Solution code:
import sys

n1, n2 = [int(i) for i in input().split()]

if (n1 % 2) != (n2 % 2):
    print("IMPOSSIBLE")
    sys.exit()

r1 = int((n1 + n2) / 2)
print(r1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def function(data):
    data = data.split(" ")
    a = int(data[0])
    b = int(data[1])
    if (a + b) % 2 == 1:
        print("IMPOSSIBLE")
    else:
        k = int((a + b) / 2)
        print(k)

if __name__ == '__main__':
  d = input()
  function(d)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
a , b = map(int,input().split())
ans = ( a + b ) % 2

if ans != 0:
    print("IMPOSSIBLE")

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc135/tasks/abc135_a
# A - Harmony
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(int((A + B) / 2))

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

s = a + b

if s%2 == 1:
    print("IMPOSSIBLE")
    exit()
print(s//2)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if a < b:
    A = a
    B = b
else:
    A = b
    B = a

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
c = (a + b) / 2
print(int(c) if c == int(c) else "IMPOSSIBLE")

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
a=A
b=B
if(A>B):
    a=b
    b=A

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

Submission status: Accepted

Solution code:
a, b = [int(w) for w in input().split()]
ans = 0
if (a - b) % 2 == 1:
    print("IMPOSSIBLE")
else:
    print(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:
print((lambda x: x%2<1 and int(x/2) or 'IMPOSSIBLE')(sum([int(i)for i in input().split(' ')])))

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

Submission status: Accepted

Solution code:
P, Q = map(int, input().split())

A = (P + Q) / 2
if (P+Q)%2 != 0:
    print("IMPOSSIBLE")
else :
    print(round((P+Q)/2))

Submission status: Accepted

Solution code:
L,R = map(int,input().split())

ans = (L+R)/2

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
 // Author : snape_here - Susanta Mukherjee
 // Date : 27/07/2019

"""
from __future__ import division, print_function
import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    _str = str
    str = lambda x=b"": x if type(x) is bytes else _str(x).encode()

    
#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
from math import ceil,floor,log,sqrt,factorial,pow,pi
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *,threading


# For getting input from input.txt file 
#sys.stdin = open('input.txt', 'r')  
  
# Printing the Output to output.txt file 
#sys.stdout = open('output.txt', 'w') 

def ii(): return int(input())
def fi(): return float(input())
def si(): return str(input())
def mi(): return map(int,input().split())
def li(): return list(mi())

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

# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        if self.buffer.tell():
            return self.buffer.read()
        return os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", b" "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", b"\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b"\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

a, b = [int(x) for x in input().split(' ')]

if not abs(a - b) % 2:
    print(int(abs(a - b) / 2 + min(a, b)))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = [int(i) for i in 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 - 2*b)
if((k % 1) == 0):
    print(int(k))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
#t = [int(input()) for i in range(3)] 
# W = int(input()) 
# count = 0
a, b= (int(i) for i 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())
K=(A+B)>>1
if abs(A-K) == abs(B-K):
  print(K)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
arr =input().split(" ")
nums = int(arr[0]) + int(arr[1])
if( (nums%2) == 0):
	print(nums//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
m = (a+b)>>1
if abs(a-m) == abs(b-m):
	print(m)
else:
	print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  a, b = [int(_) for _ in input().split()]
  
  if (a+b) % 2 == 0:
    x = (a+b)/2
    print("{:.0f}".format(x))
    
  else:
    print("IMPOSSIBLE")
main()

Submission status: Accepted

Solution code:
s = input().split()

k = (int(s[0]) + int(s[1]))

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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()))
K = (A+B)/2
if K - int(K) == 0:
    print(int(K))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

k = (a + b) / 2

if (k - int(k)) == 0:
    print(int(k))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = (b + c) / 2
e = (b + c) % 2

if e > 0:
	print("IMPOSSIBLE")
else:
 	print(  "%d" % d )

Submission status: Accepted

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


if __name__ == "__main__":
    main()

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 = [int(d) for d in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

numbers = input().split(" ")
a = int(numbers[0])
b = int(numbers[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

if( ( a +  b ) % 2 != 0 ):
  print("IMPOSSIBLE")
else:
  k = int((b*b - a*a)/(2*(b - a)))
  print('{}'.format(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, b = map(lambda x: int(x), input().split(' '))
k = (a + b) / 2
print(int(k)) if k % 1 == 0 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:
A, B = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    A, B = MAP()
    if (A + B) % 2:
        print('IMPOSSIBLE')
    else:
        print(int((A + B) / 2))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

# 中点が整数であるかどうかを確認する
c = (a+b) / 2 
if c != round(c):
  print('IMPOSSIBLE')
else:
  print(int(c))

Submission status: Accepted

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

if c%2==0: 
    print(int(c/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:
A,B =  map(int,input().split())

K = (A+B)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

# print(A)
# print(B)

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

Submission status: Accepted

Solution code:
ab = input().split()
a = int(ab[0])
b = int(ab[1])
 
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 = [int(_) for _ in input().split()]
if (A + B) % 2:
    print('IMPOSSIBLE')
else:
    print((A + B) // 2)

Submission status: Accepted

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

if a == 0 and b == 0:
  print('IMPOSSIBLE')

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if (a - b) % 2 != 0:
    print("IMPOSSIBLE")
elif a >= b:
    print(int(a-((a-b)/2)))
else:
    print(int(b-((b-a)/2)))