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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

c = max(a,b) -((max(a,b)-min(a,b)) // 2)

if abs(a-c) == abs(b-c):
    print(c)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
def getIntList(): return [int(x) for x in input().split()]

x = getIntList()
if((x[0]+x[1])%2==0):
    print(int((x[0]+x[1])/2))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:

(N,M) = (int(i) for i in input().split(" "))
if (N+M)%2==1:
	print("IMPOSSIBLE")
else:
	print(int((N+M)/2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

result = (a+b)/2

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if A%2 == B%2:
    ptn1 = (A+B) / 2
    ptn2 = (A-B) / 2
    ptn3 = (B-A) / 2
    ptn4 = (-A-B) / 2
    if abs(A - ptn1) == abs(B - ptn1):
        print(int(ptn1))
    elif abs(A - ptn2) == abs(-B + ptn2):
        print(int(ptn2))
    elif abs(-A + ptn3) == abs(B - ptn3):
        print(int(ptn3))
    elif abs(-A + ptn4) == abs(-B + ptn4):
        print(int(ptn4))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

print(["IMPOSSIBLE",int((A+B)/2)][(A+B)%2 == 0])

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

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

Submission status: Accepted

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

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:
IN = [ int(item) for item in input().split()]
a = IN[0]
b = IN[1]

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

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a,b=(int(x) for x in input().split())
r = (a ** 2 - b ** 2) / (a - b)

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

Submission status: Accepted

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

K = (max(A,B)-min(A,B))

if K % 2 == 0:
	print(int(abs(max(A,B)-K/2)))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():

    A,B = map(int,input().split())
    if A==0 or B==0:
        print("IMPOSSIBLE")
        exit()
    if A%2!=B%2:
        print("IMPOSSIBLE")
        exit()

    small = min(A,B)
    large = max(A,B)
    large -= small
    print(int(large/2+small))




if __name__== "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if a % 2 == 0 and b % 2 == 1:
  print("IMPOSSIBLE")
elif a % 2 == 1 and b % 2 == 0:
  print("IMPOSSIBLE")

else:
  if a > b:
    k = b + (a-b)/2
    print(int(k))
  else:
    k = a + (b-a)/2
    print(int(k))

Submission status: Accepted

Solution code:
a,b = map(int,list((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:
    a, b = b, a

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

Submission status: Accepted

Solution code:
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    c = abs(A+B)

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

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A = abs(int(S[0]) - int(S[1]))
ans = 0
if A % 2 == 0:
  ans = int(A / 2) 
  if int(S[0]) > int(S[1]):
    print(ans + int(S[1]))
  else:
    print(ans + int(S[0]))
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
arr = input().split(" ")
A = int(arr[0])
B = int(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())
max_N = max(A, B)
min_N = min(A, B)
if (max_N % 2 == 0 and min_N % 2 == 0) or (max_N % 2 == 1 and min_N % 2 == 1):
    print(max_N - ((max_N - min_N) // 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 = int((a+b)/2)
c = k if abs(a-k) == abs(b-k) else 'IMPOSSIBLE'
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
LARGE = 10 ** 9 + 7


def solve_a(test=False, a=2, b=16):

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


def solve_b(test=False, n=5, p_list=[5, 2, 3, 4, 1]):

    if not test:
        n = int(input())
        p_list = list(map(int, input().split()))

    r = 0
    for i in range(n):
        if p_list[i] != i + 1:
            r += 1
    if r == 0 or r == 2:
        print("YES")
    else:
        print("NO")


def solve_c(test=False, n=2, a_list=[3, 5, 2], b_list=[4, 5]):

    if not test:
        n = int(input())
        a_list = list(map(int, input().split()))
        b_list = list(map(int, input().split()))

    res = 0
    for i in range(n):
        if b_list[i] <= a_list[i]:
            res += b_list[i]
            a_list[i] -= b_list[i]
        elif b_list[i] < a_list[i] + a_list[i + 1]:
            res += b_list[i]
            a_list[i + 1] -= b_list[i] - a_list[i]
            a_list[i] = 0
        else:
            res += a_list[i] + a_list[i + 1]
            a_list[i] = 0
            a_list[i + 1] = 0

    print(res)


def solve_d(test=False, s='??2??5'):

    if not test:
        s = input()

    l = len(s)
    res_list_new = [0] * 13
    res_list_old = [0] * 13
    zero_mod = int(s.replace('?', '0')) % 13
    res_list_new[zero_mod] += 1

    for i in range(1, l + 1):
        if s[-i] == '?':
            for k in range(13):
                res_list_old[k] = res_list_new[k] % LARGE
            base_mod = pow(10, i-1, 13)
            for j in range(1, 10):
                for k in range(13):
                    res_list_new[(k + base_mod * j) % 13] += res_list_old[k]

    print(res_list_new[5] % LARGE)


# solve_a(test=True, a=2, b=16)
# solve_a(test=True, a=0, b=3)
# solve_a(test=True, a=998244353, b=99824435)

# solve_b(test=True, n=5, p_list=[5, 2, 3, 4, 1])
# solve_b(test=True, n=5, p_list=[2, 4, 3, 5, 1])
# solve_b(test=True, n=7, p_list=[1, 2, 3, 4, 5, 6, 7])

# solve_c(test=True, n=2, a_list=[3, 5, 2], b_list=[4, 5])
# solve_c(test=True, n=3, a_list=[5, 6, 3, 8], b_list=[5, 100, 8])
# solve_c(test=True, n=2, a_list=[100, 1, 1], b_list=[1, 100])

# solve_d(test=True, s='??2??5')
# solve_d(test=True, s='?44')
# solve_d(test=True, s='7?4')
# solve_d(test=True, s='?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???')

solve_a()

Submission status: Accepted

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

if a >= b:
    max = a
    min = b
else:
    min = a
    max = b

ans = int((max-min) / 2)
if abs(max - ans) == abs(min + ans):
    print(abs(max-ans))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
def main():
	import sys
	input = sys.stdin.readline
	A, B = list(map(int, input().split()))
	if (A - B) % 2 == 0:
		ans = (A + B) / 2
		print(int(ans))
	else:
		print('IMPOSSIBLE')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ab = (A + B) / 2

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

Submission status: Accepted

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

Submission status: Accepted

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

# k = (b+a)/2
# if isinstance(k, int) != True:
#     print("IMPOSSIBLE") 
# else:
#     print(k)
if (b+a)%2 != 0:
    print("IMPOSSIBLE")
else :
    print(int((b+a)/2))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys, math, bisect, random, itertools
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b = LI()
    if (a + b) % 2:
        print("IMPOSSIBLE")
        return
    print((a + b) // 2)
    return

#B
def B():
    n = II()
    p = LI()
    for i in range(n):
        for k in range(i+1, n):
            pi = p[::1]
            pi[i], pi[k] = pi[k], pi[i]
            for j in range(n-1):
                if pi[j] > pi[j + 1]:
                    break
            else:
                print("YES")
                return
    print("NO")
    return

#C
def C():
    n = II()
    a = LI()
    b = LI()
    ans = 0
    for i in range(n):
        if a[i] >= b[i]:
            ans += b[i]
            continue
        ans += a[i]
        b[i] -= a[i]
        if a[i + 1] >= b[i]:
            ans += b[i]
            a[i + 1] -= b[i]
            continue
        ans += a[i + 1]
        a[i + 1] = 0
    print(ans)
    return

#D
def D():
    s = S()
    s = s[::-1]
    dp = [[0] * 13 for _ in range(len(s))]
    remain = 1
    if s[0] == "?":
        for i in range(10):
            dp[0][i] = 1
    else:
        dp[0][int(s[0])] = 1
    for i in range(1, len(s)):
        remain = (remain * 10) % 13
        dpi = dp[i]
        dpi1 = dp[i-1]
        if s[i] == "?":
            for k in range(10):
                for j in range(13):
                    dpi[(j + remain * k) % 13] += dpi1[j]
                    dpi[(j + remain * k) % 13] %= mod
        else:
            for j in range(13):
                dpi[(j + remain * int(s[i])) % 13] += dpi1[j]
    print(dp[-1][5])
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = a[0] + a[1]
c =int( b / 2)
d = b % 2

if d == 1:
    print ("IMPOSSIBLE")
else:
    print (c)

Submission status: Accepted

Solution code:
N=[int(i) for i in input().split()]
A=int(N[0])
B=int(N[1])

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

Submission status: Accepted

Solution code:
# coding=utf-8

if __name__ == "__main__":
    A, B = map(int, input().split())

    if A > B:
        A, B = B, A

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

aa=0;bb=0
if a>b :
  sm=b
else:
  sm=a

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

Submission status: Accepted

Solution code:
import numpy

A, B = [int(x) for x in input().split(" ")]
if (A - B) % 2 == 0:
    print(abs(A + B) // 2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

A = i[0]
B = i[1]

k = (A + B) / 2

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

Submission status: Accepted

Solution code:
from numpy.linalg import solve
a, b = map(int, input().split())
x = [[1, 1],[1, -1]]
ans = solve(x,[a, b])
ans = ans[0]
if int(ans) != ans:
    ans = 'IMPOSSIBLE'
else:
    ans = abs(int(ans))
print(ans)

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

Submission status: Accepted

Solution code:
def LI(): return list(map(int, input().split()))
a, b = LI()
a, b = min(a, b), max(a, b)

d = b - a
if d % 2 == 0:
  print(a + d // 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 = list(map(int,input().split()))
c = 0
d = 0
e = 0
c = (b-a)/2
e = (c*10)%10
if(e==0):
  d = int((a + c))
  print(d)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
a, b = (int(i) for i in input().split()) 
if a == 0 or b > 10**9 or b == 0 or a == b:
  print('IMPOSSIBLE')
  
elif (a + b) % 2 != 0:
  print('IMPOSSIBLE')
else:
  x = (a + b) / 2
  print(int(x))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def is_integer(n):
	try:
		float(n)
	except ValueError:
		return False
	else:
		return float(n).is_integer()

a,b = map(int, input().split())
evenNum = (int(a) + int(b)) / 2

if(is_integer(evenNum)):
	print(int(evenNum))
else:
	print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    a, b = [int(i) for i in input().split()]
    k = (a + b) // 2
    if abs(a - k) == abs(b - k):
        print(k)
    else:
        print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

kari = (a + b) /2

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

Submission status: Accepted

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    A, B = map(int, input().split())
    logging.info("Hello!")

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k=0
tmp = a + b

if tmp%2 == 0:
    k = tmp//2
else:
    k = "IMPOSSIBLE"

print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = (int(i) for i in input().split())
if (A == 0) | (B == 0):
    print('IMPOSSIBLE')
elif (abs(A - B) % 2 == 1):
    print('IMPOSSIBLE')
else:
    print(int((B/ 2) + (A / 2)))

Submission status: Accepted

Solution code:


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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
input_ = input().split()
a = int(input_[0])
b = int(input_[1])

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

x = abs(a-b)

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

if a < b:
    print(a + (x // 2))
else:
    print(b + (x // 2))

Submission status: Accepted

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

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

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

Submission status: Accepted

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


def solve(a, b):
    k = (a + b)/2
    if k == int(k):
        return int(k)
    return "IMPOSSIBLE"


def main():
    a, b = input_from_console()
    print(solve(a, b))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  # Check if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
Ask = input()
puts = Ask.split()


A = int(puts[0])
B = int(puts[1])
Ans = 0

Pos = False

if (A == B):
	Pos = True
elif (A**2 - B**2) % (2*(A-B)) == 0:
	Pos= True
	Ans =  (A**2 - B**2) / (2*(A-B))
	
if not Pos:
	print('IMPOSSIBLE')
else:
	print(int(Ans))

Submission status: Accepted

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

if a < b:
    a,b = b,a
k = int((a - b)/2)
p = a-k
if a-p == abs(b-p):
    print(p)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
str = input()
a = int(str.split(" ")[0])
b = int(str.split(" ")[1])

k = int(abs(a+b)/2)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

isFloat = (A + B) % 2 
result = (A + B) / 2 

# print(type(result))
if (isFloat > 0) :
    print("IMPOSSIBLE")
else:
    print(int(result))

Submission status: Accepted

Solution code:
a, b = (int(x) for x in input().split())
result = (b ** 2 - a ** 2) / (-2 * a + 2 * b)
if result.is_integer():
    print(int(result))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import sys

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

K = (A + B)/2

if 2*K != (A+B):
    print 'IMPOSSIBLE'
    sys.exit(0)

print  K

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 == 1:
    print("IMPOSSIBLE")
else:
    print(int(c / 2))

Submission status: Accepted

Solution code:
from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Accepted

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

import numpy as np

a,b=acinput()

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

Submission status: Accepted

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

if A%2 != B%2:
    print("IMPOSSIBLE")
else:
    print(min(A,B)+int(abs(A-B)/2))

Submission status: Accepted

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

import sys

sys.setrecursionlimit(10**7)

# Override `input` function because `stdin.readline()` is 10x faster than built-in `input()`
input = sys.stdin.readline


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h(typ) if m > 1 else typ(input()) for _ in range(n)]


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
arr = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる

if (arr[0]+arr[1])%2==0:
    print(int((arr[0]+arr[1])/2))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

if A > B:
    c = A - B
else:
    c = B - A

q, mod = divmod(c, 2)
if mod == 1:
    print("IMPOSSIBLE")
else:
    print(max(A, B) - q)

Submission status: Accepted

Solution code:
i1 = input().split(' ')
a=int(i1[0])
b=int(i1[1])

aa = abs(a)+abs(b)
if aa%2 == 0:
  print(int(aa/2))
  exit()

print("IMPOSSIBLE")

Submission status: Accepted

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

s = a + b

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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