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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
x = input().split()

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

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque
import itertools
from itertools import permutations
import sys
import bisect
sys.setrecursionlimit(10**6)
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
YNeos='YNeos'
mo=10**9+7
imp='IMPOSSIBLE'


n,m=MI()
ans=(n+m)//2 if (n-m)%2==0 else imp

print(ans)

Submission status: Accepted

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

if a > b:
    small = b
    big = a
elif a == b:
    print(0)
    exit()
else:
    small = a
    big = b

if (big-small)%2 != 0:
    print("IMPOSSIBLE")
else:
    print(small+(big-small)//2)

Submission status: Accepted

Solution code:
s = input().split(' ')

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

sub = a+b

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

Submission status: Accepted

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

Submission status: Accepted

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

sums=a+b

if sums//2 == sums/2:
  print(sums//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:
#!venv/bin/python
#from collections import defaultdict 
from itertools import combinations
from collections import defaultdict
from pprint import pprint
import math
import datetime
import sys

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

k = (a + b) / 2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    if abs(A - B) % 2:
        print('IMPOSSIBLE')
        return
    print(max(A, B) - (abs(A - B) // 2))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

main()

Submission status: Accepted

Solution code:
import math
import copy
from operator import mul
from functools import reduce
from collections import defaultdict
from collections import Counter
from collections import deque
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
# 一次元累積和
from itertools import accumulate
from bisect import bisect_left, bisect_right

import re
# import numpy as np
# from scipy.misc import comb

def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

# 四方向: 右, 下, 左, 上
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
 
def i_inpl(): return int(input())
def l_inpl(): return list(map(int, input().split()))
def line_inpl(x): return [i_inpl() for _ in range(x)]

INF = int(1e18)
MOD = int(1e9)+7 # 10^9 + 7

# W行H列, x[W][H]
def create_grid(W, H, value = 0):
    return [[ value for _ in range(H)] for _ in range(W)]

########

A, B = l_inpl()

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

Submission status: Accepted

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

AB = (A + B) / 2

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

Submission status: Accepted

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

c = abs(a-b)

if c % 2 == 0 :
  x = abs((a**2 - b**2)/(2*b - 2*a))
  print(int(x))
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:
def main():
    a,b = map(int,input().split())
    k = (a**2-b**2)/(a-b)/2
    if k == int(k):
        print(int(k))
    else:
        print("IMPOSSIBLE")
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys;
import string;
sys.setrecursionlimit(20000) # 再起呼び出しの最大数をセット

import copy
import math
import itertools

from functools import lru_cache
#@lru_cache(maxsize = None)

PPP = 1000000007

# 整数の入力
#n = int(input())

# スペース区切りの入力
#n, x = input().split()

# スペース区切りの整数の入力
a, b = map(int, input().split())
#n, x = map(int, input().split())
#print("sp", n, k, file=sys.stderr)
#a = [int(x) for x in input().split()]
#b = [int(x) for x in input().split()]
#print("a", a, file=sys.stderr)
#p, q, r = map(int, input().split())
#s = [int(x) for x in input().split()]
#t = [int(x) for x in input().split()]

# 改行区切りの整数の入力
#a = []
#for x in range(n):
#  a.append(int(input()))
#  a.append([int(x) for x in input().split()])
#b = []
#for x in range(m):
#  b.append([int(x) for x in input().split()])
#p = [int(x) for x in input().split()]
#a.sort()
#print(l, file=sys.stderr)

# 文字列の入力
#s = input()

# 出力
#print("{} {}".format(a+b+c, s))
#a.sort()
#print(set(a), file=sys.stderr)
#print(len(set(a)))

#cache = dict()

import re
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def ton(n, k, x):
  s = ""
  while n > 0:
    s = str(n%k) + s
    n //= k
  return s


#print("a", a, file=sys.stderr)
#print("b", b, file=sys.stderr)

def getEnergy():
  for y in b:
    yield y

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

def yn():
  if doit():
    return "Yes"
  else:
    return "No"

#print(doit([0] * 4))
#doit(a)
#print(doit())
try:
  doit()
  #print(doit())
  #print(yn())
except Exception as e:
  print("e", e, file=sys.stderr)

Submission status: Accepted

Solution code:
a, b = list(map(lambda x : int(x), 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())


c = a + b


print('{}'.format(int(c/2))) if c % 2 == 0 else print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

if a%2 != b%2:
    print("IMPOSSIBLE")
else:
    m = max(a,b)
    n = min(a,b)
    print((m-n)//2 + n)

Submission status: Accepted

Solution code:
ab = [int(x) for x in input().split(' ')]

if(ab[0] == ab[1]):
    print("0")
elif((ab[0] + ab[1]) % 2 == 0):
    print((ab[0] + ab[1])//2)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

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

Submission status: Accepted

Solution code:
# ABC 135, A
X = [int(el) for el in input().split(' ')]

if X[0] == X[1]:
    print(0)
else:
    k = (X[0] + X[1])/2
    if k.is_integer():
        print(int(k))
    else:
        print('IMPOSSIBLE')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = max(A, B)
b = min(A, B)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

A,B = [int(zz) for zz in input().split()]

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

if K == int(K):
    print(int(K))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=input().split(" ")
n=sorted(n)
n[0]=int(n[0])
n[1]=int(n[1])
if (n[0]+n[1])%2==0:
    print(int((n[0]+n[1])/2))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

t = abs(a + b) / 2

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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())
sum = a + b

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

Submission status: Accepted

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

if A > B:
  n = (A-B) / 2
  r = (A-B) % 2
  if r == 0:
    print(int(B + n))
  else:
    print('IMPOSSIBLE')
    
else:
  n = (B-A) / 2
  r = (B-A) % 2
  if r == 0:
    print(int(A + n))
  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:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

K = (A + B) / 2

if int(K) == K:
    print(int(K))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
from scipy.misc import comb
sys.setrecursionlimit(1000000)
 
a,b = map(int,input().split())

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

if n == int(n):
    print(int(n))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    A, B = [int(x) for x in sys.stdin.readline().split()]

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



if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

Submission status: Accepted

Solution code:
import io
import sys


def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
998244353 99824435
'''


def MAIN():
  # T_IN()
  A()


def A():
  a, b = IN_L_I()
  if (a + b) % 2 != 0:
    print("IMPOSSIBLE")
    exit()

  d = (a + b) // 2
  print(d)

  return None


def B():
  return None


def C():
  return None


MAIN()

Submission status: Accepted

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

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

Submission status: Accepted

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

if a>b:
    i = a-b
    big =a
else:
    i = b-a
    big = b

if i % 2 == 0:
    print( big - int(i/2))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

if a > b:
  c = a
  a = b
  b = c

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

Submission status: Accepted

Solution code:
import numpy as np

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

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 (b-a) % 2 == 1:
    print("IMPOSSIBLE")
else:
    print(round((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())
s = abs(a + b)
print(s//2 if s % 2 == 0 else "IMPOSSIBLE")

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

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

Submission status: Accepted

Solution code:
a, b = (int(_) for _ in input().split())
if abs(a - b) % 2 != 0:
    print('IMPOSSIBLE')
else:
    dis = abs(a-b) // 2
    if a < b:
        print(a + dis)
    elif b < a:
        print(b + dis)

Submission status: Accepted

Solution code:

A, B = map(int, input().split())
if abs(A-B) % 2 == 0:
    tmp = abs(A-B) // 2
    if A > B:
        print(B + tmp)
    else:
        print(A + tmp)
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

A = W[0] + W[1]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

else:
  print(int((A+B)/2))

Submission status: Accepted

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

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

if a < b:
    a1 = a
    a2 = b
else:
    a1 = b
    a2 = a

K = (a1 + a2)/2.
if K.is_integer():
    print(int(K))
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

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

Submission status: Accepted

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

K = (A+B)/2

if K.is_integer() == True:
    print(int(K))
else:
    print("IMPOSSIBLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

K = (A + B) / 2

if A == B:
    print(0)
elif K.is_integer():
    print(int(K))
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())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

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

Submission status: Accepted

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

A = parents[0]
B = parents[1]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
gi = lambda : list(map(int,input().strip().split()))
a, b = gi()
if (a + b)%2:
	print("IMPOSSIBLE")
	exit()
print((a + b)//2)

Submission status: Accepted

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

Submission status: Accepted

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

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

K = (A + B) // 2

print(K)

Submission status: Accepted

Solution code:
import sys
a, b = [int(i) for i in sys.stdin.readline().split()]
n = (a + b) / 2
if n.is_integer():
    print(int(n))
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(int(k))
else:
        print('IMPOSSIBLE')

Submission status: Accepted

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

res='IMPOSSIBLE'

if (b-a)%2==0:
	res=(a+b)//2

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int,input().split()) # 複数の数字を変数に格納

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

Submission status: Accepted

Solution code:
def main():
    a,b=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)%2 ==1:
    print('IMPOSSIBLE')
else:
    print((a+b)//2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import decimal
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())
k=(a+b)/2
k1=(a+b)//2
if k==k1:
    print(k1)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a, b = readmi()
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:
#!/usr/bin/env python3


def solv(a, b):
    k2 = a + b
    if k2 % 2:
        return 'IMPOSSIBLE'
    else:
        return k2 // 2


if __name__ == '__main__':

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

    ans = solv(a, b)

    print(ans)

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


if __name__ == "__main__":
    resolve()

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

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()[:2])
k=A+B
if k%2==1:
    print('IMPOSSIBLE')
else:
    print(k//2)

Submission status: Accepted

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

sum = A+B

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if (a % 2 == 0 and b%2 != 0) or (a % 2 != 0 and b%2 == 0):
    print("IMPOSSIBLE")
    exit()

print((a+b)//2)

Submission status: Accepted

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

a = int(A)
b = int(B)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, raw_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 = (a + b) / 2
d = (a + b) // 2
if c == d:
    print(int(c))
else:
    print("IMPOSSIBLE")