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):
#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)


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;
}

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

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

a,b = map(int,input().split())
if abs(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=input().sprit(" ")
A,B=int(A),int(B)

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

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

K=A+B
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 = map(int, input().split())

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


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

k=0
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+B)//2)

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



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

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



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

if (b-a) % 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 (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):
N = int(input())
p_list = list(int(pi) for pi in input().split(' '))

num_opposite = 0
indices = []

for i in range(N-1):
  p_1st = p_list[i]
  p_2nd = p_list[i+1]
  
  if p_1st<=p_2nd:
    pass
  else:
    num_opposite+=1
    if num_opposite==1:
      indices.append(i)
    else:
      indices.append(i+1)
      
  
  if num_opposite >=3:
    break 

if num_opposite == 0:
  print('YES')
elif num_opposite == 1:
  print('YES')
elif num_opposite == 2:
  small_idx = indices[0]
  large_idx = indices[1]
  
  p_small = p_list[small_idx]
  p_large = p_list[large_idx]
  
  if (p_small==p_list[large_idx-1]+1) and (p_large==p_list[small_idx+1]-1):
    print('YES')
  else:
    print('NO')
else:
  print('NO')

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

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

a, b = map(int, input().split())
print((a + b) / 2)

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

x,y = map(int,input().split())

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



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

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

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


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

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

Verdicts: Wrong Answer

Runtime Error

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):
<?php
fscanf(STDIN,"%d%d",$a,$b);
if (($a+$b)%2==0){
    print ($a+$b)/2;
}else{
    print("IMPOSSIBLE");
}
?>


a,b=map(int,input().split())
k=(a+b)//2
if abs(a-k)==abs(b-k):
    print(k)
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(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 = (int(x) for x in input().split())

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

a, b = (int(x) for x in input().split())

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

a, b = (int(x) for x in input().split())

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

a, b = (int(x) for x in input().split())

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

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

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

A, B = input().split()

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

a,b=map(int, input().split())
c = (a+b)/2
if c.is_integer():
  print(int(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=map(int,input().split())
print((a+b)/2)

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

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

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

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

I,m = divmod((A+B), 2)

if m != 0:
    res = msg
else:
    res = (A+B)/2

print(res)

msg = "IMPOSSIBLE"
A,B = map(int, input().split())

I,m = divmod((A+B), 2)

if m != 0:
    res = msg
else:
    res = int((A+B)/2)

print(res)

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 % 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 sys

read = sys.stdin.buffer.read
readline = sys.stdin.buf

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

print(S // 2 if S % 2 == 0 else 'IMPOSSIBLE')
fer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

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




import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

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

# print(ans)

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

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

A, B = map(int, input().split())
K = (A + B) / 2
L = (A + B) // 2
if K.is_integer():
  print(L)
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 (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((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

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())
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):
def getInt(): return int(input())

def getIntList(): return [int(x) for x in input().split()]

N = getInt()
A = getIntList()
B = getIntList()
sum = 0
sum += min(A[0],B[0])
sum += min(A[1],B[0]-min(A[0],B[0]))
for i in range(N-1):
    sum += min(A[i+1],B[i+1])
    sum += min(A[i+2],B[i+1]-min(A[i+1],B[i+1]))
print(sum)

def getIntList(): return [int(x) for x in input().split()]

x = getIntList()
if((x[0]+x[1])%2==0):
    print(int((x[0]+x[1])/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):
n = int(input())
s = input().split()

b =[str(i+1) for i in range(len(s))]

count=0
for i in range(len(s)):
  if s[i]!=b[i]:
    count+=1
if count==0: print("YES")
elif count==2: print("YES")
else: print("NO")

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




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

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).is_integer():
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

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

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


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


c  = abs((b-a)/2)

if c.is_integer() == True:
  print(int(c))


else:
  print("IMPOSSIBLE")

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


c = abs((b-a) /2)

if c.is_integer() == True:
  print(int(c))


else:
  print("IMPOSSIBLE")

def main():
  a, b = map(int, input().split())
  c  = abs((b+a)/2)
  if c.is_integer() == True:
    print(int(c))
  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):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
count = 0
for i in range(n-1,-1,-1):
    
    if a[i+1] < b[i]:
        count += a[i+1]
        b[i] -= a[i+1]
        a[i+1] = 0
    else:
        count += b[i]
        a[i+1] -= b[i]
        b[i] = 0

    
    if a[i] < b[i]:
        count += a[i]
        b[i] -= a[i]
        a[i] = 0
    else:
        count += b[i]
        a[i] -= b[i]
        b[i] = 0

print(count)

a,b = map(int,input().split())
if (a % 2 == 0 and b % 2 == 0) or (a % 2 == 1 and b % 2 == 1):
    print((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):
s = input().split()

k = (int(s[0]) + int(s[1])) / 2

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


s = input().split()

k = (int(s[0]) + int(s[1])) / 2

if k.is_integer():
    print(k)
else:
    print('impossible')


s = input().split()

k = (int(s[0]) + int(s[1]))

if k % 2 == 0:
    print(int(k/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=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:
    printf(a*b/2)
else:
    print("IMPOSSIBLE")

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

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


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):
num = int(input())
if num >= 2:
  input_list = [int(i) for i in input().split()] 
  sorted_list = sorted(input_list)

  count = 0
  for input, sort in zip(input_list, sorted_list):
    if input != sort:
      count += 1

  if count < 2:
    print('YES')
  else:
    print('NO')
print('NO')


num = int(input())
if num > 2:
  input_list = [int(i) for i in input().split()] 
  sorted_list = sorted(input_list)

  count = 0
  for input, sort in zip(input_list, sorted_list):
    if input != sort:
      count += 1

  if count < 2:
    print('YES')
  else:
    print('NO')
print('NO')

a, b = (int(i) for i in input().split()) 
if a == 0 or b > 10**9 or b == 0 or a == b:
  print('IMPOSSIBLE')
  
elif (a + b) % 2 != 0:
  print('IMPOSSIBLE')
else:
  x = (a + b) / 2
  print(int(x))

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):
a,b=map(int,input().split())
for i in range(int((a+b)/2)-5, int((a+b)/2)+5):
  if abs(a-i) == abs(b-i):
    print(i)
  else:
    print("IMPOSSIBLE")

a,b=map(int,input().split())
count = 0
num = 0
for i in range(int((a+b)/2)-5, int((a+b)/2)+5):
  if abs(a-i) == abs(b-i):
    count += 1
    num = i
if count > 0:
  print(num)
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())
C = (A+B)/2
if C.is_integer() == True:
  print(C)
else:
  print("IMPOSSIBLE")

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

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

#ABC135A - Harmony
import math
A, B = list(map(int,input().split()))
if math.abs(A-B) % 2 == 1:
    print("IMPOSSIBLE")
else:
    print((A+B)//2)

#ABC135A - Harmony
A, B = list(map(int,input().split()))
if (A+B) % 2 == 1:
    print("IMPOSSIBLE")
else:
    print((A+B)//2)

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


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

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


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

a, b = map(int,input().split())
if (a+b)%2:
    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=[int(x) for x in input().split()]

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


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

if (A-B)%2 == 0:
    print(int(abs((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 (b-a)%2 == 1:
    print('IMPOSSIBLE')

else:
    print((b-a)/2 + a)


a,b = map(int,input().split())
if (b-a)%2 == 1:
    print('IMPOSSIBLE')

else:
    print((b-a)/2)


a,b = map(int,input().split())
if (b-a)%2 == 1:
    print('IMPOSSIBLE')

else:
    print(int((b-a)/2 + a))


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().splot())
if a%2==b%2:
  print((int)((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: 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):
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")


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 k2%2==0:
    print(k2//2+min(b,a))
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 abs(A-K) == abs(B-K):
  print(K)
else:
  print('IMPOSSIBLE')

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


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

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


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=[int(x) for x in input("Enter two value: ").split()] 
c=(a+b)/2
k=(a+b)//2
if(k==c):
  if(abs(a-k)==abs(b-k)):
     print(k)
else:
     print("IMPOSSIBLE")


a,b = [int(x) for x in input().split()] 
c=(a+b)//2
k=(a+b)/2
if(c==k):
    print(k)
else:
    print("IMPOSSIBLE")


a=int(input())
b=int(input())
c=(a+b)//2
k=(a+b)/2
if(c==k):
    print(k)
else:
    print("IMPOSSIBLE")


a,b=[int(x) for x in input().split()] 
c=(a+b)/2
k=(a+b)//2
if(k==c):
  if(abs(a-k)==abs(b-k)):
     print(k)
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):
N = int((input()))
S = input().split()
s=[]
b=[]
#print(S)
for i in range (N):
  s.append(int(S[i]))
#print(s)
for i in range(N):
  if s[i]==i+1:
    pass
  else:
    b.append(i)
#print(b)
if len(b)<3:
  print("YES")
else:
  print("NO")

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):
n = int(input())
n
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
b.append(0)
beat = 0

for i in range(n):
    mada = b[i]-a[i]
    beat += min(b[i],a[i])
    if mada > 0:
        b[i+1] += mada
beat += min(a[-1],b[-1])

print(beat)


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

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

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

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

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

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

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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

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 = map(int, input().split())
k = (a+b)/2
if k%2 == 0:
  print(k)
else:
  ('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):
num = [int(e) for e in input().split()]

a = num[0]
b = num[1]

K =(a+b)/2

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


num = [int(e) for e in input().split()]

a = num[0]
b = num[1]

K =(a+b)/2

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

num = [int(e) for e in input().split()]

a = num[0]
b = num[1]

K =int((a+b)/2)


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

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(x) for x in input().split()]
if A==B:
  print(0)
else:
  if (A+B)%2!=0:
    print('IMPOSSIBLE')
  else:
    print((A+B)/2)

A,B=[int(x) for x in input().split()]
if A==B:
  print(0)
else:
  if (A+B)%2!=0:
    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 = int(input()), int(input())
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)

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())
c = (a + b) / 2
print(c if c.is_integer() else "IMPOSSIBLE")

a, b = map(int, input("").split())
c = (a + b) / 2
print(int(c) if c.is_integer() 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())
print (abs((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")


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

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

x = (a + b)/2

if a != b and abs(a - x) == abs(b - x):
    print(x)

else:
    print("IMPOSSIBLE")

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

x = (a + b)/2

if  (a + b)%2 == 0 and abs(a - x) == abs(b - x):
    print(x)

else:
    print("IMPOSSIBLE")


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

x = (a + b)/2

if (a + b)%2 == 0 and abs(a - x) == abs(b - x):
    print(int(x))

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 A >= B:
  K = B + abs(A-B)/2
else:
  K = A +  abs(A-B)/2
if isinstance(K,int) == True:
  print(K)
else:
  print('IMPOSSIBLE')

A,B = map(int,input().split())
if A >= B:
  K = B + abs(A-B)/2
else:
  K = A +  abs(A-B)/2
if float.is_integer(K) == True:
  print(K)
else:
  print('IMPOSSIBLE')

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

A,B = map(int,input().split())
if A >= B:
  K = B + abs(A-B)/2
else:
  K = A +  abs(A-B)/2
if float.is_integer(K) == True:
  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):
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")

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

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

    for j in i:
        if isinstance(j, int) == False:
            return
        if j < 0 or 10**9 < j:
            return
    if i[0] == i[1]:
        return

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

    k = (a + b)/2

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

if __name__ == '__main__':
    main()

def main():
    i = list(map(int, input().split()))

    for j in i:
        if isinstance(j, int) == False:
            return
        if j < 0 or 10**9 < j:
            return
    if i[0] == i[1]:
        return

    a = i[0]
    b = i[1]

    k = (a + b)/2

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

if __name__ == '__main__':
    main()

def main():
    i = list(map(int, input().split()))

    for j in i:
        if isinstance(j, int) == False:
            return
        if j < 0 or 10**9 < j:
            return
    if i[0] == i[1]:
        return

    a = i[0]
    b = i[1]

    k = (a + b)/2

    if k*2 % 2 == 0:
        print(int(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 = map(int, input().split())

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


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

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

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


if a+b<10**3:
  for k in range((a+b)//2):
    if a+b==2*k:
      print(k)
      i=1
      break
elif a+b>=10**3 and not a+b>=10**6:
  for k in range((10**3)//2,(a+b)//2):
    if a+b==2*k:
      print(k)
      i=1
      break
elif a+b>=10**6 and not a+b>=10**7:
  for k in range((10**6)//2,(a+b)//2):
    if a+b==2*k:
      print(k)
      i=1
      break
elif a+b>=10**7 and not a+b>=10**8:
  for k in range((10**7)//2,(a+b)//2):
    if a+b==2*k:
      print(k)
      i=1
      break
elif a+b>=10**8 and not a+b>=10**9:
  for k in range((10**8)//2,(a+b)//2):
    if a+b==2*k:
      print(k)
      i=1
      break
elif a+b>=10**9 :
  for k in range((10**9)//2,(a+b)//2):
    if a+b==2*k:
      print(k)
      i=1
      break
if i==0:
  print('IMPOSSIBLE')

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

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

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(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):
# -*- coding: utf-8 -*-

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

ans = ((B-A/2)+A)
if isinstance(int, ans):
    print(ans)
else:
    print("IMPOSSIBLE")

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

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

ans = (((B-A)/2)+A)
if ans.is_integer():
    print(int(ans))
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(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:
    K = (A+B)/2
    print(K)
else:
    print('IMPOSSIBLE')

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

for i in range(1,10**9):
  if (abs(A-i) == abs(B-i)):
      print(i)
      exit()
  elif abs(abs(A-i)-abs(B-i)) >= abs(A-B):
      break;

print("IMPOSSIBLE")

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

num = 0 
for i in range(1,10^9):
  if (abs(A-i) == abs(B-i)):
      print(i)
      exit()

print("IMPOSSIBLE")

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted