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):
  swap = b
  b = a
  a = swap

k = (a + b) // 2

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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 == 0:
  print(B+(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())
K2 = abs(A-B)
if K2%2 == 0:
    print(int(max(A,B) - K2/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 = (int(x) for x in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

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

K=abs(A+B)/2

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
p=max(a,b)
q=min(a,b)

if (p+q)%2==0:
    print((p+q)//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

K = (A - B) / 2

if K.is_integer() == False:
    print("IMPOSSIBLE")
else:
    print(int(A - K))

Submission status: Accepted

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

A, B = input().split()

K = (int(A) + int(B))/2

if K%1 == 0 :
	print(int(K))

else :
	print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
r = input()

A, B = r.split(" ")

A = int(A)
B = int(B)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

answer = (A+B)/2
if answer.is_integer() == True:
  print(int(answer))
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
from fractions import gcd

input = sys.stdin.readline

def main():
    A, B = map(int, input().split())
    max_n = max(A, B)
    min_n = min(A, B)
    if (max_n - min_n) % 2 == 1:
        print("IMPOSSIBLE")
        return
    else:
        print(int(min_n + (max_n - min_n) / 2))

main()

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

A, B = inpl()
if A > B:
    A, B = B, A

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

k = (a+b) / 2

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

Submission status: Accepted

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

K = ((A**2) - (B**2)) / (2*(A - B))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
inp = input().split()

a = int(inp[0])
b = int(inp[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
dif = abs(a-b)
result = 0
bigger = 0

if a >= b:
    bigger = a
else:
    bigger = b
    
if dif%2 == 0:
    result = bigger - dif/2
    print(int(result))
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(int(c /2) + min(a,b))
else:
	print('IMPOSSIBLE')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

ans = (a + b) 

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = (A+B) / 2
if str(ans)[-1] == "0":
    print(int(ans))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc135/tasks/abc135_a
import numpy as np


def calc(A: int, B: int) -> str:
    K = (B + A) / 2
    if int(K) == K:
        return str(int(K))
    return "IMPOSSIBLE"


def load_input_as_int_array() -> np.ndarray:
    return np.array([int(v) for v in input().split(" ")])


def main() -> None:
    A, B = load_input_as_int_array()
    larger = max(A, B)
    smaller = min(A, B)
    result = calc(smaller, larger)
    print(result)


main()

Submission status: Accepted

Solution code:
from sys import stdin

readline = stdin.readline


def main():
    a, b = map(int, readline().split())
    n = a + b
    print(n // 2 if n % 2 == 0 else '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())

num = (A + B)/2

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    ans = (A ** 2 - B ** 2) / (2 * (A - B))

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

    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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


c  = abs((b+a)/2)

if c.is_integer() == True:
  print(int(c))


else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
def main():
    A, B = list(map(int, input().split()))
    tmp = B
    if A > B:
        B = A
        A = tmp
    
    tmp = (B - A) / 2 + A
    if round(tmp) == tmp:
        return int(tmp)
    else:
        return 'IMPOSSIBLE'

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

Submission status: Accepted

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

k = (y*y - x*x)/(-2*x +2*y)


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

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

Submission status: Accepted

Solution code:
def mod(a,k):
    if a>k:
        return a-k
    else:
        return k-a
a,b=input().split()
a=int(a)
b=int(b)
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((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())
s = int((a+b)/2)
u = (a+b)%2

if u == 0:
  print(s)
  
else: 
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
data = list(map(int, input().split()))
data.sort()
if abs(data[0] - data[1]) / 2 == int(abs(data[0] - data[1]) / 2):
  print(int(data[1] - (abs(data[0]-data[1]) / 2) ))
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:

AB = list(map(int, input().split()))
A = AB[0]
B = AB[1]
#
# n = pow(10,9)
# t = True
#
# for k in range(n):
#     if abs(A-k) == abs(B-k):
#         print(k)
#         t = False
#         break
#
# if t:
#     print("IMPOSSIBLE")


K = 0.1

if not(A-B == 0):
    K = (pow(A,2) - pow(B,2)) / (2*(A-B))

if K % 1 == 0:
    print(int(K))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = (a*a - b*b) / (2 * (a - b))
if(x.is_integer()):
  print(int(x))
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
	a, b = [int(f) for f in input().split()]
	
	c = (a + b) / 2
	if c.is_integer():
		print(int(c))
	else:
		print("IMPOSSIBLE") 


if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if (a-b)%2==0:
    print(int(max(a,b)-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 = 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 -*-
def main():
    A,B = map(int,input().split())
    C = (A+B)/2
    #print(C)
    if C.is_integer():
        print(int(C))
        return
    print('IMPOSSIBLE')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

ans = (a + b) / 2
ans_int = int(ans)

if ans == ans_int:
    print(ans_int)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
while True:
    try:
        a,b=map(int,input().split())
        if a!=b:
            if ((a+b)%2)==0.0:
                print(int((a+b)/2))
            else:print("IMPOSSIBLE")
        else:print(int(a+b))
    except:break

Submission status: Accepted

Solution code:
a, b = input().split()
a = int(a)
b = int(b)
k = (a + b) / 2.0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#coding:utf-8
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())
ans=(a+b)/2
if ans%1==0:
    print(int(ans//1))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

n = a+b

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

Submission status: Accepted

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

else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
#coding : utf-8

import os
import sys

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

C = A + B

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if(a > b):
    d = a-b
else:
    d = b-a

if(d%2 == 0):
    if(a > b):
        print(a - int(d/2))
    else:
        print(b - int(d/2))


else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

ab = int(abs(A-B)/2)

if (A % 2 != 0 and B % 2 == 0) or (A % 2 == 0 and B % 2 != 0):
    print("IMPOSSIBLE")
else:
    print(min(abs(A), abs(B))+ab)

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:
ab = [int(i) for i in input().split(" ")]
print(sum(ab)//2 if sum(ab)%2==0 else "IMPOSSIBLE" )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2**31-1)
input = sys.stdin.readline
write = sys.stdout.write
LMIIS = lambda : list(map(int,input().split()))
II = lambda : int(input())
dbg = lambda *something : print(*something) if DEBUG is True else 0
DEBUG = True

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





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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ' 'dで区切ってprintする方法
# print(*a, sep=' ')

import math

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


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

div1 = (a+b)/2
div2 = (a+b)//2

if div1 == div2:
    print(div2)
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 round((A+B)/2)==((A+B)/2):
  print(int((A+B)/2))
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-S
A,B = [int(i) for i in input().split()]

K = (A + B)/2
if abs(A - K) == abs(B - K) and K % 1 == 0:
    print(int(K))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
c = abs(a - b) % 2

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
dai = A
syou  =B
if abs(A) < abs(B):
  dai = B
  syou = A
if((dai-syou)/2).is_integer():
  print(int(dai-(dai-syou)/2))
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

K = (A+B)/2
K_round = (A+B)//2

if isinstance(K, float):
    if K != K_round:
        print('IMPOSSIBLE')
    else:
        print(int(K))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
if __name__ == '__main__':
    a, b = map(int, input().split())
    c = a + b
    if c & 1:
        print('IMPOSSIBLE')
    else:
        print(c // 2)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import collections
import copy
input = sys.stdin.readline
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:
A, B = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s = a+b

if s < 0:
    s = 0-s



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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
A = a[0]
B = a[1]
K = (A+B)/ 2
ty = K.is_integer()
if ty == True:
    print(int(K))
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())

K = float((A**2 - B**2) / (2*(A-B)))
if K.is_integer():
    print(int(K))
else:
    print('IMPOSSIBLE')