Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5
maxAB = 10 ** 18

Max = max([A, B])
Min = min([A, B])

for i in range(maxAB):
    if (Max - Min) % 2 == 0:
            Max = Max - 1
            Min = Min + 1
    else:
        medAB = (Max + Min) / 2
        if medAB > med:
            Max = Max + 1
            Min = Min + 1

            if Max > N:
                Max = N
            elif Min > N:
                Min = N
        else:
            Max = Max - 1
            Min = Min - 1
        
            if Max < 1:
                Max = 1
            elif Min < 1:
                Min = 1
        

    round_count = round_count + 1

    if Max == Min:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5
maxAB = 10 ** 18

Max = max([A, B])
Min = min([A, B])

for i in range(maxAB):
    if (Max - Min) % 2 == 0:
            Max = Max - 1
            Min = Min + 1
    else:
        medAB = (Max + Min) / 2
        if medAB > med:
            Max = Max + 1
            Min = Min + 1
        else:
            Max = Max - 1
            Min = Min - 1

    if Max < 1:
        Max = 1
    elif Max > N:
        Max = N
    elif Min < 1:
        Min = 1
    elif Min > N:
        Min = N

    round_count = round_count + 1

    if Max == Min:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5
maxAB = 10 ** 18

for i in range(maxAB):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1
        else:
            A = A + 1
            B = B - 1
    else:
        medAB = (A + B) / 2
        if medAB > med:
            A = A + 1
            B = B + 1
        else:
            A = A - 1
            B = B - 1

    if A < 1:
        A = 1
    elif A > N:
        A = N
    elif B < 1:
        B = 1
    elif B > N:
        B = N

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5
maxAB = 10 ** 18

for i in range(maxAB):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1
        else:
            A = A + 1
            B = B - 1
    else:
        medAB = (A + B) / 2
        if medAB > med:
            A = A + 1
            B = B + 1
        else:
            A = A - 1
            B = B - 1

    if A < 1:
        A = 1
    elif A > N:
        A = N
    elif B < 1:
        B = 1
    elif B > N:
        B = N

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5
maxAB = 10 ** 18

for i in range(maxAB):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1

            if A < 1:
                A = 1
            elif B > N:
                B = N
        else:
            A = A + 1
            B = B - 1

            if A > N:
                A = N
            elif B < 1:
                B = 1
    else:
        Max = max([A, B])
        Min = min([A, B])
        medAB = (Max + Min) / 2
        if medAB > med:
            A = A + 1
            B = B + 1

            if A > N:
                A = N
            elif B > N:
                B = N
        else:
            A = A - 1
            B = B - 1

            if A < 1:
                A = 1
            elif B < 1:
                B = 1

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5
maxAB = 10 ** 18

for i in range(maxAB):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1

            if A < 1:
                A = 1
            elif B > N:
                B = N
        else:
            A = A + 1
            B = B - 1

            if A > N:
                A = N
            elif B < 1:
                B = 1
    else:
        Max = max([A, B])
        Min = min([A, B])
        if (Max + Min) / 2 > med:
            A = A + 1
            B = B + 1

            if A > N:
                A = N
            elif B > N:
                B = N
        else:
            A = A - 1
            B = B - 1

            if A < 1:
                A = 1
            elif B < 1:
                B = 1

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5

for i in range(int(1e18)):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1

            if A < 1:
                A = 1
            elif B > N:
                B = N
        else:
            A = A + 1
            B = B - 1

            if A > N:
                A = N
            elif B < 1:
                B = 1
    else:
        Max = max([A, B])
        Min = min([A, B])
        if (Max + Min) / 2 > med:
            A = A + 1
            B = B + 1

            if A > N:
                A = N
            elif B > N:
                B = N
        else:
            A = A - 1
            B = B - 1

            if A < 1:
                A = 1
            elif B < 1:
                B = 1

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

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

med = N / 2 + 0.5

for i in range(1e18):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1

            if A < 1:
                A = 1
            elif B > N:
                B = N
        else:
            A = A + 1
            B = B - 1

            if A > N:
                A = N
            elif B < 1:
                B = 1
    else:
        Max = max([A, B])
        Min = min([A, B])
        if (Max + Min) / 2 > med:
            A = A + 1
            B = B + 1

            if A > N:
                A = N
            elif B > N:
                B = N
        else:
            A = A - 1
            B = B - 1

            if A < 1:
                A = 1
            elif B < 1:
                B = 1

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5

for i in range(int(1e18)):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1

            if A < 1:
                A = 1
            elif B > N:
                B = N
        else:
            A = A + 1
            B = B - 1

            if A > N:
                A = N
            elif B < 1:
                B = 1
    else:
        Max = max([A, B])
        Min = min([A, B])
        if (Max + Min) / 2 > med:
            A = A + 1
            B = B + 1

            if A > N:
                A = N
            elif B > N:
                B = N
        else:
            A = A - 1
            B = B - 1

            if A < 1:
                A = 1
            elif B < 1:
                B = 1

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5

while(True):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1

            if A < 1:
                A = 1
            elif B > N:
                B = N
        else:
            A = A + 1
            B = B - 1

            if A > N:
                A = N
            elif B < 1:
                B = 1
    else:
        Max = max([A, B])
        Min = min([A, B])
        if (Max + Min) / 2 > med:
            A = A + 1
            B = B + 1

            if A > N:
                A = N
            elif B > N:
                B = N
        else:
            A = A - 1
            B = B - 1

            if A < 1:
                A = 1
            elif B < 1:
                B = 1

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
round_count = 0

med = N / 2 + 0.5

while(True):
    if abs(A - B) % 2 == 0:
        if A > B:
            A = A - 1
            B = B + 1
        else:
            A = A + 1
            B = B - 1
    else:
        Max = max([A, B])
        Min = min([A, B])
        if (Max + Min) / 2 > med:
            A = A + 1
            B = B + 1
        else:
            A = A - 1
            B = B - 1

    if A < 1:
        A = 1
    elif A > N:
        A = N
    elif B < 1:
        B = 1
    elif B > N:
        B = N

    round_count = round_count + 1

    if A == B:
        break

print(round_count)

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

med = N / 2 + 0.5
Sub = B - A

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