Buggy python submission (verdict: Runtime Error):
N,A,B = map(int, input().split())
  
N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 != 0:
    ans = distAB / 0

print(int(ans))


Fixed submission:
from decimal import *
N,A,B = map(int, input().split())

N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = Decimal(distAB) / Decimal(2)
else:
    if (N-B) < A:
        ans = (N-B+1) + (Decimal(distAB-1)/Decimal(2))
    else:
        ans = A+1 + (Decimal(distAB-1)/Decimal(2))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int, input().split())
  
N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = distAB / 0

print(int(ans))


Fixed submission:
from decimal import *
N,A,B = map(int, input().split())

N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = Decimal(distAB) / Decimal(2)
else:
    if (N-B) < A:
        ans = (N-B+1) + (Decimal(distAB-1)/Decimal(2))
    else:
        ans = A+1 + (Decimal(distAB-1)/Decimal(2))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int, input().split())
  
N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = distAB / 0
else:
    if (N-B) < A:
        ans = (N-B+1) + ((distAB-1)/2)
    else:
        ans = A+1 + ((distAB-1)/2)

print(int(ans))


Fixed submission:
from decimal import *
N,A,B = map(int, input().split())

N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = Decimal(distAB) / Decimal(2)
else:
    if (N-B) < A:
        ans = (N-B+1) + (Decimal(distAB-1)/Decimal(2))
    else:
        ans = A+1 + (Decimal(distAB-1)/Decimal(2))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int, input().split())
  
N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = distAB / 2
else:
    ans = distAB / 0
print(int(ans))


Fixed submission:
from decimal import *
N,A,B = map(int, input().split())

N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = Decimal(distAB) / Decimal(2)
else:
    if (N-B) < A:
        ans = (N-B+1) + (Decimal(distAB-1)/Decimal(2))
    else:
        ans = A+1 + (Decimal(distAB-1)/Decimal(2))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int, input().split())
  
N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = distAB / 0
else:
    if (N-B) < A:
        ans = (N-B+1) + ((distAB-1)/2)
    else:
        ans = A+1 + ((distAB-1)/2)

print(int(ans))

Fixed submission:
from decimal import *
N,A,B = map(int, input().split())

N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = Decimal(distAB) / Decimal(2)
else:
    if (N-B) < A:
        ans = (N-B+1) + (Decimal(distAB-1)/Decimal(2))
    else:
        ans = A+1 + (Decimal(distAB-1)/Decimal(2))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int, input().split())
  
N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = distAB / 0
else:
    if (N-B) < A:
        ans = (N-B+1) + ((distAB-1)/2)-1
    else:
        ans = A+1 + ((distAB-1)/2)-1

print(int(ans))

Fixed submission:
from decimal import *
N,A,B = map(int, input().split())

N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = Decimal(distAB) / Decimal(2)
else:
    if (N-B) < A:
        ans = (N-B+1) + (Decimal(distAB-1)/Decimal(2))
    else:
        ans = A+1 + (Decimal(distAB-1)/Decimal(2))

print(int(ans))