ZhenlongDai/ACPR huggingface dataset:
Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    A, V = list(map(int, input().split()))
    B, W = list(map(int, input().split()))
    T = int(input())

    x = V - W
    c = abs(B - A)
    ans = c - x * T

    if ans < 0:
        print('YES')
    else:
        print('No')


if __name__ == '__main__':
    main()


Failing test case input:
-1 3
1 4
3

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
import sys


def main():
    A, V = list(map(int, input().split()))
    B, W = list(map(int, input().split()))
    T = int(input())

    if W > V:
        print('NO')
        sys.exit()
    x = V - W
    c = abs(B - A)
    ans = c - x * T

    if ans <= 0:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    main()

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, va = map(int, input().split())
b, wb = map(int, input().split())
t = int(input())

kyori = abs(b-a)
hayasa = wb-va

if hayasa <= 0:
  print('NO')
elif kyori / hayasa > t:
  print('YES')
else:
  print('NO')


Failing test case input:
0 3
3 -1
4

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
a, va = map(int, input().split())
b, wb = map(int, input().split())
t = int(input())

kyori = abs(b-a)
hayasa = wb-va

if hayasa >= 0:
  print('NO')
elif kyori / abs(hayasa) <= t:
  print('YES')
else:
  print('NO')

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if B > A:
    AtoB = B - A
    VtoW = V - W
else:
    AtoB = A - B
    VtoW = W - V

if AtoB <= VtoW * T:
    print('YES')
else:
    print('NO')



Failing test case input:
0 6
0 4
2

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if B > A:
    Dis = B - A
    VtoW = V - W
else:
    Dis = A - B
    VtoW = V -W

result = VtoW * T

if Dis <= result:
    print('YES')
else:
    print('NO')
Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


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


def main():
    A, V = readnums()
    B, W = readnums()
    T = readint()
    if A + T * V >= B + T * W:
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    main()


Failing test case input:
2 -1
-1 -1
5

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


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


def main():
    A, V = readnums()
    B, W = readnums()
    T = readint()
    if A <= B:
        if A + T * V >= B + T * W:
            print('YES')
        else:
            print('NO')
    else:
        if A - T * V <= B - T * W:
            print('YES')
        else:
            print('NO')


if __name__ == "__main__":
    main()

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
ans = ["YES","NO"]

distance = abs(b-a)
speed = abs(v-w)

result = distance - speed * t
if result <= 0:
    print(ans[0])
elif result > 0:
    print(ans[1])
    


Failing test case input:
0 3
0 4
2

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
ans = ["YES","NO"]

distance = abs(b-a)
speed = v-w

result = distance - speed * t
if result <= 0:
    print(ans[0])
elif result > 0:
    print(ans[1])

Problem: p02646
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a<b and v<=w:
    print("NO")
elif b<a and w<=v:
    print("NO")
else:
    if abs(b-a)<=t*(v-w):
        print("YES")
    else:
        print("NO")


Failing test case input:
1 9
0 1
2

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a<b and v<=w:
    print("NO")
else:
    if abs(b-a)<=t*(v-w):
        print("YES")
    else:
        print("NO")
Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
stdin = [input() for i in range(3)]
line = stdin[0].split(' ')
A = int(line[0])
V = int(line[1])
line = stdin[1].split(' ')
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
if B < A:
    print('NO')
else:
    if (V-W)*T < B-A:
        print('NO')
    else:
        print('YES')

Failing test case input:
3 -1
-1 -2
5

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
stdin = [input() for i in range(3)]
line = stdin[0].split(' ')
A = int(line[0])
V = int(line[1])
line = stdin[1].split(' ')
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
length = 0
if B > A:
    length = B-A
else:
    length = A-B
if (V-W)*T < length:
    print('NO')
else:
    print('YES')

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,a2= map(int,input().split())
b,b2= map(int,input().split())

A = a2/1
B = b2/1
T = int(input())
if B*T < A*T :
    print("YES")
else:
    print("NO")

Failing test case input:
1 1
10 3
-4

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
A,V= map(int,input().split())
B,W= map(int,input().split())
T = int(input())

d = abs(B-A)
e = V-W

if e*T>=d:
    print("YES")
else:
    print("NO")

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
ans = ["YES","NO"]

distance = abs(b-a)
speed = abs(w-v)

result = distance - speed * t
if result <= 0:
    print(ans[0])
elif result > 0:
    print(ans[1])
    


Failing test case input:
1 0
3 6
3

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
ans = ["YES","NO"]

distance = abs(b-a)
speed = v-w

result = distance - speed * t
if result <= 0:
    print(ans[0])
elif result > 0:
    print(ans[1])

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,V = (int(x) for x in input().split())
B,W = (int(x) for x in input().split())
T = int(input())
Flag = False
if V>W and (A-B)%(V-W)==0:
    Flag = True

if Flag:
    print('YES')
else:
    print('NO')

Failing test case input:
1 3
3 -1
4

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
A,V = (int(x) for x in input().split())
B,W = (int(x) for x in input().split())
T = int(input())

if V>W and abs(A-B)/(V-W)<=T:
    Flag = True
else:
    Flag = False
    
if Flag:
    print('YES')
else:
    print('NO')

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
ans = "Yes"
if(V<=W):
  ans = "No"
elif(V>W and abs(A-B)>T*abs(V-W)):
  ans = "No"
print(ans)

Failing test case input:
-1 3
2 4
3

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
ans = "YES"
if(V<=W):
  ans = "NO"
elif(abs(A-B)>T*abs(V-W)):
  ans = "NO"
print(ans)
Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
d = abs(b-a)
d2 = w-v
print('YES' if d <= d2*t else 'NO')

Failing test case input:
1 9
1 4
1

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
d = abs(b-a)
d2 = v-w
print('YES' if d <= d2*t else 'NO')

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,v=(int(x) for x in input().split())
b,w=(int(x) for x in input().split())
t = int(input())

distance = abs(a-b)
sa = v - w

if distance < t*sa:
  print('YES')
else:
  print('NO')

Failing test case input:
-1 3
2 2
3

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
a,v=(int(x) for x in input().split())
b,w=(int(x) for x in input().split())
t = int(input())
 
distance = abs(a-b)
sa = v - w
 
if distance <= t*sa:
  print('YES')
else:
  print('NO')

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
B,W = map(int,input().split())
A,V = map(int,input().split())
T = int(input())

if W > V and (W-V)*T > A - B and A>B:
  print('YES')
elif W > V and (W-V)*T > B - A and B>A:
  print('YES')
else:
  print('NO')


Failing test case input:
0 3
3 2
3

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
B,W = map(int,input().split())
A,V = map(int,input().split())
T = int(input())

if W > V and (W-V)*T >= abs(A - B):
  print('YES')
else:
  print('NO')

Problem: p02646
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):


A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())







ans = "NO"
t=0

if W<V:
    if abs(A-B) % (V-W) == 0:
        if (abs(A-B) / (V-W)) < T:
            ans = "YES"



print(ans)


Failing test case input:
0 6
5 -1
6

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):


A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())







ans = "NO"
t=0

if W<V:
    if (abs(A-B) / (V-W)) <= T:
        ans = "YES"



print(ans)

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

a = V*T+A
b = W*T+B

if A < B:
    if a >= b:
        print("YES")
    else:
        print("NO")
elif A == B:
    print("NO")
else:
    if b >= a:
        print("YES")
    else:
        print("NO")

Failing test case input:
2 4
2 2
2

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

a = V*T+A
b = W*T+B

if V > W:
    if abs(A-B)/(V-W) <= T:
        print("YES")
    else:
        print("NO")
else:
    print("NO")
Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())


c=abs(a-b)+v*t-w*t
if c<=0:
    print("YES")
else:
    print("NO")

Failing test case input:
1 1
2 12
6

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())


c=abs(a-b)-v*t+w*t
if c<=0:
    print("YES")
else:
    print("NO")

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())

if (v - w) * t - (b - a) > 0:
  print("YES")
else:
  print("NO")

Failing test case input:
11 -1
-1 -1
9

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())

if (v - w) * t - abs(b - a) >= 0:
  print("YES")
else:
  print("NO")

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,v=map(float,input().split())
b,w=map(float,input().split())
t=float(input())
b = max(a,b)
a = min(a,b)
gap = abs(b-a)
v_gap = abs(v-w)
if v>=w: 
  if v_gap*t>=gap:
    print('YES')
  else:
    print('NO')
else:
  print('NO')


Failing test case input:
7 -1
-1 -1
9

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
gap=abs(a-b) 
if v>w:
  c=gap/(v-w)
  if t>=c:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
i=(input().split())
j=(input().split())
k=(input())

A=int(i[0])
V=int(i[1])
B=int(j[0])
W=int(j[1])
T=int(k)

if (B-A)+W*T <= V*T:
    print("YES")
else:
    print("NO")

Failing test case input:
5 0
-1 0
21

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
i=(input().split())
j=(input().split())
k=(input())

A=int(i[0])
V=int(i[1])
B=int(j[0])
W=int(j[1])
T=int(k)

if abs(B-A)+W*T <= V*T:
    print("YES")
elif abs(B-A)+W*T > V*T:
    print("NO")

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

flag=True
if v<=w:
    print('NO')
elif (a+v*t)>=(b+w*t) and abs(a-b)%abs(v-w)==0:
    print('YES')
else:
    print('NO')


Failing test case input:
0 3
3 -1
4

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

if v<=w:
    print('NO')
elif a<b:
    if (a+v*t)>=(b+w*t):
        print('YES')
    else:
        print('NO')
else:
    if (a-v*t)<=(b-w*t):
        print('YES')
    else:
        print('NO')
Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

position_diff = b - a
pace_diff = v - w

if pace_diff <= 0:
    print('NO')
elif pace_diff > 0:
    if position_diff < 0:
        print('NO')
    else:
        if pace_diff * t >= position_diff:
            print('YES')
        else:
            print('NO')

Failing test case input:
2 -1
-1 -2
5

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
 
position_diff = abs(a-b)
pace_diff = v-w
 
if pace_diff <= 0:
    print('NO')
elif pace_diff > 0:
    if pace_diff * t >= position_diff:
        print('YES')
    else:
        print('NO')

Problem: p02646
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
oni, oni_spd = list(map(int, input().split()))
child, child_spd = list(map(int, input().split()))
T = int(input())

dist = child - oni
ofs_spd = oni_spd - child_spd

if ofs_spd * T >= dist:
  print('YES')
else:
  print('NO')

Failing test case input:
2 -1
-1 -1
9

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
oni, oni_spd = list(map(int, input().split()))
child, child_spd = list(map(int, input().split()))
T = int(input())

dist = abs(child - oni)
ofs_spd = oni_spd - child_spd

if ofs_spd * T >= dist:
  print('YES')
else:
  print('NO')
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
a -= 1; b -= 1
ans = 0
if (b-a) % 2 == 0:
    ans = (b-a) 
else:
    ans = min(b, n - 1 - a)
print(ans)

Failing test case input:
1 -1 269

Expected output:
135


Actual output:
270


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
a -= 1; b -= 1
if (b-a) % 2 == 0:
    print((b-a) 
else:
    x = min(a, n-1-b)
    print(x + 1 + (b-a-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int,input().split())
mid = N/2
if (B-A)%2 == 0:
  answer = -1
else:
  answer = -1

print(answer)

Failing test case input:
2 -1 185

Expected output:
93


Actual output:
-1


Fixed submission (verdict: Accepted):
N, A, B = map(int,input().split())
if (B-A)%2 == 0:
  answer = int((B-A)
else:
  answer = min(A-1, N-B)+1+int((B-A-1)

print(answer)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n, a, b = map(int, input().split())
x = b - a
if x % 2 == 0:
    print(int(x/2))
else:
    print(int((x+3)/2))

    




        



Failing test case input:
1 -2 59

Expected output:
-27


Actual output:
32


Fixed submission (verdict: Accepted):
import sys
n, a, b = map(int, input().split())
x = b - a
if x % 2 == 0:
    print(int(x
else:
    y = a-1
    z = n-b
    w = min(y, z)
    print(int((x+2*w+1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def main():
    N, A, B = map(int, input().split())
    diff = B - A
    if diff % 2 == 0:
        print(int(diff / 2))
    else:
        diff = B + A - 1
        print(int(diff / 2))


if __name__ == "__main__":
    main()


Failing test case input:
0 -1 86

Expected output:
-42


Actual output:
42


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def main():
    N, A, B = map(int, input().split())
    if (B - A) % 2 == 0:
        print(int((B - A) 
    else:
        
        
        
        
        print(int(min(A - 1, N - B) + 1 + (B - A - 1) 


if __name__ == "__main__":
    main()

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
sa = B - A
if sa % 2 == 0:
  print(int(sa/2))
else:
  print(min(N -A, B -1))

Failing test case input:
2 -2 269

Expected output:
-131


Actual output:
4


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
sa = B - A
if sa % 2 == 0:
   print(int(sa
else:
   print(int(min(A -1,N -B) + 1 + (B- A)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())

if (b - a) % 2 == 1:
    print(min(b-1, n-a))
else:
    print(b - a - 1)

Failing test case input:
0 2 40

Expected output:
19


Actual output:
37


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())

mid = b - a

if mid % 2 == 0:
    print(mid 
else:
    print(min(a - 1, n - b) + 1 + (mid - 1)
Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, a, b = map(int, input().split())
ans = 0

if (b-a)%2 == 0:
    ans = (b-a) 
else:
    ans = min(2*n-a-b-1, a+b-3)
    
print(ans)

Failing test case input:
-2 -2 31

Expected output:
-16


Actual output:
-34


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
ans = 0

if (b-a)%2 == 0:
    ans = (b-a) 
else:
    ans = min((2*n-a-b+1)
    
print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = (int(i) for i in input().split()) 
dif = abs(a-b)

if dif % 2 == 0:
    print(dif/2)
else:
    if 2*n - a -b >= a + b:
        print(int((a + b-1)/2))
    else:
        print(int((2*n - a -b - 1)/2))

Failing test case input:
6 -2 81

Expected output:
-33


Actual output:
-34


Fixed submission (verdict: Accepted):
n, a, b = (int(i) for i in input().split()) 
dif = b-a

if dif % 2 == 0:
    print(dif
else:
    if a + b - 2 <= 2*n - a -b:
        print(((a + b - 1)
    else:
        print(((2*n - a - b + 1)

Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, a, b = map(int, input().split())
d = b - a - 1
if d % 2 == 0:
    ans = min(b - 1, n - a)
else:
    ans = (d+1) 

print(ans)

Failing test case input:
0 1 60

Expected output:
-30


Actual output:
-1


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
d = b - a
if d % 2 == 0:
    print(d
else:
    dd = d
    ans = min(dd + a, n - b + 1 + dd)
    print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



def solve(*args: str) -> str:
    n, a, b = map(int, args[0].split())

    ret = 0

    if abs(a-b) % 2:
        ret = min(max(a-1, b-1), max(n-a, n-b))
    else:
        ret = abs(a-b)

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


Failing test case input:
1 -2 83

Expected output:
-39


Actual output:
3


Fixed submission (verdict: Accepted):



def solve(*args: str) -> str:
    n, a, b = map(int, args[0].split())

    ret = min(max(a-1, b-1), max(n-a, n-b))

    if (b-a) % 2:
        if a-1 < n-b:
            sup = a
            ret = min(ret, sup+((b-sup-1)
        else:
            sup = n-b+1
            ret = min(ret, sup+((n-a-sup)
    else:
        ret = min(ret, (b-a)

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
if (abs(a-b)%2)==0:
    print((abs(a-b)))
    print(int((abs(a-b))/2))
else:
    if abs(a-1)<abs(n-b):
        dis=abs(a-1)
        b=b-1
        print(int((abs(a-b))/2)+dis+1)
    elif abs(a-1)>=abs(n-b):
        dis=abs(b-n)
        a=a+1
        print(int((abs(a-b))/2)+dis+1)


Failing test case input:
5 1 27

Expected output:
13


Actual output:
26
13


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
if ((b-a)%2)==0:
    print(int(((b-a)
elif ((b-a)%2)==1:
    if (a-1)<(n-b):
        dis=(a-1)
        b=b-1
        print(int(((b-a)
    elif (a-1)>=(n-b):
        dis=(n-b)
        a=a+1
        print(int(((b-a)
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())

if (b - a) % 2 == 0:
    print(int((b-a)/2))
else:
    print(min(b-1, n-a))

Failing test case input:
1 0 679

Expected output:
-338


Actual output:
1


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())

if (b - a) % 2 == 0:
    print((b-a)
else:
    print(min(a-1, n-b)+1+(b-a-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int,input().split())
ans = (b-a)
if (b-a)%2 == 1:
    ans = min(b-1, n-a)
print(ans)

Failing test case input:
1 -6 44

Expected output:
25


Actual output:
50


Fixed submission (verdict: Accepted):
n, a, b = map(int,input().split())
ans = (b-a)
if (b-a)%2 == 1:
    ans = min((a + (b-a-1)
print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    N, A, B = map(int, input().split())
    
    sub = B - A

    left_s = A - 1
    right_s = N - B
    
    
    if sub % 2 == 0:
        return sub / 2
    
    else:
        if left_s <= right_s:
            return B - 1
        else:
            return N - A
    
if __name__ == '__main__':
    print(int(main()))

Failing test case input:
0 -1 86

Expected output:
-42


Actual output:
1


Fixed submission (verdict: Accepted):
def main():
    N, A, B = map(int, input().split())
    
    sub = B - A

    left_s = A - 1
    right_s = N - B
        
    
    if sub % 2 == 0:
        return sub 
    
    else:
        return (min(left_s, right_s) + 1 + ((sub - 1)
    
if __name__ == '__main__':
    print(main())

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int,input().split())
mid = N/2
if (B-A)%2 == 0:
  answer = -1
else:
  answer = min(int(N-A), int(B-1))

print(answer)

Failing test case input:
0 4 249

Expected output:
-126


Actual output:
-4


Fixed submission (verdict: Accepted):
N, A, B = map(int,input().split())
if (B-A)%2 == 0:
  answer = int((B-A)
else:
  answer = min(A-1, N-B)+1+int((B-A-1)

print(answer)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = list(map(int, input().split()))
sa = b-a

if sa%2==0:
  print(int(sa/2))
else:
  print(min(n-a, b-1))

Failing test case input:
1 -2 83

Expected output:
-39


Actual output:
3


Fixed submission (verdict: Accepted):
n,a,b = list(map(int, input().split()))
if (b-a)%2==0:
  print(int((b-a)
else:
  print(min(a-1,n-b) + 1 + int((b-a-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B=map(int,input().split(" ")) 
if (B-A)%2==0:
    print(int((B-A)/2))
else:
    a1=int(min(N-1-A,B-1))
    a2=int((A-1)+1+(B-A-1)/2)
    a3=int((N-1-B)+1+(B-A-1)/2)
    print(min(a1,a2,a3))

Failing test case input:
-2 5 38

Expected output:
-23


Actual output:
-24


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split(" ")) 
if (B-A)%2==0:
    print(int(int(B-A)
else:
    a1=int(min(N-A,B-1))
    a2=int(int(A-1)+1+int(B-A-1)
    a3=int(int(N-B)+1+int(B-A-1)
    print(min(a1,a2,a3))
Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
bbn=1000000007
	

		
def main():
	n, a, b= map(int, input().split())
	k=b-a
	if k %2 ==0:
		return 2
		
	to=max(a-1,b-1)
	tn=max(n-a,n-b)
	return min(to,tn)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Failing test case input:
6 0 28

Expected output:
14


Actual output:
2


Fixed submission (verdict: Accepted):
import sys
bbn=1000000007
	

		
def main():
	n, a, b= map(int, input().split())
	
	k=b-a
	if k % 2 ==0:
		return k 
		
	to=a+((b-a-1)
	tn=(n-b+1)+(n-(a+(n-b+1)))
	return min(to,tn)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
if (b-a)%2 == 0:
 print((b-a)/2)
else:
 print(min(a-1,n-b))


Failing test case input:
1 -1 269

Expected output:
135


Actual output:
135.0


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
if (b-a)%2 == 0:
 print((b-a)
else:
 print(min(a-1,n-b)+1+(b-a-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
C=B-A
D=min(A-1,N-B)+1 + (B - A - 1)/2
if C%2==1:
    print (D)
else:
    print(C)



Failing test case input:
6 -1 36

Expected output:
-11


Actual output:
-11.0


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
C=B-A
D=min(A-1,N-B)+1 + (B - A - 1)
if C%2==1:
    print (D)
else:
    print(C

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())

if abs(B - A) % 2 == 0:
    print(abs(B - A))
else:
    print(max(A - 1, N - B) + 1 + (B - A - 1) / 2)


Failing test case input:
1 -2 83

Expected output:
-39


Actual output:
40.0


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())

if abs(B - A) % 2 == 0:
    print(abs(B - A) 
else:
    print(min(A - 1, N - B) + 1 + (B - A - 1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int,input().split())

if (b - a) % 2 ==0:
    print((b-a)/2)
else:
    print((b-a)/2 + 1)

Failing test case input:
-2 1 32

Expected output:
-18


Actual output:
16.5


Fixed submission (verdict: Accepted):
n, a, b = map(int,input().split())

if (b - a) % 2 ==0:
    print((b-a)
else:
    print(min(a-1,n-b)+1+(b-a)
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())

if (b-a)%2 == 0:
    print(int((b-a)/2))
elif n-a <= b-1:
    al = n-b+1
    b = n
    a += al
    r = int((b-a)/2+al)
    print(max(r, 1))
else:
    be = a
    a = 1
    b -= a
    r = int((b-a)/2+be)
    print(max(r, 1))


Failing test case input:
-1 5 38

Expected output:
-22


Actual output:
1


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())

if (b-a)%2 == 0:
    print((b-a)
elif n-a < b-1:
    al = n-b+1
    b = n
    a += al
    r = (b-a)
    print(max(r, 1))
else:
    be = a
    b -= a
    a = 1
    r = (b-a)
    print(max(r, 1))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = map(int,input().split())
k = min(a,b)-1
p = n - max(a,b)
if abs(a-b)==1:
  print(min(k,p)+1)
else:
  x = abs(a-b)
  print(x)

Failing test case input:
10 4 7

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
n,a,b = map(int,input().split())
k = min(a,b)-1
p = n - max(a,b)
if abs(a-b)==1:
  print(min(k,p)+1)
else:
  x = (abs(a-b)
  print(x)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = list(map(int, input().split()))

if a % 2 == b % 2:
  print((b - a) / 2)
else:
  print(min(a + (b - a - 1) / 2, n - b + 1 + (n - (a + (n - b + 1))) / 2))

Failing test case input:
1 -2 185

Expected output:
-90


Actual output:
-90.0


Fixed submission (verdict: Accepted):
n, a, b = list(map(int, input().split()))

if a % 2 == b % 2:
  print((b - a) 
else:
  print(min(a + (b - a - 1)

Problem: p02823
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,A,B=map(int,input().split())
key=B-A
if key%2==0:
  print(int(key/2))
else:
  if A>N/2:
    print(N-A)
  else:
    print(B-1)

Failing test case input:
1 -1 172

Expected output:
-84


Actual output:
171


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split())
key=B-A
if key%2==0:
  print(int((B-A)
else:
  print(int(min(A-1,N-B)+1+(B-A-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def main():
    N, A, B = map(int, input().split())
    if abs(A - B) % 2 == 0:
        print(int(abs(A - B) / 2))
    else:
        print(min(B - 1, N - A))


if __name__ == "__main__":
    main()


Failing test case input:
0 1 612

Expected output:
-306


Actual output:
-1


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def main():
    N, A, B = map(int, input().split())
    if (B - A) % 2 == 0:
        print(int((B - A) 
    else:
        
        
        
        
        print(int(min(A - 1, N - B) + 1 + (B - A - 1) 


if __name__ == "__main__":
    main()

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int,input().split())
if((B-A+1)%2==1):
    print(B-A-1)
else:
    print(min(N-A,B-1))

Failing test case input:
1 -2 52

Expected output:
27


Actual output:
53


Fixed submission (verdict: Accepted):
N,A,B = map(int,input().split())
if((B-A+1)%2==1):
    print((B-A)
else:
    print(min(A-1,N-B)+1+(B-A-1)
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
if (b-a)%2==0:
  print((b-a)/2)
else:
  l=[n-a,b]
  print(min(l))

Failing test case input:
-2 1 33

Expected output:
16


Actual output:
16.0


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
if (b-a)%2==0:
  print((b-a)
else:
  x=(a+b-1)
  l=[x,n-x]
  print(min(l))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int,input().split())
if (B-A)%2 == 0:
  answer = int((B-A)/2)
else:
  answer = min(A-1, N-B)+1+int(B-A-1)/2

print(answer)

Failing test case input:
0 2 127

Expected output:
-64


Actual output:
-64.0


Fixed submission (verdict: Accepted):
N, A, B = map(int,input().split())
if (B-A)%2 == 0:
  answer = int((B-A)
else:
  answer = min(A-1, N-B)+1+int((B-A-1)

print(answer)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = list(map(int, input().split()))

if (a-b) % 2 == 0:
    print(abs(a-b)/2)
else:
    x = ((a-1) + (b-1) + 1)/2
    y = ((n-1) + (n-b) + 1)/2
    print(min(x, y))


Failing test case input:
6 -2 81

Expected output:
-33


Actual output:
-34.5


Fixed submission (verdict: Accepted):
n, a, b = list(map(int, input().split()))

if (a-b) % 2 == 0:
    print(abs(a-b)
else:
    x = ((a-1) + (b-1) + 1)
    y = ((n-a) + (n-b) + 1)
    print(min(x, y))

Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, a, b = map(int, input().split())

d = b-a
d_nearest_side = min(a-1, n-b)
move_to_side = d + d_nearest_side
if d % 2 == 0:
    print(int(min(d/2, move_to_side)))
else:
    print(int(move_to_side))


Failing test case input:
1 4 38

Expected output:
17


Actual output:
-3


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
d = b-a
d_nearest_side = min(a-1, n-b)
if d % 2 == 0:
    print(d
else:
    move_side = 1 + (d-1)
    print(int(move_side))

Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,a,b= map(int,input().split())

if abs(a-b)%2==0:
  c=abs(a-b)
else:
  if a>b:
    c=min(abs(1-a),abs(n-b))
  else:
    c=min(abs(n-a),abs(1-b))

print(c)

Failing test case input:
0 2 94

Expected output:
46


Actual output:
92


Fixed submission (verdict: Accepted):
n,a,b= map(int,input().split())
if a<b:
  tmp=a
  a=b
  b=tmp
if abs(a-b)%2==0:
  c=abs(a-b)

else:

  if abs(a-b)>=3:
    c=min(abs(1-a),abs(n-b))
    c = c-(abs(a-b)
  else:
    c=min(abs(1-a),abs(n-b))


print(c)
Problem: p02823
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

dis = B - A
if dis % 2 == 0:
    ans = dis 
elif dis == 1:
    ans = min(B - 1, N - A)
else:
    ans = 1 + (B - A - 1) 
print(ans)


Failing test case input:
-1 1 40

Expected output:
-21


Actual output:
39


Fixed submission (verdict: Accepted):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

dis = B - A
if dis % 2 == 0:
    ans = dis 
else:
    ans = min(A - 1, N - B) + 1 + ((B - A) 

print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = [int(i) for i in input().split()]
if (b-a)%2==0:
    print(int( (b-a)/2 ))
else:
    print(min(n-a,b-1))

Failing test case input:
-1 4 189

Expected output:
-97


Actual output:
-5


Fixed submission (verdict: Accepted):
n,a,b = [int(i) for i in input().split()]
if (b-a)%2==0:
    print((b-a)
else:
    r = a + (b-a-1)
    l = n-b+1 + ( n - (a+n-b+1) )
    print(min(r,l))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())

if (B - A) % 2 == 0:
    result = (B - A) 
else:
    result = min(B - 1, N - A)

print(result)

Failing test case input:
-2 1 19

Expected output:
9


Actual output:
18


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())

if (B - A) % 2 == 0:
    result = (B - A) 
else:
    result = min(A + ((B - A) - 1) 

print(result)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())

if (b-a) % 2 == 0:
    ans = (b-a)/2
else:
    if a-1 <= n-b:
        ans = a+(b-a-1)/2
    else:
        ans = (b-n)+1+(b-a-1)/2

print(int(ans))


Failing test case input:
0 2 57

Expected output:
-29


Actual output:
85


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())

if (b-a) % 2 == 0:
    ans = (b-a)
else:
    if (a-1) < (n-b):
        ans = a+((b-a-1)
    elif (a-1) == (n-b):
        ans = n/2
    else:
        ans = n-b+1+((b-a-1)

print(int(ans))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())

A, B = min(A, B), max(A, B)
if (B - A) % 2 == 0:
    ans = (B - A) 
else:
    ans = min(B - 1, N - A)

print(ans)


Failing test case input:
-2 1 33

Expected output:
16


Actual output:
32


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())

if (B - A) % 2 == 0:
    ans = (B - A) 
else:
    ans = min(A - 1 + (B - (A - 1)) 

print(int(ans))
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int,input().split())
if (B-A) % 2 == 0:
  print(int((B-A)/2))
elif A-1 <= N-B:
  print(int((A+B-1)/2))
else:
  print(int((N+1-(B+A+1))/2))

Failing test case input:
1 -1 96

Expected output:
-46


Actual output:
-47


Fixed submission (verdict: Accepted):
N,A,B = map(int,input().split())
if (B-A) % 2 == 0:
  print((B-A)
elif A-1 <= N-B:
  print((A+B-1)
else:
  print(N+1-(B+A+1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = list(map(int, input().split()))
sa = b-a-1

if sa%2!=0:
  print(min(b-1, n-a))
else:
  print(int(sa/2))

Failing test case input:
2 -1 185

Expected output:
93


Actual output:
3


Fixed submission (verdict: Accepted):
n,a,b = list(map(int, input().split()))
if (b-a)%2==0:
  print(int((b-a)
else:
  print(min(a-1,n-b) + 1 + int((b-a-1)

Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,A,B=map(int,input().split())

if (B-A)%2==0:
    ans=(B-A)
else:
    ans=min(B-1,N-A)

print(ans)

Failing test case input:
0 1 459

Expected output:
229


Actual output:
458


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split())

if (B-A)%2==0:
    ans=(B-A)
else:
    ans=min((A+B-1)

print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())

if (b-a)%2==0:
  ans=(b-a)/2
else:
  ans=(a+b)
  
print(ans)

Failing test case input:
1 -2 44

Expected output:
23


Actual output:
23.0


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())

if (b-a)%2==0:
  ans=(b-a)
else:
  ans=min((a+b)
  
print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
if abs(A-B)%2==0:
    print(int(abs(A-B)/2))
else:
    print(min(max(A,B)-1,N-min(A,B)))

Failing test case input:
11 -2 81

Expected output:
-28


Actual output:
13


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
if abs(A-B)%2==0:
    print(int(abs(A-B)
else:
    print(int((abs(A-B)-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
y=(b-a-1)/2
if (a-1)<=(n-b):
  print(int(y+a))
else:
  print(int(y+1+n-b))

Failing test case input:
-2 1 19

Expected output:
9


Actual output:
-11


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
y=(b-a-1)
if (b-a)%2==0:
  print(int((b-a)
else:
  if (a-1)<(n-b):
    print(int(y+a))
  else:
    print(int(y+1+n-b))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int, input().split())
if (B-A)%2 ==0:
  print((B-A)/2)
else:
  print(min(A-1,N-B)+1+(B-A-1)/2)


Failing test case input:
-2 1 32

Expected output:
-18


Actual output:
-18.0


Fixed submission (verdict: Accepted):
N,A,B = map(int, input().split())
if (B-A)%2==0:
  print((B-A)
else:
  print(min(A-1,N-B)+1+(B-A-1)
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = map(int, input().split())
rs = (b-a)

if ((b-a) % 2) == 0:
  print(rs)
else:
  if((a-1) < (n-b)):
    print(rs+(n-b+1))
  else:
    print(rs+a)

Failing test case input:
2 -1 185

Expected output:
93


Actual output:
186


Fixed submission (verdict: Accepted):
n,a,b = map(int, input().split())
rs = (b-a)

if (b-a) % 2 == 0:
    print(rs)
else:
    if a==1 and b==n:
        print(n
    elif (a-1) > (n-b):
        print(rs+(n-b+1))
    else:
        print(rs+a)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
if (a-b)%2==0:
	print(int(abs(a-b)/2))
else:
	print(min(b-1,n-a))

Failing test case input:
1 -1 172

Expected output:
-84


Actual output:
2


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
if (b-a)%2==0:
	print(int((b-a)
else:
	s=min(a-1,n-b)
	print(int(s+1+(b-a-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,a,b=map(int,input().split())

if (b - a)%2 == 0:
  ans1 = int((b - a)/2)
else:
  ans1 = 10**18
  
ans2 = b-1
ans3 = N-a

ans4 = a-1 + (b-a-1)/2
ans5 = N-b + (b-a-1)/2

ans = int(min(ans1,ans2,ans3,ans4,ans5))
print(ans)

Failing test case input:
-2 -1 18

Expected output:
-10


Actual output:
-11


Fixed submission (verdict: Accepted):
N,a,b=map(int,input().split())

if (b - a)%2 == 0:
  ans = int((b - a)
else:
  ans4 = int(int(a) + int((b-a-1)
  ans5 = int(int(N-b+1) + int((b-a-1)
  ans = int(min(ans4,ans5))
  
print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def min_steps_v2(n, a, b):
    if (b - a) % 2 == 0:
        return int((b - a) / 2)

    
    a_diff = a - 1
    b_diff = n - b

    if a_diff > b_diff:
      steps_to_even = n - b + 1
      remain_steps = int((n - (a + steps_to_even)) / 2)
      print(steps_to_even, remain_steps)
    else:
      steps_to_even = a
      remain_steps = int(((b - steps_to_even) - 1) / 2)

    return steps_to_even + remain_steps

numbers = input().split(' ')
 
n = int(numbers[0])
a = int(numbers[1])
b = int(numbers[2])

print(min_steps_v2(n, a, b))

Failing test case input:
7 1 28

Expected output:
-7


Actual output:
-20 13
-7


Fixed submission (verdict: Accepted):
import numpy as np

def min_steps_v2(n, a, b):
    n = np.int64(n)
    a = np.int64(a)
    b = np.int64(b)

    if (b - a) % 2 == 0:
        return np.int64(int(b - a) 
 
    
    a_diff = a - 1
    b_diff = n - b
 
    if a_diff > b_diff:
      steps_to_even = n - b + 1
      remain_steps = min_steps_v2(n, a + (n - b) + 1, n)
    else:
      steps_to_even = a
      remain_steps = min_steps_v2(n, 1, b - a)
 
    return steps_to_even + remain_steps

numbers = input().split(' ')
 
n = int(numbers[0])
a = int(numbers[1])
b = int(numbers[2])
 
print(min_steps_v2(n, a, b))
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int,input().split()) 
if abs(A-B)%2==0 :
	print((B-A)/2)
else:
	print(max(N-A,B-1))

Failing test case input:
0 0 679

Expected output:
-339


Actual output:
678


Fixed submission (verdict: Accepted):
N,A,B = map(int,input().split()) 
if abs(A-B)%2==0 :
	print((B-A)
else:
	print((B-A-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, a, b = map(int, input().split())
num = abs(a-b)

if num%2 == 0:
    half = num
else:
    half = N+1
edge = min(N-min(a,b), max(a,b)-1)

print(min(half, edge))

Failing test case input:
-4 1 53

Expected output:
26


Actual output:
-5


Fixed submission (verdict: Accepted):
N, a, b = map(int, input().split())
num = b - a
if num%2 == 0:
    half = num
    print(half)
else:
    edge = min(N-a, b-1)
    edge2 = min((b-a-1)
    print(min(edge2, edge))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,a,b=map(int,input().split())

if (b - a)%2 == 0:
  ans1 = int((b - a)/2)
else:
  ans1 = 10**18
  
ans2 = b-1
ans3 = N-a

ans4 = a-1 + (b-a-1)/2 +1
ans5 = N-b + (b-a-1)/2 +1

ans = int(min(ans1,ans2,ans3,ans4,ans5))
print(ans)

Failing test case input:
0 3 27

Expected output:
12


Actual output:
-14


Fixed submission (verdict: Accepted):
N,a,b=map(int,input().split())

if (b - a)%2 == 0:
  ans = int((b - a)
else:
  ans4 = int(int(a) + int((b-a-1)
  ans5 = int(int(N-b+1) + int((b-a-1)
  ans = int(min(ans4,ans5))
  
print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = list(map(int, input().split()))

if (b-a)%2==0:
    print(int((b-a)/2))
else:
    if b-a==1:
        if a-1 < n-b:
            print(a)
        else:
            print(n-a)
    else:
       
        
        if a-1 < n-b:
            
            print(int(a+(b-a-1)/2))
        elif a-1==n-b:
            print(n/2)
        else:
            print(int(n-b+1+(n-(a+n-b+1))/2))


Failing test case input:
10 4 7

Expected output:
5


Actual output:
5.0


Fixed submission (verdict: Accepted):
n,a,b = list(map(int, input().split()))

if (b-a)%2==0:
    print(int((b-a)
else:
    
    if b-a==1:
        if a-1 < n-b:
            print(a)
        else:
            print(n-a)
    else:
       
        
        if a-1 < n-b:
            
            print(int(a+(b-a-1)
        else:
            print(int(n-b+1+(n-(a+n-b+1))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())

if (a + b)%2 == 0:
    print(int(abs(((a+b)/2) - a)))
else:
    result = min(b - 1, n - a)
    print(result)


Failing test case input:
0 2 127

Expected output:
-64


Actual output:
-2


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())

if (b - a) % 2 == 0:
    print((b - a) 
else:
    print(min(a, n - b + 1) + (b - a - 1)
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
if (b-a)%2==0:
  ans=(b-a)
  
  print(ans)
else:
  print(min(b-1,n-a))

Failing test case input:
-1 0 612

Expected output:
306


Actual output:
612


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
if (b-a)%2==0:
  ans=(b-a)
  
  print(ans)
else:
  ans=min(b-1,n-a)
  ans=min(ans,n-(a+b-1)
  ans=min(ans,(a+b-1)
  print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = [int(i) for i in input().split()]
if (b-a)%2==0:
    print(int( (b-a)/2 +0.5))
else:
    r = a + (b-a-1)
    l = n-b+1 + ( n - (a+n-b+1) )
    print(min(r,l))

Failing test case input:
-2 5 38

Expected output:
-23


Actual output:
-7


Fixed submission (verdict: Accepted):
n,a,b = [int(i) for i in input().split()]
if (b-a)%2==0:
    print((b-a)
else:
    r = a + (b-a-1)
    l = n-b+1 + ( n - (a+n-b+1) )
    print(min(r,l))

Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,a,b= map(int,input().split())

if a%2==0 and b%2==0:
  c=abs(a-b)
else:
  if a>b:
    c=min(abs(1-a),abs(n-b))
  else:
    c=min(abs(n-a),abs(1-b))

print(c)

Failing test case input:
1 -1 96

Expected output:
-46


Actual output:
2


Fixed submission (verdict: Accepted):
n,a,b= map(int,input().split())
if a<b:
  tmp=a
  a=b
  b=tmp
if abs(a-b)%2==0:
  c=abs(a-b)

else:

  if abs(a-b)>=3:
    c=min(abs(1-a),abs(n-b))
    c = c-(abs(a-b)
  else:
    c=min(abs(1-a),abs(n-b))


print(c)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int,input().split()) 
if abs(A-B)%2==0 :
	print((B-A)/2)
else:
	print(min(N-A,B-1))

Failing test case input:
-4 1 53

Expected output:
26


Actual output:
26.0


Fixed submission (verdict: Accepted):
N,A,B = map(int,input().split()) 
if abs(A-B)%2==0 :
	print((B-A)
else:
	print((B-A-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
if (b-a)%2 != 0:
    if a-1 <= n-b:
        ans = (b - a -1)
    else:
        ans = (b - a - 1)
else:
    ans = min((b - a) / 2, b-1, n-a)
print(ans)

Failing test case input:
7 0 12

Expected output:
6


Actual output:
6.0


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
if (b-a)%2 != 0:
    if a-1 <= n-b:
        ans = (b - a -1)
    else:
        ans = (b - a - 1)
else:
    ans = min((b - a) 
print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = list(map(int, input().split()))
sa = b-a
if sa%2==0:
  print(int(sa/2))
else:
  print(int((sa-1)/2)+1+min(b-1,n-a))

Failing test case input:
0 -1 86

Expected output:
-42


Actual output:
45


Fixed submission (verdict: Accepted):
n,a,b = list(map(int, input().split()))
if (b-a)%2==0:
  print(int((b-a)
else:
  print(min(a-1,n-b) + 1 + int((b-a-1)