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())
x = min(a, b)
y = max(a, b)
k = (y - x)//2 + x
if abs(a-k) == abs(b-k):
    print(k)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
# 初期入力
import sys
input = sys.stdin.readline
A,B = (int(x) for x in input().split())
diff = A-B
if diff %2 ==1:
    print("IMPOSSIBLE")
else:
    print((A+B)//2)

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':

    ABC_135_A()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


a, b = Is()

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


a, b = Is()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


solve()

Submission status: Accepted

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

c1= (a-b)/2
c2= (b-a)/2

if abs(a-(a-c1))==abs(b-(a-c1)) and c1.is_integer():
    print(int(a-c1))
elif abs(a-(b-c2))==abs(b-(b-c2)) and c2.is_integer():
    print(int(b-c2))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
# A - Harmony

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

Submission status: Accepted

Solution code:
p=eval(input().replace(" ","+"))/2;print("IMPOSSIBLE"if p%1>0else int(p))

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

Submission status: Accepted

Solution code:
import sys, heapq, bisect, math, fractions
from collections import deque

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code

def resolve():
    a,b=pin()
    t=(a+b)
    if t%2==0:print(t//2);return
    print("IMPOSSIBLE")
#%%submit!
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    A, B = (int(x) for x in input().split())
    if (A % 2 == 0 and B % 2 == 0) or (A % 2 == 1 and B % 2 == 1):
        ans = int((A + B) / 2)
    else:
        ans = "IMPOSSIBLE"
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# N = int(input())
# S = input()
A, B = map(int, input().split())
# A = list(map(int, input().split()))
if (A + B) % 2 == 0:
    print((A + B) // 2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import sys
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]

A, B = ri_()
ans = 'IMPOSSIBLE'
if (A + B) % 2 == 0:
    ans = (A + B) // 2
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


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


if A % 2 != B % 2:
    print("IMPOSSIBLE")

else:
    print((A+B)//2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math 
a,b=(int(x) for x in input().split())
if(a%2 != b%2):
    print("IMPOSSIBLE")
else:
    k=int (a+b)/2
    print(math.floor(k))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(k) for k in input().split()]
#template
A,B = inputlist()
if (A+B) % 2 == 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = eval(input().replace(' ','+'))
print(x%2 * 'IMPOSSIBLE' or x//2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    A, B = map(int, open(0).read().split())

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=[int(_) for _ 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())
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
print(int(k / 2) if k%2 == 0 else "IMPOSSIBLE")

Submission status: Accepted

Solution code:
n,m = (int(x) for x in input().split())
if n%2 != m%2:
  print('IMPOSSIBLE')
else:
  print(int((n+m)/2))

Submission status: Accepted

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

ans = abs(a-b)
M = max(a,b)

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

Submission status: Accepted

Solution code:

a,b=map(int,input().split())
if (a+b)%2==0:
    print((a+b)//2)

else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=eval(input().replace(' ','+'));print(a%2*'IMPOSSIBLE'or a//2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c = (a + b) // 2
if abs(a - c) == abs(b - c):
    print(c)
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=[int(x) for x in input().split()]

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

Submission status: Accepted

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

sa = max(a,b) - min(a,b)

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())

x = ((b - a) // 2) + a

if abs(a - x) == abs(b - x):
  print(x)
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
count = 0
num = 0
for i in range(int((a+b)/2)-5, int((a+b)/2)+5):
  if abs(a-i) == abs(b-i):
    count += 1
    num = i
if count > 0:
  print(num)
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:
a,b = map(int, input().split())

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

Submission status: Accepted

Solution code:
#copy

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())
    d = max(A, B) - min(A, B)
    if d % 2 == 0:
        K = min(A, B) + d//2
        print(K)
    else:
        print("IMPOSSIBLE")
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# Problem A - Harmony

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

# initialization
K = A + B

# check
if K%2==0:
    K = K // 2
    print(K)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
# 2020/04/25
# AtCoder Beginner Contest 135- A

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

# Calc
ans = int((a + b) / 2)
if ans != (a + b) / 2:
    ans = 'IMPOSSIBLE'

# Output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def resolve():
  a, b = map(int, input().split())
  if a > b:
    a, b = b, a
  ans = (b + a) // 2
  if abs(a-ans) == abs(b-ans):
    print(ans)
  else:
    print("IMPOSSIBLE")
  return

if __name__ == "__main__":
  resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

if (N + K) % 2 == 0:
    print((N + K) // 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:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

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

resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=[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=max(a, b)
l=min(a, b)
if (k+l)%2==0:
    print((k+l)//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

AB = abs(A-B)

print(min(A,B)+ AB//2 if AB%2 == 0 else "IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=eval(input().replace(' ','+'));print(k//2 if k%2==0 else "IMPOSSIBLE")

Submission status: Accepted

Solution code:
k=eval(input().replace(' ','+'));print(k//2 if (k/2).is_integer() else "IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a > b and (a+b)%2 == 0:
    ans = (a+b)/2
    print(int(ans))
#ans = -(a*a-b*b)/(2*(b-a))
elif b > a and (a+b)%2 == 0:
    ans = (b+a)/2
    print(int(ans))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
q, r = divmod(sum(map(int, input().split())), 2)
print('IMPOSSIBLE' if r else q)

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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
print((A+B)//2 if (A+B)/2 % 1 == 0 else "IMPOSSIBLE")

Submission status: Accepted

Solution code:
i = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる
K = int((i[0]+i[1])/2)

if (i[0]+i[1])%2==0:
    print(K)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
#--Harmony

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N = int(input())
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""

A, B = map(int, input().split())
ans = 0
if (A % 2 == 0 and B % 2 == 0) or (A % 2 != 0 and B % 2 != 0):
    ans = (A + B) // 2

print(ans if ans != 0 else '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:
import numpy as np
def main():
    a, b = map(int, input().split())
    if (a - b) % 2 == 1:
        print("IMPOSSIBLE")
    else: print(int((a + b)/ 2))
if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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