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:
from heapq import heappush, heappop
import re
from collections import deque
import sys
import math
input = sys.stdin.readline


def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return tuple(map(int, ss_raw()))


DIV = 10**9+7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


def main():
    A,B = ints_raw()
    if abs(A-B)%2==1:
        return "IMPOSSIBLE"
    else:
        return (A+B)//2

print(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= [int(s) for s in input().split()]
if((a+b)%2==0):
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

Submission status: Accepted

Solution code:
A,B = [int(x) for x in input().split()]
if((A+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('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:
import sys
input=sys.stdin.readline
a,b=map(int,input().split())
if a%2==b%2:
    print((a+b)//2)
else:
    print('IMPOSSIBLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))

n,m = m()

if (n+m)/2 == (n+m)//2:
	print((n+m)//2)
else:
	print("IMPOSSIBLE")

Submission status: Accepted

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

Submission status: Accepted

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

s = abs(b - a)

if s % 2 == 0:
  print(min(a, b) + s //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:
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())
c = a+b
if c%2 == 1:
    print('IMPOSSIBLE')
else:
    print(c//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:
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, accumulate
from operator import itemgetter, mul
from copy import deepcopy
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

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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, raw_input().split())
if (a + b) % 2 == 1:
    print 'IMPOSSIBLE'
else:
    print (a + b) >> 1

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if A > B:
    A, B = B, A
if (B - A) % 2 == 1:
    print("IMPOSSIBLE")
else:
    print((B + A)//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:
#!/usr/bin/env python3
import sys
INF = float("inf")


def no():
    print("IMPOSSIBLE")  # type: str


def solve(A: int, B: int):
    K = (A+B)//2
    if abs(A-K) == abs(B-K):
        print(K)
    else:
        no()

    return


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

Submission status: Accepted

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

def main():
    # N = int(input())
    # s = input()
    a, b = map(int, input().split())
    # a = list(map(int, input().split()))
    # a = [int(input()) for i in range(N)]
    if (a+b)&1 == 1:
        print("IMPOSSIBLE")
    else:
        print((a+b)//2)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=[int(i) for i in input().split()]
if (n+m)%2==0:
  print((n+m)//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())
K = (A+B)//2
if abs(K-A)!=abs(K-B):
    K = "IMPOSSIBLE"
print(K)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
# S=numpp.assaray(S)=="#"
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LLS(): return [list(sys.stdin.readline().rstrip()) for _ in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()



def main():
    A, B = 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:
import math
import fractions
import copy
import numpy as np
def j(q):
    if q==1: print("Yes")
    elif q == 0:print("No")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def printrow(a):
    for i in a:
        print(i)
"""
#decomment when needed
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
"""
a,b  =ips()
if (a+b)%2:
    print("IMPOSSIBLE")
else:print((a+b)//2)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

s = sum([int(i) for i in readline().split()])

if s%2: print("IMPOSSIBLE")
else: print(s//2)

Submission status: Accepted

Solution code:
A,B = (int(x) for x in 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 abs(a - b) % 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:
    print("IMPOSSIBLE")
else:
    print((a+b)//2)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math


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

Submission status: Accepted

Solution code:
A, B = [int(elem) for elem in input().split()]
print((A + B) // 2 if (B - A) % 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())
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==1:
    print("IMPOSSIBLE")
else:
    print((A+B)//2)

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:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,b = LI()
    if (a-b)%2 == 0:
        print((a+b)//2)
    else:
        print("IMPOSSIBLE")
    return

#B
def B():
    n = I()

    return

#C
def C():
    n = I()

    return

#D
def D():
    n = I()

    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    A()

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    
    a, b = map(int, input().split())
    a += b
    if a & 1:
        print("IMPOSSIBLE")
    else:
        print(a // 2)
    
    return 0

main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)

NO = "IMPOSSIBLE"  # type: str

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


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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import deque
from bisect import bisect_left
S = input()
# dp[i][j]はうしろからi桁を13で割った余りがjであるものの個数
dp = [[0] * 13 for _ in range(len(S) + 1)]
dp[0][0] = 1
mul = 1
mod = 10**9 + 7

for i in range(len(S)):
  x = S[-(i+1)]
  if x == '?':
    for k in range(10):
      for j in range(13):
        dp[i+1][(mul*k+j)%13] += dp[i][j]
        dp[i+1][(mul*k+j)%13] %= mod
  else:
    k = int(x)
    for j in range(13):
      dp[i+1][(mul*k+j)%13] += dp[i][j]
      dp[i+1][(mul*k+j)%13] %= mod
  mul = mul*10 % 13  
print(dp[len(S)][5])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

def Input():
    return mapt(int, input().split(" "))


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

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
c = 0
for i in range(n):
  if a[i] != i + 1:
    c+=1
    
if c == 0 or c == 2:
  print('YES')
  
else:
  print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
a,b = ma()
k2 = abs(b-a)
if k%2==1:
    print(k2//2+min(b,a))
else:
    print("IMPOSSIBLE")

Submission status: Runtime Error

Solution code:
import math
count = 0
n,d = map(int,input().split())
for i in range(n):
  x,y = map(int,input().split())
  if x**2+y**2 ** 0.5 <= d:
    count += 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

cnt=0

for i in range(n):
  if a[n-i]>=b[n-1-i]:
    cnt+=b[n-1-i]
  else:    
    if a[n-1-i]-(b[n-1-i]-a[n-i])>=0:
      a[n-1-i]-=b[n-1-i]-a[n-i]
      cnt+=b[n-1-i]
    else:
      cnt+=a[n-i]+a[n-1-i]
      a[n-1-i]=0
      
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def solv():
    n = int(input())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    ans = 0

    for i in range(n+1):
        x = A[i] + A[i+1]
        ans += min(x,B[i])
        A[i+1] = min(A[i+1],max(x-B[i+1],0))
    print(ans)

solve()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())

step = sum([90*100**i for i in range(len(str(N))//2)])
dance_floor = sum([9*100**i for i in range(len(str(N))//2)])

ans = len(str(N))%2 * (N-step)  +  -1*(len(str(N))%2-1) * dance_floor
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
q = 0
for i in range(n):
 for j in range(i+1, n):
  t = a[i]
  a[i] = a[j]
  a[j] = t
  f = 1  
  lst = - 1100
  for k in a:
   f &= k > lst
   lst = k
  q |= f
  t = a[i]
  a[i] = a[j]
  a[j] = t
print("YES" if q else "NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input()
*p,=map(int,input().split())
print('YNEOS'[2<sum(i!=j for i,j in zip(p,sorted(p)))::2])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())                                    │abc136  abc138  abc140  abc142  abc144  abc146  abc148
k = a+b                                                           │abc137  abc139  abc141  abc143  abc145  abc147  python
if k%2:                                                           │(base) rrif@rrif-dynabook-T65-EG:~/document/atcoder$ mkdir abc 13
    print('INPOSSIBLE')                                           │5
else:                                                             │(base) rrif@rrif-dynabook-T65-EG:~/document/atcoder$ rm -r abc
    print(k//2)

Submission status: Runtime Error

Solution code:
f=lambda:map(int,input().split())
input()
p,*A=f()
B=f()
monster = 0
for a, b in zip(A, B):
    t = min(b, p+a)
    p = a - max(0, t-p)
    monster += t
    
print(monster)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
length = int(input())
list_p = list(map(int,input().split()))
#list_p.sort()
count = 0
for i in range(length):
  if list_p[i] != (i+1):
    count += 1
 
if count <= 2 :
  print ("YES")
else :
  print ("NO")

Submission status: Runtime Error

Solution code:
n = int(input())
p = list(map(int,input().split()))
cnt = 0
for i in range(n):
  if p[i] != (i+1):
    cnt += 1
print("YES" if cnt == 0 or cnt == 2 else "NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

n=ii()
a=li()
b={}
for i in range(len(a)):
    b[a[i]]=i
a.sort()
x=[]
for i in range(n):
    if i!=b[a[i]]:
        x.append([i,b[a[i]]])
# print(x)
if(len(x)>2):
    print("No")
elif(len(x)==2 and x[0][0]!=x[1][1]):
    print('No')
else:
    print("Yes")

Submission status: Runtime Error

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

# for _ in range(ii()):
a,b=mi()
if((b+a)%2):
    print("IMPOSSIBLE")
else:
    x=abs(b+a)//2
    print(x)

Submission status: Runtime Error

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

# for _ in range(ii()):
a,b=mi()
if((b+a)%2):
    print("IMPOSSIBLE")
else:
    x=abs(b+a)//2
    # print(abs(a-x),abs(b-x))
    if(abs(a-x)==abs(b-x)):
        print(abs(a-x))
    else:
        print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

if __name__ == '__main__':

    ABC_135_A()

Submission status: Runtime Error

Solution code:
t = sum(map(int, input())
if t % 2 == 0:
    print(t//2)
else:
    print("IMPOSSIBLE")

Submission status: Runtime Error

Solution code:
S = input()
l = len(S)
dp = [[0] * 13 for _ in range(l+1)]
dp[0][0] = 1
MOD = 10 ** 9 + 7
mul = 1
for i in range(l):
    if S[-(i+1)] == '?':
        for j in range(10):
            for k in range(13):
                dp[i+1][(j * mul + k) % 13] += dp[i][k]
                dp[i+1][(j * mul + k) % 13] %= MOD
    else:
        j = int(S[-(i+1)])
        for k in range(13):
            dp[i+1][(j * mul + k) % 13] += dp[i][k]
            dp[i+1][(j * mul + k) % 13] %= MOD
    mul = mul * 10 % 13
print(dp[l][5])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# N = int(input())
# S = input()
A, B = map(int, input().split())
# A = list(map(int, input().split()))
if (A + B) % 2 == 0:
    print((A + B)) // 2)
else:
    print("IMPOSSIBLE")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=eval(input().replace(' ', '+');print(a%2*'IMPOSSIBLE' or a//2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = map(int,input(),split())
f=True
for i in range(max(a,b)):
  if abs(a-i)==abs(b-i):
    print(i)
    f=False
    break
if f:
  print("IMPOSSIBLE")

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A, B;
    cin >> A >> B;
    ll c = A + B;
    if (c % 2 == 1)
        cout << "IMPOSSIBLE" << endl;
    else
        cout << c / 2 << endl;
    return 0;
}