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:
def main():

    """ convenient functions
    # for i, a in enumerate(iterable)
    # q, mod = divmod(a, b)
    # divmod(x, y) returns the tuple (x//y, x%y)
    # Higher-order function: reduce(operator.mul, xyz_count, 1)
    # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f
    """

    """convenient decorator
    # @functools.lru_cache():
    # to facilitate use of recursive function
        # ex:
        # from functools import lru_cache
        # import sys
        # sys.setrecursionlimit(10**9)
        # @lru_cache(maxsize=None)
        # def fib(n):
        #     if n < 2:
        #         return n
        #     return fib(n-1) + fib(n-2)
        # print(fib(1000))
    """
    
    # import numpy as np
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html
    # accumulate() returns iterator! to get list: list(accumulate())
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  # prime factor
        b, e = 2, 0  # base, exponent
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        # TODO: How should I do when n - r is negative?
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html
    from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html
    import operator
    from operator import itemgetter
    # ex1: List.sort(key=itemgetter(1))
    # ex2: sorted(tuples, key=itemgetter(1,2))
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    # first create factorial_list
    # fac_list = mod_factorial_list(n)
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!
    def modinv(a, p = MOD):
        # evaluate reciprocal using Fermat's little theorem:
        # a**(p-1) is identical to 1 (mod p) when a and p is coprime
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        # fac_list = modfactorial_list(100)
        # print(modcomb(100, 5, modfactorial_list(100)))
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    class UnionFindTree:
        """union find tree class
        TODO: fix this description...
        how to use (example):
        >>  uf = UnionFindTree(N) 
        >>  if uf.find_root(a) == uf.find_root(b):
        >>      do something
        >>  else:
        >>      do something
        >>      uf.unite(a, b)
        """
        def __init__(self, N):
            self.root = [-1] * (N+1)
            self.rank   = [0]  * (N+1)
            self.connected_num = [1] * (N+1)
    
        def find_root(self,x):
            root = self.root
            while root[x] != -1:
                x = root[x]
            return x
    
        def unite(self,x,y):
            root = self.root
            rank = self.rank
            connected_num = self.connected_num
            find_root = self.find_root
    
            rx = find_root(x)
            ry = find_root(y)
            if rx != ry:
                if rank[rx] < rank[ry]:
                    root[rx] = ry
                    rx,ry = ry,rx
                else:
                    if rank[rx] == rank[ry]:
                        rank[rx] += 1
                    root[ry] = rx       
                connected_num[rx] += connected_num[ry]

    """ initialize variables and set inputs
    # initialize variables
        # to initialize list, use [0] * n
        # to initialize two dimentional array, use [[0] * N for _ in range(N)]
    # set inputs
        # open(0).read() is a convenient method:
        # ex) n, m, *x = map(int, open(0).read().split())
        #     min(x[::2]) - max(x[1::2])
        # ex2) *x, = map(int, open(0).read().split())
        #     don't forget to add comma after *x if only one variable is used
    # preprocessing
        # transpose = [x for x in zip(*data)]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
        # flat = [flatten for inner in data for flatten in inner]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]
    # calculate and output
        # output pattern
        # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6
    """

    # functions used
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    # single int: int(r())
    # single string: r()
    # single float: float(r())
    # line int: R()
    # line string: r().split()
    # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]
    # lines int: [R() for _ in range(n)]
    """

    if __name__ != '__main__':
        # for test
        sys.stdin = open('sample.txt')
        
    # ----------------------------------
    # main

    A, B = R()
    if (A+B) % 2 != 0:
        print('IMPOSSIBLE')
    else:
        print((A+B)//2)
    
    # end of main
    # ----------------------------------

    """memo: how to use defaultdict of list
    # initialize
    Dic = defaultdict(list)
    # append / extend
    Dic[x].append(y)
    # for
    for k, v in Dic.items():
    """
    
    """memo: how to solve binary problems
    # to make binary digits text
    >>> a = 5
    >>> bin_str_a = format(a, '#06b')
    >>> print(bin_str_a)
    0b0101 # first 2 strings (='0b') indicates it is binary
    """

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

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 (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 == 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 = list(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==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 = [int(i) for i in raw_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:
num = list(map(int, input().split()))
A = num[0]
B = num[1]
if (A+B)%2 == 0:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 28 15:26:59 2019

@author: sp8783
"""

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 = list(map(int, input().split()))
 
A = int(AB[0])
B = int(AB[1])
 
if A%2 == 0 and B%2 == 0:
    print(int((A+B)/2))
elif A%2 == 1 and B%2 == 1:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
str = input().split()
a = int(str[0])
b = int(str[1])
c = a + b
if c % 2:
	print('IMPOSSIBLE')
else:
	print(round((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())
c = a + b
if c % 2:
    print('IMPOSSIBLE')
else:
    print(int(c / 2))

Submission status: Accepted

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

Submission status: Accepted

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

k = 0
cleared = True
if abs(b-a) % 2 == 0:
    if a < b:
        k = a + abs(b-a)//2
    else:
        k = b + abs(b-a)//2
else:
    cleared = False

if cleared:
    print(k)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

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



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

L = A + B
if L % 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<0 or B<0 or B >10**9 or A > 10**9 or A==B:
	print ('Illegal')
else:
	if (A-B)%2!=0:
		print ('IMPOSSIBLE')
	else:
		print(int((A+B)/2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list_input = input().split(" ")
A = int(list_input[0])
B = int(list_input[1])
K = (A+B)/2
if K == int(K):
  print(int(K))
else:
  print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
def solve(a, b):
    k = (a + b) // 2
    return k if abs(a-k) == abs(b-k) else "IMPOSSIBLE"

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

Submission status: Accepted

Solution code:
#abc135a

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

Submission status: Accepted

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

for l in sys.stdin:
    A, B = map(int, l.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:
x,y = map(int,input().split())
if (x + y) % 2 == 1:
  print("IMPOSSIBLE")
else:
  c = (x + y) /2
  print(int(c))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
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:
def main():
  a, b = map(int, input().split())
  c  = abs((b+a)/2)
  if c.is_integer() == True:
    print(int(c))
  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 = (int(i) for i in input().split())
if (a+b)%2: print("IMPOSSIBLE")
else: print((a+b)//2)

Submission status: Accepted

Solution code:
class ABC135:
    def __init__(self):
        pass

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

if __name__ == '__main__':
    A, B = map(int, input().split())
    problem = ABC135()
    problem.solve(A, B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: UTF-8

i = list(map(int, input().split()))

A = i[0]
B = i[1]
K = (A+B)/2

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

Submission status: Accepted

Solution code:
def result(m, n):
    average = (m+n)/2
    if int(average)==average:
        return int(average)
                
m, n = input().split(" ")
m = (int(m))
n = (int(n))
res = result(m, n) 
if res == None:
    print("IMPOSSIBLE")
else:
    print(res)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

#n = int(input())
a, b = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = input()
#list = list(s)

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
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(lambda x: int(x), 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(" "))
x = (a + b)/2
if(int(x) == x):
    print(int(x))
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==1):
    print("IMPOSSIBLE")
else:
    print((a+b)//2)

Submission status: Accepted

Solution code:
_l = input().split()
_s = sum([int(i) for i in _l])
if _s % 2 != 0:
    print('IMPOSSIBLE')
else:
    print(int(_s / 2))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; ansli = []; tmpli = []; candili = []
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]#WideIntPoint
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]#HeightString
def mi(n): return [wi() for _ in range(n)]#MatrixInt
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]

a, b = wi()
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())
k=(A**2-B**2)/(2*A-2*B)
if k == int(k):
  print(int(k))
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

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 abs(A-B)%2==0:
    print((max(A,B)+min(A,B))//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

raw_input = sys.stdin.readline

f = lambda : raw_input().rstrip()    
f1 = lambda : f().split()
f2 = lambda t: map(t,f1())

def main1():
    a,b = f2(int)
    if (a+b)%2 == 0:
       print (a+b)/2
    elif a == b:
       print 0
    else:
       print "IMPOSSIBLE"

def main2():
    n = int(f)
    a = f2(int)
    b = sorted(a)
    m = 0
    for i in xrange(n):
        if a[i] != b[i]:
            m = m + 1
    if m<2:
        print "YES"
    else:
        print "NO"

def main3():
    n = int(f())
    a = f2(int)
    b = f2(int)
    ans = 0
    for k in xrange(n):
        if a[i] >= b[i]:
            ans = ans + b[i]
        elif a[i] < b[i] :
            ans = ans + a[i]
            b[i] = b[i] - a[i]
            ans = ans + min(a[i+1], b[i])
            a[i+1] = a[i+1] - b[i]  
    print ans 
 
def main4():
    pass
    
    
if __name__ == "__main__":
    main1()

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

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
if a<b:
  a,b=b,a
#a>b is assured.
k=(a+b)/2
if k%1==0 and b<k<a:
  print(int(k))
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())

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

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:
import statistics
import sys
import math
INPUT = sys.stdin.readline
#入力関数
def SORO_INT(): return int(INPUT())
def MULT_INT_LIST(): return list(map(int, INPUT().split()))
def MULT_INT_MAP(): return map(int, INPUT().split())
def SORO_STRING(): return INPUT()
def MULT_STRING(): return INPUT().split()
 
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False
    
A = MULT_INT_LIST()
mean = statistics.mean(A)
 
if is_integer_num(mean):
  print(int(mean))
else:
  print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if((x+y)%2==0):
  print((x+y)//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:
#! /usr/bin/python
# -*- encoding: utf-8 -*-

import sys

if __name__ == '__main__':
    input = list(map(int, input().split()))
    inputA = input[0]
    inputB = input[1]
    
    if inputA < 0:
        sys.stdout.write("IMPOSSIBLE")
        sys.exit()
    
    if inputB < 0:
        sys.stdout.write("IMPOSSIBLE")
        sys.exit()

    if inputA == inputB:
        sys.stdout.write("IMPOSSIBLE")
        sys.exit()

    if (inputA + inputB) % 2 == 0:
        sys.stdout.write(str(int((inputA + inputB) / 2)))
        sys.exit()
      
    sys.stdout.write("IMPOSSIBLE")
    sys.exit()

Submission status: Accepted

Solution code:
inp = input().split(" ")
a = int(inp[0])
b = int(inp[1])
 
c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
 
  m = (max(abs_a, abs_b) - min(abs_a, abs_b)) /2
  ans = max(abs_a, abs_b) - m
  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:
# -*- coding: utf-8 -*-
import math

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

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

Submission status: Accepted

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

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

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:
    if (A-B)%2 != 0:
        print("IMPOSSIBLE")
    else:
        print(A - ((A-B)//2))
else:
    if (B-A)%2 != 0:
        print("IMPOSSIBLE")
    else:
        print(B - ((B-A)//2))

Submission status: Accepted

Solution code:
import sys

def main():
    A,B = tuple(map(int, sys.stdin.readline().split()))
    ans = (A+B)/2
    if ans.is_integer():
        print(int(ans))
    else:
        print('IMPOSSIBLE')

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    a, b = map(int, input().split())
    K = (a + b) // 2
    if abs(a - K) == abs(b - K):
        return K
    else:
        return 'IMPOSSIBLE'


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if((a+b)%2==0):
  print('{0}'.format((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:
l = map(int, raw_input().split())
a = l[0]
b = l[1]
c = int(a + b)

def judge_int():
    if c % 2 == 0:
        return c/2
    elif c % 2 != 0:
        return "IMPOSSIBLE"

print(judge_int())

Submission status: Accepted

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