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

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

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

Submission status: Accepted

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

if k!=int(k):
  print('IMPOSSIBLE')
else:
  print(int(k))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    A, B = map(int, input().split())

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

input = lambda: stdin.readline()
main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    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:
import sys,heapq,math,resource
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def setrlim():
  sys.setrecursionlimit(250000)
  soft,hard = resource.getrlimit(RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  #resource.setrlimit(RLIMIT_STACK, (128*1024*1024,hard))

a,b = inm()
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 - (A + B) / 2) == abs(B - (A + B) / 2) and (A+B)%2==0:
    print((A + B) // 2)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
import sys

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

if a%2 == 0 and b%2 == 0:
    print(int((a+b)/2))
    sys.exit()

if a%2 != 0 and b%2 != 0:
    print(int((a+b)/2))
    sys.exit()

print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if abs(a[0]-a[1])%2==0:
    print(abs(a[0]+a[1])//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(" ")))

s = max(b-a, a-b)
if s % 2 == 0:
    print(int(s/2)+min(a,b))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

NO = "IMPOSSIBLE"  # type: str

def solve(A: int, B: int):
    if (A + B) % 2 :
        print(NO)
    else:
        print(int((A + B)/2))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

A, B = read_int()

def solve():
    if (A + B) % 2 == 0:
        return (A + B) // 2
    return 'IMPOSSIBLE'

if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if ((b+c)/2 - (b+c)//2) < 0.5:
  print((b+c)//2)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    input_line = list(map(int, input().split()))
    a = input_line[0]
    b = input_line[1]
    
    if((a + 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((A+B)//2)
else :
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ta = (B - A) / 2
tb = (B - A) // 2
if ta == tb:
    print(A + tb)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

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

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:
from bisect import bisect_left, bisect_right; from collections import Counter, defaultdict, deque, OrderedDict; from copy import deepcopy; from fractions import gcd; from functools import lru_cache, reduce; from math import ceil, floor; from sys import stdin, setrecursionlimit
import heapq as hq; import itertools as its; import operator as op


# globals
inf = float('inf')
input = stdin.readline


def main():
    a, b = get_li()
    if abs(a - b) % 2 == 0:
        print((a + b) // 2)
    else:
        print('IMPOSSIBLE')
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def gets(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input().strip()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().strip().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    setrecursionlimit(4100000)
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#N = int(input())
A, B = list(map(int,input().split()))
#A = [int(input()) for _ in range(N)]
i = (B - A) / 2
if i.is_integer() :
    print(B - int(i))
else :
    print('IMPOSSIBLE')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def LIST(): return [int(x) for x in input().split()]
MOD = 10**9 + 7

A, B =LIST()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b =map(int, input().split())  #複数数値入力

diff = abs(a-b)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
K = (A**2 - B**2) / (2*A - 2*B) 

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

Submission status: Accepted

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

d = A+B

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

Submission status: Accepted

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

if abs(a-b) % 2 == 1:
    print("IMPOSSIBLE")
    exit()

diff = abs(a-b)
diff_2 = diff // 2

print(max(a,b) - diff_2)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

K = (A+B)/2.0
if (10*K)%10 != 0:
    answer = "IMPOSSIBLE"
else:
    answer = int(K)
print(answer)

Submission status: Accepted

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

l = abs(a+b)
if l%2==0 :
  print(l//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:
# -*- coding: utf-8 -*-

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  A, B = readInts()
  if (A + B) % 2 == 0:
    print((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(int(( a + b ) / 2))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
a,b = map(int, input().split())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np


a,b = map(int,input().split())
large = max(a,b)
small = min(a,b)
diff = large-small
if diff %2 == 1:
    print("IMPOSSIBLE")
else:
    print(small+diff//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:
sentence = input()
ab = sentence.split()
A = int(ab[0])
B = int(ab[1])
if A == B:
    print(0)
    exit()
else:
    sum_ab = A + B
    if sum_ab % 2 == 0:
        print(sum_ab // 2)
        exit()
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:
words = lambda t : list(map(t, input().split()))
a,b = words(int)

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
A,B=map(int,input().split())
if (A+B)/2==(A+B)//2:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
[A, B] = [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()))

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


def main():
    a, b = [int(s) for s in sys.stdin.readline().strip().split()]
    if (a + b) % 2:
        print('IMPOSSIBLE')
    else:
        print((a + b) // 2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    a, b = LI()
    c = (a + b) / 2
    if c % 1 == 0:
        print(int(c))
    else:
        print("IMPOSSIBLE")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

IMP = "IMPOSSIBLE"


def main():
    A, B = map(int, input().split())
    if A - B == 0:
        print(0)
    elif (A + B) % 2 == 0:
        print((A + B) // 2)
    else:
        print(IMP)


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if(A>B):
    i=A
    j=B
else:
    i=B
    j=A

if((i-j)%2 == 1):
    print('IMPOSSIBLE')
else:
    print((i-j)//2 + j)

Submission status: Accepted

Solution code:
import sys, math, itertools, bisect, copy, re
from collections import Counter, deque, defaultdict

# from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
# from functools import reduce
# from math import ceil, floor, log10, log2, factorial
# from pprint import pprint

INF = float('inf')
MOD = 10 ** 9 + 7
EPS = 10 ** -7
sys.setrecursionlimit(1000000)

# N = int(input())
# N,M = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]
# DP = [[0] * 100 for _ in range(100)]
# DP = defaultdict(lambda: float('inf'))

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 = (int(x) for x in input().split())
if ((A + B) / 2) % 1 == 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 abs(a - k) == abs(b - k):
    print(k)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
A,B = 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())
c = b - a
if c % 2 == 1:
    print("IMPOSSIBLE")
else:
    print(c // 2 + a)

Submission status: Accepted

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

k = (a+b) / 2.0
if k == int(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())


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

Submission status: Accepted

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

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

Submission status: Accepted

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

K = (A+B)/2

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [A, B] = [long(input_raw[0]), long(input_raw[1])]
    if((A + B) % 2 == 1):
        print "IMPOSSIBLE"
    else:
        print (A + B)/2

if __name__ == '__main__':
    main()

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

c = max(a,b)
d = min(a,b)

if (c-d) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print(int(d+(c-d)/2))

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:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()
c = a + b
c = c/2
d = int(c)
if c-d == 0:
    print(d)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

suma=A+B
if suma%2==0:
    print(int(suma/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:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

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

else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

A, B = map(int, ip().rstrip().split())
x = abs(A+B)
if x % 2 == 1:
    print('IMPOSSIBLE')
else:
    print(x//2)

Submission status: Accepted

Solution code:
import sys, math
from collections import deque

readline = sys.stdin.readline

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

K = (A + B) // 2

if 2 * K != A + B:
    print('IMPOSSIBLE')
else:
    print(K)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline

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

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())
if abs(a-b)%2 == 1:
    print('IMPOSSIBLE')
else:
    print(max(a,b) - abs(a-b)//2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())

k = (a+b) // 2
r = (a+b) % 2

if r == 0:
    print(k)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
def solve(a, b):
    d, m = divmod(a + b, 2)
    if m == 0:
        return d
    else:
        return None


def main():
    a, b = (int(z) for z in input().split())
    res = solve(a, b)
    print("IMPOSSIBLE" if res is None else res)


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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans='IMPOSSIBLE'
mi=min(a,b)
ma=max(a,b)
if a%2==b%2:
    ans=(mi+ma)//2
print(ans)

Submission status: Accepted

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

if A > B:
    tmp = A
    A = B
    B = tmp

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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(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())
C=(A+B)

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

Submission status: Accepted

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

K = (max(A, B) - min(A, B))/2 + min(A, B)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

if(a == b):
    print(0)
    sys.exit()
elif(abs(a+b) % 2 == 0):
    print(abs(a+b)//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    [a, b] = li()
    if abs(a - b) % 2 == 0:
        print((a + b) // 2)
    else:
        print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)

def main():
    A, B = map(int, input().split())
    K = (A + B) / 2
    if math.ceil(K) != K:
        print("IMPOSSIBLE")
    else:
        print(int(K))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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