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:
def main():
    inp = input().split(' ')
    a = int(inp[0])
    b = int(inp[1])
    if ((a + b) / 2).is_integer():
        print(str((a + b) // 2))
    else:
        print('IMPOSSIBLE')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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


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

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:
N,M = map(int,input().split(' '))

if abs(N-M)%2==0:
    k = int(abs(N-M)/2)
    if N>M:
        print(M+k)
    else:
        print(N+k)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

hoge = abs(A-B)

if hoge % 2 == 0:
    print(min(A, B) + hoge//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:
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
Mod = 1000000007



def main(): #startline-------------------------------------------
    A,B = map(int,input().split())
    if A == B or A == -B:
        print(0)
    else:
        if (A+B) % 2 == 0:
            print((A+B)//2)
        else:
            print("IMPOSSIBLE")
if __name__ == "__main__":
    main() #endline===============================================




def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n < 2 is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))):
        if prime[i] == 1:
            for j in range(2*i,n):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n):
        if prime[i] == 1:
            res.append(i)
    return res

class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py

    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]


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

if((N+K)%2!=0):
    print ("IMPOSSIBLE")
else:
    print ((N+K)//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 = input().split();

a = int(a)
b = int(b)

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

Submission status: Accepted

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

Submission status: Accepted

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

c = (a + b) /2 

if int(c) == c:
    print(int(c))

else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

if float.is_integer((a+b)/2):
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

if abs(b-a) % 2 == 0:
    print(min(a, b) + abs(b-a)//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:
#!/usr/bin/env python3
import sys

NO = "IMPOSSIBLE"  # type: str

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


# 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 = 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((A+B)//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    A, B = InputToInt()
    if (A-B)%2 == 1:
        print('IMPOSSIBLE')
    else:
        print(abs(int((A+B)/2)))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

K2 = (A + B)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

if (max(A,B) - min(A,B)) % 2 == 0:

    print (max(A,B) - (max(A,B) - min(A,B)) // 2)

else:

    print ("IMPOSSIBLE")

Submission status: Accepted

Solution code:
def INT_(n): return int(n)-1
def MI(): return map(int, input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_, input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n: int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split())) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n
# 
# s = input()

imp = "IMPOSSIBLE"
a, b = map(int, input().split())

hoge = (a + b)
ans = imp
if hoge % 2 == 0:
    ans = hoge // 2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

    c = a + b

    if c % 2:
        print('IMPOSSIBLE')
    else:
        print(c // 2)

    return


if __name__ == '__main__':
    submit()

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

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

print(ans)

Submission status: Accepted

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

k=x+y

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

Submission status: Accepted

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

Submission status: Accepted

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

a = (A + B) / 2
if float.is_integer(a):
    print(int(a))
else:
    print("IMPOSSIBLE")

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def solve():
    A, B = list(map(int, input().split()))
    if A < B:
        A, B = B, A
    if (A - B) % 2 != 0:
        return 'IMPOSSIBLE'
    return (A - B) // 2 + B


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

ab = a+b

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

Submission status: Accepted

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

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

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:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/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 = [int(i) for i in input().split()]

ans = A + B

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
A,B = [int(x) for x in stdin.readline().rstrip().split()]
if (A + B) % 2 == 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math


#n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))
a = hoge[0]
b = hoge[1]

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(abs(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(min(a,b)+abs(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:
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())

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.is_integer():
    print(int(ans))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

if abs(a-b) % 2 == 1:
    print("IMPOSSIBLE")
else:
    c = abs(a-b) / 2
    print(int(max(a,b) - c))

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:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
MOD = 10**9 + 7
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###

A, B = mi()

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

Submission status: Accepted

Solution code:


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

k = (A+B)//2

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

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

Submission status: Accepted

Solution code:


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






main()

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

a,b= [ int(x) for x in sys.stdin.readline().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())
if (A+B)%2 == 0:
  K = (A+B)//2
  print(K)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
import sys

def debug(*args):
    print(*args, file=sys.stderr)


def solve(A, B):
    if A > B:
        A, B = B, A
    if (B - A) % 2 == 1:
        return "IMPOSSIBLE"
    return A + ((B-A)//2)

def main():
    A, B = [int(x) for x in input().split()]
    print(solve(A, B))

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = map(int,raw_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.0
if int(K) - K == 0:
    print(int(K))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
def main():
    a,b = map(int,input().split())
    if a == b:
        print(0)
        return
    if (a+b)%2 == 0:
        print((a+b)//2)
        return

    print('IMPOSSIBLE')


main()

Submission status: Accepted

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

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A,B=MAP()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
l=[a,b]
l=sorted(l)
x,y=l[0],l[1]
#x<y

if (y-x)%2==0:
    print(x+(y-x)//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def main():

	#S = int(input())
	# = list(input())
	A,B = map(int, input().split(" "))
	#L = list(map(int, input().split(" ")))

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

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


if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))
from collections import deque  # 双方向キュー
from collections import defaultdict  # 初期化済み辞書
from heapq import heapify, heappush, heappop, heappushpop  # プライオリティキュー
from bisect import bisect_left, bisect_right  # 二分探索
sys.setrecursionlimit(int(1e+6))
MOD = int(1e+9) + 7
#import numpy as np  # 1.8.2
#import scipy  # 0.13.3

def main():
    A, B = i2nn()
    K = (A + B) // 2
    K2 = (A + B) / 2
    if K == K2:
        print(K)
    else:
        print('IMPOSSIBLE')

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
MAX_INT = int(10e9)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B = IL()
ans = (A+B)/2
if int(ans) == math.ceil(ans):
    print(int(ans))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if a == b:
    print(0)
elif (b-a) % 2 == 0:
    print((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:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#

import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

    if X%2 == 1:
        print('IMPOSSIBLE')
    else:
        print(X//2)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy,copy
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 LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n,m=MAP()

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


if  __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)

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