Problem:


Score: 100 points

Problem Statement

We have two distinct integers A and B.

Print the integer K such that |A - K| = |B - K|.

If such an integer does not exist, print IMPOSSIBLE instead.

Constraints

All values in input are integers.

0 \leq A,\ B \leq 10^9

A and B are distinct.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the integer K satisfying the condition.

If such an integer does not exist, print IMPOSSIBLE instead.

Sample Input 1

2 16

Sample Output 1

9

|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.

Sample Input 2

0 3

Sample Output 2

IMPOSSIBLE

No integer satisfies the condition.

Sample Input 3

998244353 99824435

Sample Output 3

549034394



Sample input:
2 16


Sample output:
9

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 abs(a-k) == abs(b-k):
  print(int(k))
else :
  print("IMPOSSIBLE")

Submission status: Accepted

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


if __name__ == '__main__':
    solve()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

answer = 'IMPOSSIBLE'
start = (A + B) // 2 - 1
end = (A + B) // 2 + 1


for i in range(start, end+1):
    a = abs(A - i)
    b = abs(B - i)
    
    if a == b:
        answer = i
        break

print(answer)

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(i) for i in input().split() ]

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


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

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

    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = 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, raw_input().split(' '))
if a > b:b,a = a,b
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:
  ans = int((a+b) / 2)
  print(ans)
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) and (a+b) % 2 == 0:
    print(int(k))
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:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    a, b = map(int, input().split())
    if (a + b) % 2 == 0:
        print((a + b) // 2)
    else:
        print('IMPOSSIBLE')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()

def main():
    a, b = map(int, input().split())
    if abs(a-b) % 2 != 0:
        print("IMPOSSIBLE")
        return
    if a >= b:
        print((a-b)//2+b)
        return
    print((b-a)//2+a)
    
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 abs(a - b) % 2 == 0:
  print(min(a, b) + abs(a - b) // 2)
else:
  print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
a , b = map(int,input().split())
x = (a+b) / 2
print(int(x) if x.is_integer() else '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:
def main():
    A, B = map(int, input().split())
    mi = min(A, B)
    ma = max(A, B)
    if (ma - mi) % 2 == 0:
        print((ma + mi) // 2)
    else:
        print("IMPOSSIBLE")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    a,b = map(int, input().split())
    num = b - a
    if num%2 == 0:
        print(b - (num//2))
    else:
        print("IMPOSSIBLE")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc135/tasks/abc135_a

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  num = list(map(int,input().split()))
  if num[0]-num[1]>0 and (num[0]-num[1])%2==0:
    print(num[0]-int((num[0]-num[1])/2))
  elif num[1]-num[0]>0 and (num[1]-num[0])%2==0:
    print(num[1]-int((num[1]-num[0])/2))
  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:
#!/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:
a, b = map(int, input().split())
k = (a + b) // 2
if abs(k - a) == abs(k - b):
    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())
print(int((A+B)/2)) if (A+B)%2==0 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())

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

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 I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    a, b = LI()
    if (a + b) % 2 == 0:
        print((a+b)//2)
    else:
        print("IMPOSSIBLE")

main()

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 == 1:
    print('IMPOSSIBLE')
else:
    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 = sorted(map(int, input().split()))

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

Submission status: Accepted

Solution code:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf


a,b = imap()
k,mod = divmod(a+b, 2)
ans = k if not mod else "IMPOSSIBLE"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
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())
print((A+B)//2 if (A+B)%2 == 0 else '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:
import math
a,b = map(int,input().split())
if (max(a,b) - min(a,b)) % 2 == 0:
    print(math.floor((a+b)/2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

if((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:
s = sum(map(int, input().split()))
print('IMPOSSIBLE' if s % 2 else s // 2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = sum(list(map(int,input().split())))
if s % 2 == 0:
  print(s//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) // 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())

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

Submission status: Accepted

Solution code:
# from math import ceil,sqrt,log,gcd,pi
# def ii():return int(input())
# def si():return input()
# def mi():return map(int,input().split())
# def li():return list(mi())

# for _ in range(ii()):
a,b=map(int,input().split())
s=(a+b)
if(s==0 or s%2):
    print("IMPOSSIBLE")
else:
    x=0
    if(s!=0):
        x=abs(s)//2
    print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def harmony(a, b):

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

# check
if abs(A - B) % 2 == 1:
    print("IMPOSSIBLE")
else:
    K = (A + B) // 2
    print(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 == 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:
#!/usr/bin/env python3

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

if b > a:
    a, b = b, a

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
geta = lambda fn: map(fn, readline().split())
gete = lambda fn: fn(readline())

# sys.setrecursionlimit(10**5)

def main():
    a, b = geta(int)
    s = a + b
    if s & 1 == 0:
        print(s//2)
    else:
        print("IMPOSSIBLE")
    
	
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
tmp = 0

if (abs(A)-abs(B))%2 == 1:
  print("IMPOSSIBLE")
  sys.exit()

if A < B:
  tmp = A
  A = B
  B = tmp

if A > 0 and B > 0:
  K = (A+B)/2
elif A < 0 and B < 0:
  K = -(abs(A)+abs(B))/2
else:
  K = A-(abs(A)+abs(B))/2

print(int(K))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=(a+b)/2
if c==int(c):
  print(int(c))
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:
import itertools
import math
import fractions
import functools
a, b = map(int, input().split())
if (b+a)/2 == (b+a)//2:
    print((b+a)//2)
else: print("IMPOSSIBLE")

Submission status: Accepted

Solution code:

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

k=(a+b)/2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = list(map(int, input().rstrip().split()))
k = abs(a - b) / 2
result = 'IMPOSSIBLE'
if float.is_integer(k):
    result = str(int(min(a, b) + k))

print(result)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
j=a+b
print( int(j/2) if j%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:
import sys

def main():
    A, B = map(int, input().split())
    ab = abs(A+B)
    if ab % 2 == 1:
        print('IMPOSSIBLE')
    else:
        print(ab // 2)
    return


if __name__ == "__main__":
    main()
    sys.exit(0)

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    a, b = map(int, input().split())
    if abs(a - b) % 2 == 0:
        k = (a + b) // 2
        print(k)
    else:
        print('IMPOSSIBLE')
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

A,B  = inputIL()

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

Submission status: Accepted

Solution code:
from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
from collections import deque


#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(range(n),r))



def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets

#公約数の列挙
def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	#x:縦，y:横
	return fact(x+y)/fact(x)/fact(y)

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
	
def count_str(m):
	tmp={}
	for i in range(10):
		if i in tmp:
			tmp[i]=1
		else:
			tmp[i]+=1
	return tmp

def is_prime(n):
	if n==1: return True

	for i in range(2,int(math.sqrt(n))+1):
		if n%i==0:
			return False
	return True

a,b=input2()

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

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

Submission status: Accepted

Solution code:
#from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    a,b = mi()
    if a%2 != b%2:
        print('IMPOSSIBLE')
        exit()
    else:
        print((a+b)//2)

main()

Submission status: Accepted

Solution code:
# ABC135A

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

Submission status: Accepted

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