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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())
if abs(a - b) % 2 != 0:
    print('IMPOSSIBLE')
    exit()
print(abs(a - b) // 2 + min(a, b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = input().split()
s = int(n) + int(m)
if s%2==0:
  print(s//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(max(A,B) - abs(A-B)//2)

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 = list(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())
k = (a+b)//2

if abs(a-k) == abs(b-k):
    print(k)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
ll= lambda : list(map(int,input().split()))
testcases=1
# testcases=int(input())
for testcase in range(testcases):
    [a,b]=ll()
    if((a-b)&1):
        print("IMPOSSIBLE")
    else:
        print((a+b)//2)

Submission status: Accepted

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

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = (a+b)/2

if float.is_integer(ans):
    print(int(ans))

else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

debug = True
#debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    a, b = LI()
    c = max(a, b)
    d = min(a, b)

    if (c - d) % 2 == 1:
        print("IMPOSSIBLE")
        return

    print((c+d)//2)

solve()

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy
from __future__ import division, print_function

import os
import sys
from __builtin__ import xrange as range
from cStringIO import StringIO
from future_builtins import ascii, filter, hex, map, oct, zip
from io import IOBase

import __pypy__


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


# region fastio

BUFSIZE = 8192


class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count("\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()


class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()


def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

A, B = [int(x) for x in stdin.readline().rstrip().split()]

tmp = A+B

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
a, b = map(int, input().split())
if (b - a) % 2 == 0:
    k = a + (b-a)/2
    print(int(k))
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())
if a == b:
    print(a)
else:
    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("IMPOSSIBLE")
else:
  print((A+B)//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

NO = "IMPOSSIBLE"  # type: str


def solve(A: int, B: int):
    K = (A + B)/2
    if K % 1 == 0:
        print(int(K))
    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:
#!/usr/bin/env python3
import sys

NO = "IMPOSSIBLE"  # type: str

def solve(A: int, B: int):
    d = A-B
    if d % 2 != 0:
        print(NO)
        return
    print((A + B) // 2)
    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 = 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 % 2 == b % 2:
	print((a + b)//2)
else:
	print("IMPOSSIBLE")

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

fin = sys.stdin.readline
A, B = [int(elem) for elem in fin().split()]

sum_ab = A + B

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

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
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 abs(A-B)%2 == 0:
        print(min(A,B)+abs(A-B)//2)
    else:
        print("IMPOSSIBLE")
if __name__ == '__main__':
    main()

Submission status: Accepted

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int,input().split())

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

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


A, B = list(map(int, sys.stdin.readline().split()))
if (A + B) & 1:
    print('IMPOSSIBLE')
else:
    print((A + B)//2)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
x = abs(a-b)
if x % 2 == 0:
    print(x//2 + min(a, b))
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 python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
def main():
    a, b = map( int, input().split())
    if a > b:
        a, b = b, a
    if (b-a)%2 == 1:
        print("IMPOSSIBLE")
    else:
        print(a + (b-a)//2)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
a, b = [int(item) for item in input().split()]
ans = (a + b) // 2

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

Submission status: Accepted

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

Submission status: Accepted

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

import itertools as ite
import math
import random
import sys
import codecs
from collections import defaultdict

INF = 10 ** 18
MOD = 10 ** 9 + 7

sys.setrecursionlimit(1000000)

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

Submission status: Accepted

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

def get_num():
    return int(input())


def get_nums(n):
    res = [0 for _ in range(n)]
    for i in range(n):
        res[i] = int(input())
    return res


def get_numbers():
    return map(int, input().split())


a, b = get_numbers()


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
  return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

#################

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


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

    if k == int(k):
        print(int(k))
    else:
        print("IMPOSSIBLE")


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


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


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


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


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B):
    if (A + B) % 2 != 0:
        return 'IMPOSSIBLE'
    return (A + B) // 2


def main():
    A, B = read_int_n()
    print(slv(A, B))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[a,b] = [int(i) for i in input().split()]
if (a-b) % 2 == 0:
    print(min(a,b) + int(abs(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:
inf = 10 ** 18
P = 10 ** 9 + 7

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

ans = (A + B) // 2

if abs(A - ans) == abs(B - ans):
    print(ans)
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())

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from copy import *
from sys import *
import math
import queue
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)

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

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

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

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(m,n):
	x = max(m,n)
	y = min(m,n)
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	return y

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:



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

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

Submission status: Accepted

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