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: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
num = [int(i) for i in input().split()]
flag = 0
if num == sorted(num):
  flag = 1
else:  
  sorted_num = sorted(num)
  for i in range(n):
    if flag == 1:
      break
    for j in range(n-i-1):
      temp = num[i]
      num[i] = num[i+j+1]
      num[i+j+1] = temp
      if num == sorted_num:
        flag = 1
        break
      else:
        temp = num[i]
        num[i] = num[i+j+1]
        num[i+j+1] = temp
if flag == 1:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
num = [input() for i in range(2)]
k = (num[0] + num[1]) / 2
if k > int(k):
  print(IMPOSSIBLE)
else:
  print(k)

Submission status: Runtime Error

Solution code:
#入力
A = input()
B = input()

#A,B ＝　数値化　M,m　＝　初期化
A = int(A)
B = int(B)
m = 0

#K探し
m = ( A + B ) / 2

#K判定および表示
if m.is_integer():
    print( '%d' %m)
else :
    print('IMPOSSIBLE')

Submission status: Runtime Error

Solution code:
N = int(input())
p = list(map(int,input().split()))
count = 0
for i in range(1,N+1):
    if p[i-1] != i:
        count += 1
    if count >2:
        print('NO')
        exit(0)
print('YES')

Submission status: Runtime Error

Solution code:
P=[1,10,9,12,3,4]
m=10**9+7
def f(A,p,N):
    if p==0:return [1&(i in N) for i in range(13)]
    p%=6
    B=[0]*13
    for n in N:
        for i in range(13):
            c=(i+(n*P[p]))%13
            B[c]=(B[c]+A[i])%m
    return B

S=reversed(input())
A=[0]
for p,s in enumerate(S):
    if s=="?":A=f(A,p,range(10))
    else:A=f(A,p,[int(s)])
print(A[5])

Submission status: Runtime Error

Solution code:
N = int(input())
p = list(map(int, input().split()))
cnt = 0
for n in range(N):
    if p[n] != n+1:
        cnt+=1

if cnt <= 2:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
N = int(input())
p = list(map(int, input().split()))
q = p.copy()
cnt = 0
for n in range(N):
    if p[n] != q[n]:
        cnt+=1

if cnt <= 2:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
N = int(input())
m = list(map(int, input().split()))
count = 0

for i in range(N-1):
  if abs(m[i+1] - m[i]) > 1:
    count += 1

if count >= 3:
  print('NO')

else:
  print('YES')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
i = int(input())
l = list(map(int, input().split()))
s = sorted(l)
f = 0

for n in range(i):
    if l[n] == n+1:
        continue
    else:
        f = f + 1
        continue
print(f)
if f == 2:
    print('YES')
elif f == 0:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B = 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 = 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 = map(int, input().split())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())

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

Submission status: Runtime Error

Solution code:
s=input()
l=len(s);mod=10**9+7
dp=[[0]*13 for i in range(l)]
rem=[1,10,9,12,3,4]
for i in range(l)[::-1]:
  dig=i%6
  if s[i]=="?":
    if i==l-1:
      for j in range(10):
        dp[-1][(j*rem[dig])%13]=1
    else:
      for j in range(10):
        for h in range(13):
          dp[i][(h+j*rem[dig])%13]+=dp[i+1][h]
          dp[i][(h+j*rem[dig])%13]%=mod
  else:
    a=int(s[i])
    if i==l-1:
      dp[i][(a*rem[dig])%13]=1
    else:
      for j in range(13):
        dp[i][(j+a*rem[dig])%13]+=dp[i+1][j]
        dp[i][(j+a*rem[dig])%13]%=mod
print(dp[0][5])

Submission status: Runtime Error

Solution code:
s=input()
mod = 1000000007
 
dp = [[0 for l in range(13)] for m in range(len(s)+1)]
dp[0][0] = 1
for i in range(1,len(s)+1):
  p = 10**(int((i-1)%12))%13
  if s[-i] == '?':
    for j in range(10):
      for k in range(13):
        dp[i][(k+j*p)%13] += dp[i-1][k]
        dp[i][(k+j*p)%13] %mod
  else:
    for k in range(13):
      dp[i][(int(s[-i])*p +k)%13] += dp[i-1][k]
      dp[i][(int(s[-i])*p +k)%13] %mod
 
print(dp[len(s)][5] %mod)

Submission status: Runtime Error

Solution code:
s=input()
mod = 1000000007
 
dp = [[0 for l in range(13)] for m in range(len(s)+1)]
dp[0][0] = 1
for i in range(1,len(s)+1):
  p = 10**(int((i-1)%12)) %mod
  if s[-i] == '?':
    for j in range(10):
      for k in range(13):
        dp[i][(k+j*p)%13] += dp[i-1][k]
        dp[i][(k+j*p)%13] %mod
  else:
    for k in range(13):
      dp[i][(int(s[-i])*p +k)%13] += dp[i-1][k]
      dp[i][(int(s[-i])*p +k)%13] %mod
 
print(dp[len(s)][5] %mod)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B=input().sprit(" ")
A,B=int(A),int(B)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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



if (a+b)%2 == 1:
    print (IMPOSSIBLE )

print ((a+b)/2)

Submission status: Runtime Error

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



if (a+b)%2 == 1:
    print (IMPOSSIBLE )

print ((a+b)%2)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

swap = 0
done = False
ok = True
for i in range(n):
    p = next(ps)
    if p != i+1:
        if done:
            ok = False
            break
        elif swap != 0:
            if swap == i+1:
                done = True
                swap = 0
            else:
                ok = False
                break
        else:
            swap = p

if ok:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if abs(A-K)==abs(B-K):
    print(K)
else:
    print('IMPOSSIBLE')

Submission status: Runtime Error

Solution code:
N = int(input())
monster = list(map(int, input().split()))
hero = list(map(int, input().split()))

total = 0
i = -1

for i in range(N + 1):
    if i == 0:
        if monster[0] < hero[0]:
            total += monster[0]
            hero[0] -= monster[0]
            monster[0] = 0
        else:
            total += hero[0]
            monster[0] -= hero[0]
            hero[0] = 0
            
    elif i < N:
        if monster[i] < hero[i - 1]:
            total += monster[i]
            hero[i - 1] -= monster[i]
            monster[i] = 0
        else:
            total += hero[i - 1]
            monster[i] -= hero[i - 1]
            hero[i - 1] = 0
            
            if monster[i] < hero[i]:
                total += monster[i]
                hero[i] -= monster[i]
                monster[i] = 0
            else:
                total += hero[i]
                hero[i] = 0
                monster[i] -= hero[i]
    else:
        if monster[N] < hero[N - 1]:
            total += monster[N]
        else:
            total += hero[N - 1]

print(total)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i in range(n):
    if p[i] != i + 1:
        count += 1
if count == 0:
    print('YES')

if count == 2:
    print('YES')

if count > 2:
    print('No')

Submission status: Runtime Error

Solution code:
num = int(input())
ls = list(map(str, input().split(" ")))

diff = 0
for i in range(num):
    if (ls[i] != i+1):
        diff += 1

if diff == 2 or diff == 0:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
k = int(input())
x, y = [int(i) for i in raw_input().split()]
 
def solve(k, x, y):
    if x < 0:
        x = -x
    if y < 0:
        y = -y
 
    if x==0 and y==0:
        print 0
        return
 
    if (x-y)%2==1 and k%2==0:
        print -1
        return
 
    output = [(x,y)]
    while True:
        # print 'while', x,y
        if x+y == k:
            break
        if x==0 and y == 0:
            break
        if x+y<k:
            output.append((abs((x-y)/2), k - abs((x-y)/2)))
            x, y = abs((x-y)/2), k - abs((x-y)/2)
 
        elif x+y <2*k:
            output.append((abs((x-y)/2), k - abs((x-y)/2)))
            x, y = abs((x-y)/2), k - abs((x-y)/2)
            # print 'x,y',x,y
        elif x > k:
            x -= k
            output.append((x,y))
        elif y > k:
            y -= k
            output.append((x,y))
        else:
            x = 0
            y -= x
            output.append((x,y))
 
    print len(output)
 
    for (a,b) in output[::-1]:
        print a, b
 
# k=4
# x,y=9,9
solve(k, x, y)

Submission status: Runtime Error

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

S = input()

MOD =[1,0,0,0,0,0,0,0,0,0,0,0,0]
NMOD =[0,0,0,0,0,0,0,0,0,0,0,0,0]

R10 = range(10)
R13 = range(13)

for i,D in enumerate(S):
    C = -1
    if D == '?':
        for N in R10:
            for M in R13:
                NM = (M * 10 + N) % 13
                NMOD[NM] += MOD[M]
            #end for
        #end for
    else:
        C = int(D)
        for M in R13:
            NM = (M * 10 + C) % 13
            NMOD[NM] += MOD[M]
        #end for
    #end if
    for M in R13:
        MOD[M] = NMOD[M]%1000000007
        NMOD[M] = 0
    #end for
#end for

print(MOD[5])

Submission status: Runtime Error

Solution code:
N = int(input())
List = [int(i) for i in input().split()]
count = 0
for j in range(N):
    if(List[j] != j+1):
        count+=1
if(count <= 2):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int((A + B))

if(C%2 == 1):
    print("IMPOSSIBLE")
else:
    K = C / 2
    print(int(K))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = (A + B)

if(C%2 == 1):
    print("IMPOSSIBLE")
else:
    K = C / 2
    print(int(K))

Submission status: Runtime Error

Solution code:

ab = input().split()
A, B = int(ab[0]), int(ab[1])

if A == B:
    print(1)
    return
elif A % 2 != B % 2:
    print("IMPOSSIBLE")
    return
else:
    K = (A+B) // 2
    if abs(A-K) == abs(B-K):
        print(K)
        return
    else:
        print("IMPOSSIBLE")
        return

Submission status: Runtime Error

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

if A == B:
    print(1)
elif A % 2 != B % 2:
    print("IMPOSSIBLE")
else:
    K = (A+B) // 2
    if abs(A-K) == abs(B-K):
        print(K)
    else:
        print("IMPOSSIBLE")

Submission status: Runtime Error

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

if A == B:
    print(1)    
elif A % 2 != B % 2:
    print("IMPOSSIBLE")
else:
    K = (A+B) // 2
    if abs(A-K) == abs(B-K):
        print(K)
    else:
        print("IMPOSSIBLE")

Submission status: Runtime Error

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

if A == B:
    print(1)
    return
    
if A % 2 != B % 2:
    print("IMPOSSIBLE")
    return
else:
    K = (A+B) // 2
    if abs(A-K) == abs(B-K):
        print(K)
        return 
    else:
        print("IMPOSSIBLE")
        return

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
x={}
x_v=0
count=0
for i,j in enumerate(S):
    if j=="?":
        continue
    else:
        x[len(S)-i-1]=j
for m in x.keys():
    x_v+=int(x[m])*(10**m)
for k in range(10**(len(S))):
    k_l=list(str(k))
    a=0
    b=[]
    c=[]
    for key in x.keys():
        if key>=len(k_l):
            continue
        else:
            b.append( k_l[-key-1]=="0" )
            c.append(1)
    if b==c:
        for n in range(len(k_l)):
            a+=int(k_l[-n-1])*(10**n)
        a+=x_v
        if a%13==5:
            count+=1
    else:
        continue
print(count%(7+10**9))

Submission status: Runtime Error

Solution code:
A=input("")
B=input("")

A=int(A)
B=int(B)

K=0
Ans=0
for K in range(-100000,100000,1):
    if abs(A-K)==abs(B-K):
        print(K)
        Ans=K
        break
if Ans==0:
    print("impossible")

Submission status: Runtime Error

Solution code:
def main(a, b):
  aa = int(a)
  bb = int(b)
  cc = aa - bb
  if (c) % 2 == 0:
    return c
  else:
    return 'IMPOSSIBLE'

if __name__ == '__main__':
  a = input()
  a = a.split(' ')
  main(a[0], a[1])

Submission status: Runtime Error

Solution code:
import numpy as np
from sympy import *
K = symbols("K", real=True)

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

f=np.absolute(A-K)
g=np.absolute(B-K)

ans = solve(f-g,K)[0]

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

Submission status: Runtime Error

Solution code:
import numpy as np
from sympy import *

K = symbols("K", real=True)

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

f=np.absolute(A-K)
g=np.absolute(B-K)

ans = solve(f-g,K)[0]

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

Submission status: Runtime Error

Solution code:
K = symbols("K", real=True)

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

f=np.absolute(A-K)
g=np.absolute(B-K)

ans = solve(f-g,K)[0]

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

Submission status: Runtime Error

Solution code:
x = 1000000007

S = input()
S = [int(s) if s != '?' else s for s in S]
S = S[::-1]

dp = [[0 for j in range(13)] for i in range(len(S) + 1)]

dp[0][0] = 1

for i, s in enumerate(S):
    for j in range(10):
        if s != '?' and s != j:
            continue

        digit_r = ((10 ** i) * j) % 13

        for k in range(13):
            r = (digit_r + k) % 13
            dp[i + 1][r] += dp[i][k]

    dp[i + 1][r] %= x

print(int(dp[-1][5] % x))

Submission status: Runtime Error

Solution code:
import numpy as np

x = 1000000007

S = input()
S = [int(s) if s != '?' else s for s in S]
S = S[::-1]

r = np.zeros((13,))
new_r = np.zeros((13,))

r[0] = 1

for i, s in enumerate(S):
    for j in range(10):
        if s != '?' and s != j:
            continue

        digit_r = ((10 ** i) * j) % 13

        for k in range(13):
            new_r[(digit_r + k) % 13] += r[k]

    new_r %= x

    r = new_r
    new_r = np.zeros((13,))

print(int(r[5] % x))

Submission status: Runtime Error

Solution code:
import sys

n1, n2 = [int(i) for i in input().split()]

if (n1 % 2) != (n2 % 2):
    sys.exit("IMPOSSIBLE")

r1 = int((n1 + n2) / 2)
print(r1)

Submission status: Runtime Error

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

ans, surplus = 0, 0
for i in range(N):
    tmp = min(A[i], surplus)
    ans += tmp
    A[i] -= tmp
    if B[i] > A[i]:
        ans += A[i]
        surplus = B[i] - A[i]
    else:
        ans += B[i]
        surplus = 0
tmp = min(A[N], surplus)
ans += tmp
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

mod = 10**9+7
p = list(input())
# p = list("?"*10**4)

# アルゴリズム
dp = np.zeros(13, dtype=int)
dp[0] = 1
mul = 1
for key in reversed(p):
    new_dp = np.zeros(13, dtype=int)
    if key == "?":
        for i in range(10):
            for j in range(13):
                new_dp[(j + i * mul) % 13] += dp[j]
                new_dp[(j + i * mul) % 13] %= mod
    else:
        
        for j in range(13):
            new_dp[(j + int(key) * mul) % 13] += dp[j]
            new_dp[(j + int(key) * mul) % 13] %= mod
    dp = new_dp.copy()
    mul *= 10

print(dp[5])

Submission status: Runtime Error

Solution code:
package main

import (
	"fmt"
)

func main() {
	var A, B int
	fmt.Scan(&A)
	fmt.Scan(&B)
	if (A + B) % 2 == 0 {
		fmt.Println((A + B) / 2)
	} else {
		fmt.Println("IMPOSSIBLE")
	}
}

Submission status: Runtime Error

Solution code:
package main

import (
	"fmt"
	"math"
)

func main() {
	var A, B int
	fmt.Scan(&A)
	fmt.Scan(&B)
	if (A + B) % 2 == 0 {
		fmt.Println((A + B) / 2)
	} else {
		fmt.Println("IMPOSSIBLE")
	}
}

Submission status: Runtime Error

Solution code:
import numpy as np

mod = 10**9+7
p = list(input())
# p = list("?"*10**4)

# アルゴリズム
dp = np.zeros(13, dtype=int)
dp[0] = 1
mul = 1
for key in reversed(p):
    new_dp = np.zeros(13, dtype=int)
    if key == "?":
        for i in range(10):
            for j in range(13):
                new_dp[(j + i * mul) % 13] += dp[j]
                new_dp[(j + i * mul) % 13] %= mod
    else:
        
        for j in range(13):
            new_dp[(j + int(key) * mul) % 13] += dp[j]
            new_dp[(j + int(key) * mul) % 13] %= mod
    dp = new_dp.copy()
    mul *= 10

print(dp[5])

Submission status: Runtime Error

Solution code:
N = int(input())
Nlist = [int(i) for i in input().split()]

sum = 0
cnt = 0
for i in range(N):
    if cnt > 2:
        break

    if Nlist[i] == (i + 1):
        continue
    else:
        sum += Nlist[i]
        cnt += 1

if cnt == 0 or sum == (N + 1):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

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

    K = int(B - (B - A) / 2)
    print(str(K))

Submission status: Runtime Error

Solution code:
import math
a, b = [int(i) for i in input().split()]
r = a - b if a > b else b - a
if r % 2 is 0:
  print(abs(int(r / 2)) + (a if a < b else b))
  else:
    print("IMPOSSIBLE")

Submission status: Runtime Error

Solution code:
L,R = map(int,input().split())

ans = (L+R)/2

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
 
data = sys.stdin.readline()
 
a, b = data.strip().split()
 
if a == b:
    print(0)
else:
  k = (a + b) / 2
  if k.is_integer():
    print(k)
  else:
    print('IMPOSSIBLE')

Submission status: Runtime Error

Solution code:
import sys

data = sys.stdin.readline()

a, b = data.strip().split()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
if isinstance((A - B) / 2, int):
    print((A - B) / 2)
else:
    print(IMPOSSIBLE)

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    ps = [int(x) for x in input().split()]

    dis = []

    for n, p in enumerate(ps):
        if n + 1 != p:
            dis.append(p)

    if len(dis) == 2 or len(dis) == 0:
        print("YES")
    else:
        print("NO")

main()

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    n = int(input())
    ps = [int(x) for x in input().split()]

    dis = []

    for n, p in enumerate(ps):
        if n + 1 != p:
            dis.append(p)

    if len(dis) == 2 or len(dis) == 0:
        print("YES")
    else:
        print("NO")

Submission status: Runtime Error

Solution code:
A,B = (int(i) for i in input().split()
if (A-B)%2!=0:
       print("IMPOSSIBLE")
else:
       print(max(A,B)-(max(A,B)-min(A,B)))

Submission status: Runtime Error

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

k = a+b
if k%2==0:
  return k/2
else:
  return 'IMPOSSIBLE'

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
v = 0
flag = Flase
for i in range(1e9):
    if abs(a-i) == abs(b - i):
        v = i
        flag = True
        break

if flag:
    print(v)
else:
    print('IMPOSSIBLE')

Submission status: Runtime Error

Solution code:
if A^2-B^2 - 2K(A-B) == 0:
  print(K= A^2-B^2/2(A-B))
else
  print('IMPOSSIBLE')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/bin/python3

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

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

Submission status: Runtime Error

Solution code:
s = [int(x) if x!='?' else -1 for x in input()]

mod = 1000000007
length = len(s)
ans = list([0]*13 for i in range(length+1))
ans[0][0] = 1

mod_x10 = [0]*13
for i in range(13):
    mod_x10[i] = i * 10 % 13 - 1

for i in range(length):
    for j in range(13):
        x = mod_x10[j]
        if s[i] == -1:
            for k in range(10):
                x = (x + 1) % 13
                ans[i+1][x] += ans[i][j] % mod
        else:
            x = (x + int(s[i]) + 1) % 13
            ans[i+1][x] += ans[i][j] % mod

print('a')
print(ans[length][5] % mod)

Submission status: Runtime Error

Solution code:
s = [int(x) if x!='?' else -1 for x in input()]

mod = 1000000007
length = len(s)
ans = list([0]*13 for i in range(length+1))
ans[0][0] = 1

mod_x10 = [0]*13
for i in range(13):
    mod_x10[i] = i * 10 % 13 - 1

for i in range(length):
    for j in range(13):
        x = mod_x10[j]
        if s[i] == -1:
            for k in range(10):
                x = (x + 1) % 13
                ans[i+1][x] += ans[i][j] % mod
        else:
            x = (x + int(s[i]) + 1) % 13
            ans[i+1][x] += ans[i][j] % mod

print(ans[length][5] % mod)
print('a')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a != b:
    c = (abs(a) + abs(b))/2
    if type(c) is int:
        print(c)
        return
if a == b:
    print(0)
    return
print("IMPOSSIBLE")

Submission status: Runtime Error

Solution code:
import numpy as np
s = list(input())
if np.sum(s) % 2 != 0:
    print('IMPOSSIBLE')
print(np.sum(s) % 2)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
if (A + B) % 2:
    print('IMPOSSIBLE')
else:
    print((A + B) // 2)

Submission status: Runtime Error

Solution code:
cn = int(input())
enm = input().split(" ")
brv = input().split(" ")
taoshita = int(0)

for i in range(0,cn):
    taoshita = taoshita + min(abs(int(brv[i])),abs(int(enm[i])))  
    enm[i] = int(enm[i]) - int(brv[i])
    if int(enm[i]) < 0:
        brv[i] = abs(int(enm[i]))
        enm[i] = 0
        if (int(enm[i+1]) - int(brv[i])) < 0:
            taoshita = taoshita + int(enm[i+1])
            enm[i+1] = 0
        if (int(enm[i+1]) - int(brv[i])) >= 0:
            enm[i+1] = int(enm[i+1]) - int(brv[i])
            taoshita = taoshita + int(brv[i])
print(taoshita)

Submission status: Runtime Error

Solution code:
nums = [int(i) for i in input().split()]
a = nums[0]
b = nums[1]
c = 0

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

for k in range(c):
	if abs(a - k) == abs(b - k):
		print(k)
		break
else:
	print('IMPOSSIBLE')


input('')

Submission status: Runtime Error

Solution code:
# | A - K | = | B - K |
raw = raw_input().split()
A = int(raw[0])
B = int(raw[1])

up = (A**2-B**2)
down = (2 * ( A-B ))

if up % down == 0:
	print(up/down)
else:
	print("IMPOSSIBLE")

Submission status: Runtime Error

Solution code:
# | A - K | = | B - K |
in = raw_input().split()
A = in[0]
B = in[1]

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

if isinstance(K, int):
	print(K)
else
	print("IMPOSSIBLE")

Submission status: Runtime Error

Solution code:
# | A - K | = | B - K |
in = raw_input().split()
A = in[0]
B = in[1]

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

Submission status: Runtime Error

Solution code:
tmp = input()
fi = int(tmp.split(" ")[0])
se = int(tmp.split(" ")[1])
k = abs(fi + se)/2
mod = abs(fi + se) % 2
if mod == 1:
  print("IMPOSSIBLE")
  else:
  print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys


a = int(sys.argv[1])
b = int(sys.argv[2])

k = (a + b) / 2

print(int(k), end="") if int(k) == k else print("IMPOSSIBLE", end="")

Submission status: Runtime Error

Solution code:
import sys


a = int(sys.argv[1])
b = int(sys.argv[2])

k = (a + b) / 2

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

Submission status: Runtime Error

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

for i in range(0, 10**9):
  if (a-i) == (b-i):
    return i
return "IMPOSSIBLE"

Submission status: Runtime Error

Solution code:
import sys


a = sys.argv[1]
b = sys.argv[2]

k = (a + b) / 2

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

Submission status: Runtime Error

Solution code:
ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]

mid2 = a + b

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

Submission status: Runtime Error

Solution code:
ab = int(input().split())
a = ab[1]
b = ab[2]

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

Submission status: Runtime Error

Solution code:
A,B=int(input()).split()
def asf(A,B):
  same_num=(A+B)/2
  k=same_num-min(A,B)
  return k
print(asf(A,B))

Submission status: Runtime Error

Solution code:


ab = list(map(int, input().sprit()))
a = ab[0]
b = ab[1]

if (a+b)%2 == 1:
  print("IMPOSSIBLE")
  return 0

print((a+b)/2)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
K = (A+B)//2
if type(K) is int:
  print(K)
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
<?php
fscanf(STDIN,"%d%d",$a,$b);
if (($a+$b)%2==0){
    print ($a+$b)/2;
}else{
    print("IMPOSSIBLE");
}
?>

Submission status: Runtime Error

Solution code:
A = input(a)
B = input(b)
K == (A+B)/2
if type(K) is int:       
    print(K)
else:
    print("Impossible")

Submission status: Runtime Error

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

count = 0
for i in range(N):
    n_defeat = min(A[i], B[i])
    A[i] -= n_defeat
    B[i] -= n_defeat
    count += n_defeat
    n_defeat = min(A[i + 1], B[i])
    A[i + 1] -= n_defeat
    B[i] -= n_defeat
    count += n_defeat

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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