TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
a, b = map(int, input().split())
k = a + b

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N,K = list(map(lambda x: int(x),input().split()))
if (N+K)%2==0:
    print((N+K)/2)
else:
    print("IMPOSSIBLE")


N,K = list(map(lambda x: int(x),input().split()))
if (N+K)%2==0:
    print(int((N+K)/2))
else:
    print("IMPOSSIBLE")


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,*x=map(int,open(0).read().split())

soreted_x=sorted(x)
cnt=0
for a,b in zip(x,soreted_x):
  if a != b:
    cnt+=1
print('Yes' if cnt==2 or cnt==0 else 'No')

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
if a%2==b%2:
    print((a+b)/2)
else:
    print("IMPOSSIBLE")

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

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

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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a, b = map(int, input().split())
if ((a+b)/2)%2 == 0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
import math
import bisect

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


import sys
import math
import bisect

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b = [int(n) for n in input().split()]
print(a, b)

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


a, b = [int(n) for n in input().split()]

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def harmony(a,b):
    if (a+b)%2==0:
        return int((a+b)/2)
    else:
        return 'IMPOSSIBLE'
    

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

def harmony(a,b):
    if (a+b)%2==0:
        return int((a+b)/2)
    else:
        return 'IMPOSSIBLE'

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

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

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A, B = map(int, input().split())
if A >= 0 and A != B and B <= 10**9:
    if ( A + B ) % 2 == 0:
        print(( A + B ) / 2)
    else:
        print('IMPOSSIBLE')

A, B = map(int, input().split())
if A >= 0 and A != B and B <= 10**9:
    if ( A + B ) % 2 == 0:
        print(( A + B ) / 2)
    else:
        print('IMPOSSIBLE')

A, B, C = map(int, input().split())
if C - (A - B) >= 0:
    print(C - (A - B))
else:
    print(0)

A, B = map(int, input().split())
if A >= 0 and A != B and B <= 10**9:
    if ( A + B ) % 2 == 0:
        print(( A + B ) / 2)
    else:
        print('IMPOSSIBLE')

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math

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

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

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input())
b = int(input())
 
c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
 
  m = (max(abs_a, abs_b) - min(abs_a, abs_b)) /2
  ans = max(abs_a, abs_b) - m
  print(ans)
else:
  print("IMPOSSIBLE")

a = input()
b = input()

c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
  ans = max(abs_a, abs_b) - (((max(abs_a, abs_b)/2) - min(abs_a, abs_b))/2)
  print(ans)
else:
  print("IMPOSSIBLE")

a = int(input())
b = int(input())
 
c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
 
  m = (max(abs_a, abs_b) - min(abs_a, abs_b)) /2
  ans = max(abs_a, abs_b) - m
  print(int(ans))
else:
  print("IMPOSSIBLE")

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

c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
  ans = max(abs_a, abs_b) - (((max(abs_a, abs_b)/2) - min(abs_a, abs_b))/2)
  print(ans)
else:
  print("IMPOSSIBLE")

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

c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)

  m = (max(abs_a, abs_b) - min(abs_a, abs_b)) /2
  ans = max(abs_a, abs_b) - m
  print(ans)
else:
  print("IMPOSSIBLE")


inp = input().split(" ")
a = inp[0]
b = inp[1]
 
c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
 
  m = (max(abs_a, abs_b) - min(abs_a, abs_b)) /2
  ans = max(abs_a, abs_b) - m
  print(int(ans))
else:
  print("IMPOSSIBLE")

inp = input().split(" ")
a = int(inp[0])
b = int(inp[1])
 
c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
 
  m = (max(abs_a, abs_b) - min(abs_a, abs_b)) /2
  ans = max(abs_a, abs_b) - m
  print(int(ans))
else:
  print("IMPOSSIBLE")


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A,B = map(int,input().split())
K = (A+B)/2
if type(K) is int:
  print(K)
else:
  print("Impossible")

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

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

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

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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A,B = map(int,input().split())
K = (A+B)/2
if abs(A-K) == abs(B-K):
    print((A+B)/2)
else:
    print("IMPOSSIBLE")

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

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

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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b = map(int, input().split())

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

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

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b = map(int,input().split())
if a%2 == b%2:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")
    

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(input().split())
print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input("a"))
b = int(input("b"))
c = (a+b)/2
if c % 1 == 0:
    print(c)
else:
    print("IMPOSSIBLE")


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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A, B = list(map(int, input().split()))

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

print(K)

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

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

print(K)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A,B = map(int, input().split())
if A+B%2 == 1:
  print('IMPOSSIBLE')
else:
  print(A+B//2)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
if a+b%2==0:
    print(a+b//2)
else:
    print("IMPOSSIBLE")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=list(map(int,input().split()))
print(sum(a)/2 if int(sum(a)/2)==sum(a)/2 else "IMPOSSIBLE")

a=list(map(int,input().split()))
print(sum(a)/2)

a=list(map(int,input().split()))
print(int(sum(a)/2) if int(sum(a)/2)==sum(a)/2 else "IMPOSSIBLE")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-


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

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

else:
	K = (A+B)/2
	print(K)

# -*- coding: utf-8 -*-


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

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

else:
	K = (A+B)//2
	print(K)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
k=(a+b)/2
if k%1==0:
    print(k)
else:
    print('IMPOSSIBLE')


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
a,b = map(int,(input().split()))
k = (a+b)/2
c = k if abs(a-k) == abs(b-k) else 'IMPOSSIBLE'
print(c)


import math
a,b = map(int,(input().split()))
k = (a+b)/2
c = k if abs(a-k) == abs(b-k) else 'impossible'
print(c)


import math
a,b = map(int,(input().split()))
k = (a+b)/2
c = k if abs(a-k) == abs(b-k) else 'IMPOSSIBLE'
print(c)


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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
def main():
    a, b = map(int, input().split())
    for k in range(min(a,b), max(a,b)+1):
        ak = np.abs( a - k )
        bk = np.abs( b - k )
        if ak == bk:
            print(( a + b ) / 2)
            exit(0)
    print("IMPOSSIBLE")

if __name__ == "__main__":
    main()

import numpy as np
def main():
    a, b = map(int, input().split())
    if (a - b) % 2 == 1:
        print("IMPOSSIBLE")
    else: print(int((a + b)/ 2))
if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b = map(int, input().split())

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A, B = map(int, input().split())

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

import sympy as sp

A, B = map(int, input().split())
K = sp.Symbol('K')

ans = sp.solve((A - K) **2 - (B - K) ** 2, K)

if isinstance(ans[0], int) == True:
    print(ans[0])
else:
    print('IMPOSSIBLE')

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
count = 0
for i in range(n):
  if a[i] >= b[i]:
    count += b[i]
  else:
    count += min(b[i], a[i]+a[i+1])
    a[i+1] = max(0, a[i+1]-(b[i]-a[i]))
print(count)


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

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

print(result)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b = map(int,input().split())
x = abs(a-b)
if x%2 == 0:
    print(x//2)
else:
    print("IMPOSSIBLE")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b = map(int,input().split())
if (a - b) % 2 == 0:
  print(a+(a-b)%2)
else:
  print("IMPOSSIBLE")

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


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


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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())

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


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

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


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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A, B = map(int, input().split())
if (max(A, B) - min(A, B)) % 2 == 1:
    print("IMPOSSIBLE")
else:
    print(int((A + B)) / 2)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
#--Harmony

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

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

#--Harmony

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().splut());print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE)
"

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a=list(map(int,input().split()))
if (a[0]+a[1])%2==0:
  	print((a[0]+a[1])/2)
else:
  	print("IMPOSSIBLE")

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=eval(input().replace(' ', '+');print(a%2*'IMPOSSIBLE' or a//2)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
if a%2 != b%2 :
  	print('IMPOSSIBLE')
else
	k=(a+b)/2
  	print(k)

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

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int, input().split())
if a<b:
  a,b=b,a
#a>b is assured.

flag=False
for k in range(b+1,a+1):
  if k-b==a-k:
    print(k)
    flag==True
    break
if flag==False:
  print("IMPOSSIBLE")


a,b=map(int, input().split())
if a<b:
  a,b=b,a
#a>b is assured.
k=(a+b)/2
if k%1==0 and b<k<a:
    print(k)
else:
  print("IMPOSSIBLE")

a,b=map(int, input().split())
if a<b:
  a,b=b,a
#a>b is assured.
k=(a+b)/2
if k%1==0 and b<k<a:
  print(k)
else:
  print("IMPOSSIBLE")

a,b=map(int, input().split())
if a<b:
  a,b=b,a
#a>b is assured.
k=(a+b)/2
if k%1==0 and b<k<a:
  print(int(k))
else:
  print("IMPOSSIBLE")


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b = list(map(int, input().split()))
if (a+b) % 2 == 0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def main():
 a,b = map(int,input().split())
 if abs(a - b) % 2 == 0:
     print(abs(a - b) // 2)
 else:
     print('IMPOSSIBLE')
main()

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
#ABC135 A

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

#ABC135 A

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
if (a+b) % 4 ==0:
  print(int((a+b)/4))
  else:
    print("IMPOSSIBLE")

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


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


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


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b = map(int,input().split())
k = 0
if a > b:
  k = a - b
  if k % 2 != 0:
    print('IMPOSSIBLE')
  else:
    print((k/2)+b)
else:
  k = b - a
  if k % 2 != 0:
    print('IMPOSSIBLE')
  else:
    print((k/2)+a)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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])

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
if((a+b)/2)==0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b = map(int,input().split())

k = abs(a - b)
if k % 2 == 0:
  print(max(abs(a-k/2),abs(b-k/2)))
else:
  print("IMPOSSIBLE")


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b = map(int, input().split())
if (a+b)%2 != 0:
  print('IMPOSSIBLE')
else:
  print((a+abs(b))/2)

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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')


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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A,B = map(int,input().split())

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

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

K = (A+B)/2
if isinstance(K,int):
    print(K)
else:
    print('IMPSSIBLE')

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

K = (A+B)/2
if isinstance(K,int):
  print(K)
else:
  print('IMPSSIBLE')

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

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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b = map(int,input().split())
if (a+b)%2 == 0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b = map(int, input().split())

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A, B = map(int, input().split())
print(A + B // 2 if (A + B) % 2 == 0 else "IMPOSSIBLE")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b = map(int, input().split())
if (a+b)%2 != 0:
  print("IMPOSSIBLE")
else:
  print(int(a+b/2))

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

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

a, b = map(int, input().split())
for k in range(10**9):
  if (a+k) == (b+k):
    print(k)
    exit()
print("IMPOSSIBLE")

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Time Limit Exceeded

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A,B=map(int,input().split())
if A%2==B%2:
  print((A+B)/2)
else:
  print("IMPOSSIBLE")
  

A ,B = map(int,input().split())
mean = (A+B)/2.0
if isinstance(mean, int)==True:
  print(int(mean))
else:
  print("IMPOSSIBLE")

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

A ,B = map(int,input().split())
mean = (A+B)/2.0
if isinstance(mean, int)==True:
  print(int.mean)
else:
  print("IMPOSSIBLE")


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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
k = (a + b) / 2
l = (a + b) % 2
if l == 0:
    print(k)
else:
    print(“IMPOSSIBLE”)


# -*- coding: utf-8 -*-
a, b = map(int, input().split())
k = (a + b) / 2
l = (a + b) % 2
if l == 0:
    print(k)
else:
    print("IMPOSSIBLE")

# -*- coding: utf-8 -*-

a_b_list = list(map(int,input().split()))
a = a_b_list[0]
b = a_b_list[1]

k = (a + b) / 2
l = (a + b) % 2

if l == 0:
  print(k)
else:
  print("IMPOSSIBLE")

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

# -*- coding: utf-8 -*-

a_b_list = list(map(int,input().split()))
a = a_b_list[0]
b = a_b_list[1]

k = (a + b) / 2
l = (a + b) % 2

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


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):


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)

import sys

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

if (a+b)%2 == 1:
  print("IMPOSSIBLE")
  sys.exit(0)

print(int((a+b)/2))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
def main():
  a, b = [int(_) for _ in input().split()]
  
  if (a+b) % 2 == 0:
    print((a+b)/2)
    
  else:
    print("IMPOSSIBLE")
main()

def main():
  a, b = [int(_) for _ in input().split()]
  
  if (a+b) % 2 == 0:
    print((a+b)/2)
    
main()

def main():
  a, b = [int(_) for _ in input().split()]
  
  if abs(a-b) % 2 != 0:
    print("IMPOSSIBLE")
  else:
    k = min(a,b) + abs(a-b)/2
    print(k)
    
main()

def main():
  a, b = [int(_) for _ in input().split()]
  
  if (a+b) % 2 == 0:
    x = (a+b)/2
    print("{:.0f}".format(x))
    
  else:
    print("IMPOSSIBLE")
main()

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A,B = map(int,input().split())

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

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

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

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

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


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
sum=a+b
if sum%2==0:
  print(sum/2)
else:
  print("IMPOSSIBLE")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

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


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
ba, bb = (int(x) for x in input().split())
m = a if a > b else b
for i in range(m+2):
    a = abs(a-i)
    b = abs(b-i)
    if a == b:
        print(i)
        break:
if i == m+1:
    print('IMPOSSIBLE')

ba, bb = (int(x) for x in int(input().split()))
m = a if a > b else b
for i in range(m+2):
    a = abs(a-i)
    b = abs(b-i)
    if a == b:
        print(i)
if i == m+1:
    print('IMPOSSIBLE')

a, b = (int(x) for x in input().split())
ans = int(a/2+b/2+0.5)
if abs(a-ans) == abs(b-ans):
    print(ans)
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
num = input().split()
A = int(num[0])
B = int(num[1])
if (A+B)%2 == 0:
    print((A+B)/2)
else:
    print("IMPOSSIBLE")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A,B = map(int, input().split())
k = (A + B) / 2
if (A + B) % 2 == 0:    
    if A - k > 0 and B - k < 0:
        print('pat1')
        print(int(k))
    elif A - k < 0 and B - k > 0:
        print('pat2')
        print(int(k))    
    else:
        print('IMPOSSIBLE')
else:
    print('IMPOSSIBLE')

A,B = map(int, input().split())
k = (A + B) / 2
if (A + B) % 2 == 0:    
    if A - k > 0 and B - k < 0:
        #print('pat1')
        print(int(k))
    elif A - k < 0 and B - k > 0:
        #print('pat2')
        print(int(k))    
    else:
        print('IMPOSSIBLE')
else:
    print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = input()
lst1 = list(map(int, input().split()))
lst2 = sorted(lst1)

n = 0
for x, y in zip(lst1, lst2):
    if x != y:
        n += 1
        if n > 2:
            break

if n > 2:
    print('NO')
else:
    print('YES')


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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a, b = map(int, input().split())
x = abs(a - b)
if x % 2:
    print('IMPOSSIBLE')
else:
    print(abs(a-(x//2)))


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b = map(int,input().split())

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

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

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

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

ans = a+b/2

if type(ans) == "int":
  print(ans)
else:
  print("IMPOSSIBLE")

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def main():
    a, b = [int(x) for x in input().split()]
    if (a+b)%2 == 0:
        k = (a+b)/2
        if (a<k and k<b) or (b<k and k<a):
            print(k)
    else:
        print('IMPOSSIBLE')


if __name__ == '__main__':
    main()


def main():
    a, b = [int(x) for x in input().split()]
    if (a+b)%2 == 0:
        print((a+b)/2)
    else:
        print('IMPOSSIBLE')


if __name__ == '__main__':
    main()


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


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A,B = int(input())

K = (A + B) 

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

L = list(map(int, input().split()))

K = (L[0] + L[1]) 

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A, B = list(map(int, input().split()))
ans = (A+B)/2
if ans.is_integer():
    print(ans)
else: print('IMPOSSIBLE')

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

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

if ((A - B) % 2 == 0) :
	X = abs(A - B)
else:
	X = "IMPOSSIBLE"


print("{0}".format(X))


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

if (abs(A - B) % 2 == 0) :
	X = abs(A - B) % 2 + min([A, B])
else:
	X = "IMPOSSIBLE"


print("{0}".format(X))


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

if (A - B % 2 == 0) :
	X = abs(A - B)
else:
	X = "IMPOSSIBLE"


print("{0}".format(X))


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

if (abs(A - B) % 2 == 0) :
	X = abs(A - B)
else:
	X = "IMPOSSIBLE"


print("{0}".format(X))


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

if (abs(A - B) % 2 == 0) :
	X = int(abs(A - B) / 2) + min([A, B])
else:
	X = "IMPOSSIBLE"


print("{0}".format(X))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=int(input().split())
print(a+b //2 if a+b % 2==0 else 'IMPSSIBLE')

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a sequence p = {p_1,\ p_2,\ ...,\ p_N} which is a permutation of {1,\ 2,\ ...,\ N}.  You can perform the following operation at most once: choose integers i and j (1 \leq i < j \leq N), and swap p_i and p_j. Note that you can also choose not to perform it.  Print `YES` if you can sort p in ascending order in this way, and `NO` otherwise.

Submission attempts (in order):
N=int(input())
list=input().split()
for all in list:
    all=int(all)
flag=False
c=0
x="YES"
leng=len(list)
for i in range(leng-1):
    if list[i]>list[i+1]:
        c=c+1
        t=list[i]
        list[i]=list[i-1]
        list[i-1]=t
        print(list)      
    if c==2:
        x="NO"
        break
print(x)

N=int(input())
list=input().split()
for all in list:
    all=int(all)
flag=False
c=0
x="YES"
leng=len(list)
for i in range(leng-1):
    if list[i]>list[i+1]:
        c=c+1
        t=list[i]
        list[i]=list[i-1]
        list[i-1]=t
        print(list)
    if list[i]>list[i+1]:
        c=c+1
        t=list[i]
        list[i]=list[i+1]
        list[i+1]=t        
    if c==2:
        x="NO"
        break
print(x)

N=int(input())
list=input().split()
for all in list:
    all=int(all)
flag=False
c=0
x="YES"
leng=len(list)
for i in range(leng-1):
    if list[i]>list[i+1]:
        c=c+1
        t=list[i]
        list[i]=list[i+1]
        list[i+1]=t
    if c==2:
        x="NO"
        break
print(x)

N = int(input())
list= list(map(int, input().split()))
newlist=list.copy()
c = 0
for all in range(N):
    if list[all]!=all+1:
        c+=1
if c == 0 or c ==2:
    print('YES')
else:
    print('NO')


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have a sequence p = {p_1,\ p_2,\ ...,\ p_N} which is a permutation of {1,\ 2,\ ...,\ N}.  You can perform the following operation at most once: choose integers i and j (1 \leq i < j \leq N), and swap p_i and p_j. Note that you can also choose not to perform it.  Print `YES` if you can sort p in ascending order in this way, and `NO` otherwise.

Submission attempts (in order):
from statistics import mode
import numpy as np
N=input()
p=list(map(int,input().split()))
p=np.array(p)
q=p-np.arange(len(p-1))
q = list(q)
r = len(list(set(q)))
if sum(list(q))==2*mode(q):
    print('YES')
else:
    print('NO')
    



N=int(input())
p=list(map(int,input().split()))
q=sorted(p)
count=0
for i in range(N):
    if p[i]!=q[i]:
        count+=1
if count<=2:
    print('YES')
else:
    print('NO')


Verdicts: Runtime Error

Accepted
Problem: We have a sequence p = {p_1,\ p_2,\ ...,\ p_N} which is a permutation of {1,\ 2,\ ...,\ N}.  You can perform the following operation at most once: choose integers i and j (1 \leq i < j \leq N), and swap p_i and p_j. Note that you can also choose not to perform it.  Print `YES` if you can sort p in ascending order in this way, and `NO` otherwise.

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


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


Verdicts: Wrong Answer

Accepted
Problem: We have a sequence p = {p_1,\ p_2,\ ...,\ p_N} which is a permutation of {1,\ 2,\ ...,\ N}.  You can perform the following operation at most once: choose integers i and j (1 \leq i < j \leq N), and swap p_i and p_j. Note that you can also choose not to perform it.  Print `YES` if you can sort p in ascending order in this way, and `NO` otherwise.

Submission attempts (in order):
N=int(input())
P=[int(input()) for i in range(N)]

if P[0] > P[N-1] and P[N-1] < P[2] and P[3] < P[0]:
  print("YES")
else:
  print("NO")

N=int(input())
P=list(map(int,input().split()))

if P[0] > P[N-1] and P[N-1] < P[1] and P[N-2] < P[0]:
  print("NO")
else:
  print("YES")

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

sort_p=sorted(p)
cnt=0


for i,j in zip(p,sort_p):
  if i != j:
    cnt += 1

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

Verdicts: Runtime Error

Wrong Answer

Accepted