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

i = (A + B) // 2
j = (A + B) / 2

if i == j:
    print(i)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict

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







if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
nums = [int(e) for e in input().split()]

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    b, c = map(int, input().split())
    sum = b + c
    ans = int(sum /2)
    mod = sum % 2
    if mod != 0:
        print("IMPOSSIBLE")
    else:
        print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)


def li(): return map(int, stdin.readline().split())


A, B = li()

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

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

mint = min(A, B)
tmp = abs(A - B)
if mint == 0:
    print('IMPOSSIBLE')
else:
    ans = tmp // 2
    tmp = tmp % 2
    if tmp == 0:
        print(ans + mint)
    else:
        print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

K = 'IMPOSSIBLE'
if (A > B or A < B) and (A + B) % 2 == 0:
    K = (A + B) // 2

print(K)

Submission status: Accepted

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

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

K=(A+B)/2

def judge(K):
    if is_integer_num(K):
        return (int(K))
    else:
        return('IMPOSSIBLE')

print(judge(K))

Submission status: Accepted

Solution code:
import sys

A,B=map(int,input().split())
if A % 2 != B % 2:
    print("IMPOSSIBLE")
    sys.exit()
print(int((B-A)/2 + A))

Submission status: Accepted

Solution code:
abc = [int(s) for s in input().split(' ')]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

main()

Submission status: Accepted

Solution code:

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

if(a+b)%2 == 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:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
 
x = a+b
if x%2 == 1:
  print('IMPOSSIBLE')
else:
  print('{}'.format(x//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())
K = A+B
if (A+B) % 2 == 1:
  print('IMPOSSIBLE')
else:
  print(int(K/2))

Submission status: Accepted

Solution code:
n,m = (int(i) for i in input().split())

if abs(n-m)%2 == 1:
  print("IMPOSSIBLE")
else:
  print((n+m)//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if not ((A + B) / 2.0).is_integer():
    print('IMPOSSIBLE')
else:
    print(int((A + B) / 2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
a,b = map(int, input().split())
k = int((a+b)/2)
if abs(a-k) == abs(b-k):
    print(int(k))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

a,b = map(int,input().split())	
a = int(a)
b = int(b)
c = abs(a-b)/2.0 + min(a,b)

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

Submission status: Accepted

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

def solve():
    A, B = list(map(int, input().split()))
    K = (A+B)/2
    if K.is_integer():
        print(int(K))
    else:
        print("IMPOSSIBLE")

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    token = lines[0].split(" ")
    a = int(token[0])
    b = int(token[1])

    return (a, b)


def solve(a, b):

    c = (a + b) / 2

    if not c.is_integer():
        return "IMPOSSIBLE"

    return int(c)


def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

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

s = list(map(int, input().split(" ")))
ans =''

if (s[0]+s[1])%2 == 1 :
  ans = 'IMPOSSIBLE'
else :
  ans = str(math.floor((s[0]+s[1])/2))

print(ans)

Submission status: Accepted

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

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

else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

ab = a + b

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
k = 0
if (a + b)%2 == 0:
    k = (a + b)/2
    print(int(k))
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:
#!/usr/bin/env python3
import sys

NO = "IMPOSSIBLE"  # type: str

def solve(A: int, B: int):
    a = (A + B)* 1.0/2
    if float.is_integer(a):
        print(int(a))
    else:
        print("IMPOSSIBLE")

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:
a,b = list(map(int,input().split()))
x = ( a + b )%2
y = (a + b)//2

if x ==0:
    print(y)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

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

Submission status: Accepted

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

if B<A:
	A,B=B,A

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

Submission status: Accepted

Solution code:
get = input().split()
A = int(get[0])
B = int(get[1])
if (A+B) % 2 == 0:
	print(int(( A + B ) / 2))
else:
	print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline

    AB = input().split(" ")
    A = int(AB[0])
    B = int(AB[1])
    if (A + B) % 2 == 1:
        res = 'IMPOSSIBLE'
    else:
        res = int((A + B) / 2)
    print(res)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy
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-k = k-b (if a>b) k -a = b-k (if a < b)
# a+b = 2k 
# if a+b % 2 == 1 IMPOSSIBLE else a+b/2
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().split())
if a%2 == b%2:
    print (a+b)/2
else:
    print "IMPOSSIBLE"

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))
diff = b + a
if diff % 2 == 0:
  print(diff // 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:
I=input()
s=I.split()
A=int(s[0])
B=int(s[1])

M=(A+B)/2.0

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

if(is_integer_num(M)):
    print(int(M))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(K)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num_a, num_b = map(int, input().split(' '))

lesser = min(num_a, num_b)
greater = max(num_a, num_b)

distance = greater - lesser
if distance == 0:
    print(0)
elif distance % 2 == 0:
    print((lesser + greater) // 2)
else:
    print("IMPOSSIBLE")
exit(0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# input
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(' '))
ans = (A + B) / 2
print(int(ans)) if ans == int(ans) else print('IMPOSSIBLE ')

Submission status: Accepted

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


def main():
    a, b = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

K = (A+B)/2

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(K)

Submission status: Accepted

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

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

Submission status: Accepted

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

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-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 I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  a,b=LI()
  
  x=max(a,b)-min(a,b)

  if x%2==1:
    return 'IMPOSSIBLE'

  return max(a,b)-x//2

# main()
print(main())

Submission status: Accepted

Solution code:
a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#a = 998244353 
#b = 99824435
if (a+b)%2:
    print("IMPOSSIBLE")
else:
    print(int((a+b)/2))

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

k = (a+b) / 2
if k.is_integer():
    print(int(k))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans, m = divmod(A+B, 2)
if m==1:
    print("IMPOSSIBLE")
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

K = abs(A-B)
u = max([A, B])

if K % 2 == 1:
    print("IMPOSSIBLE")

else:
    print(abs(int(K/2)-u))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

import sys
import math
import bisect
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
mod = 10**9 + 7

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

if a-b == 0:
    print(1)
elif (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())

    K2 = (A+B)

    answer = 'IMPOSSIBLE'
    if 2*A-K2 == -1 * (2*B-K2) and (A+B)%2==0:
        answer = K2//2

    print(answer)

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

Submission status: Accepted

Solution code:
a,b  = list(map(int,input().split()))
k = (a+b)/2
if (k - int(k))!=0:
    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())

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

Submission status: Accepted

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

Submission status: Accepted

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

if A >= B:
  q, mod = divmod((A+B),2)
  if mod == 0:
    print(q)
  else:
    print("IMPOSSIBLE")
else:
  q, mod = divmod((A+B),2)
  if mod == 0:
    print(q)
  else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B] = string_to_int(inputs[0])
    if (A + B) % 2 != 0:
        return "IMPOSSIBLE"
    else:
        return (A+B) // 2


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

Solution code:
S = input()

S = list(map(int, S.split()))

A = S[0]
B = S[1]

f = (A+B) / 2

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

Submission status: Accepted

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

ans = (a+b)/2
if ans % 1 == 0:
    print("{}".format((int)(ans)))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys

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

if __name__ == "__main__":
    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())
C = abs(A-B)/2
if A != B:
    if C.is_integer():
        print(int(abs(A + B)/2))
    else:
        print('IMPOSSIBLE')
else:
    print(0)

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:
# -*- coding: utf-8 -*-
A, B = map(int, str(input()).split())

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

Submission status: Accepted

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

c = (a+b)//2

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

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

Submission status: Accepted

Solution code:
import sys,collections,math,random;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b = Is()
if abs(a-b)%2 == 1:
    print("IMPOSSIBLE")
else:
    print(min(a,b) + abs(a-b)//2)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

dist = (B - A) / 2
if dist.is_integer():
    print(int(A+dist))
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 (a^b)&1 :
    print('IMPOSSIBLE')
else :
    print((a+b)//2)

Submission status: Accepted

Solution code:
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

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

mod = 1000000007

if __name__ == "__main__":
    A,B= map(int, sys.stdin.readline().split())
    n = (A+B)/2
    j = (A+B)%2
    if j == 0:
        print(int(n))
    else:
        print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
N,K = list(map(lambda x: int(x),input().split()))
if (N+K)%2==0:
    print(int((N+K)/2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

k = (a +b) / 2

if k % 1 > 0:
	print( "IMPOSSIBLE")
else:
	print( int(k) )

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 = [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().strip().split())
a, b = divmod(A + B, 2)
if b == 0:
  print(a)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

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

a,b = map(int,raw_input().split(" "))


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 2つの入力を空白で分割し、数値化
A, B = map(int, input().split())

Z = abs(A-B)
if (Z /2).is_integer():
    print(int(abs(min(A, B) + (Z/2))))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
from sys import stdin
a,b = map(int,input().split())

c=(a+b)/2

if c%1.0!=0:
    print('IMPOSSIBLE')
else:
    print(int(c))

Submission status: Accepted

Solution code:
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from collections import defaultdict, deque
import math
from math import factorial
import fractions
import re

BIGNUM = 10 ** 9 + 7

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

N=int(ini[0])
K=int(ini[1])

mod=(N+K)%2
if mod==1:
    print("IMPOSSIBLE")
else:
    print(int((N+K)/2))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

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

Submission status: Accepted

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

if A <0 and B<0:
    print('IMPOSSIBLE')
else:
    m = abs(A-B)
    if m%2==1:
        print('IMPOSSIBLE')
    else:
        print(int(m/2+min(A,B)))

Submission status: Accepted

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

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