Buggy python submission (verdict: Time Limit Exceeded):
n,x,y = map(int,input().split(' '))
cost = [0 for i in range(n - 1)]
for i in range(n - 1):
    for l in range(i + 1, n):
        result = min(abs(i - l),abs(i - x + 1) + 1 + abs(l - y + 1),abs(i - y + 1) + 1 + abs(l - x + 1))
        cost[result - 1] += 1
for per in cost:
    print(per)


Fixed submission:
def main():
    n,x,y = map(int,input().split(' '))
    cost = [0 for i in range(n - 1)]
    for i in range(n - 1):
        for l in range(i + 1, n):
            result = min(abs(i - l),abs(i - x + 1) + 1 + abs(l - y + 1),abs(i - y + 1) + 1 + abs(l - x + 1))
            cost[result - 1] += 1
    for per in cost:
        print(per)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
num = input().split(' ')
num_data = [int(num[i]) for i in range(3)]
cost = [0 for i in range(num_data[0] - 1)]
for i in range(num_data[0] - 1):
    for l in range(i + 1, num_data[0]):
        result = min(abs(i - l),abs(i - num_data[1] + 1) + 1 + abs(l - num_data[2] + 1),abs(i - num_data[2] + 1) + 1 + abs(l - num_data[1] + 1))
        cost[result - 1] += 1
for per in cost:
    print(per)


Fixed submission:
def main():
    n,x,y = map(int,input().split(' '))
    cost = [0 for i in range(n - 1)]
    for i in range(n - 1):
        for l in range(i + 1, n):
            result = min(abs(i - l),abs(i - x + 1) + 1 + abs(l - y + 1),abs(i - y + 1) + 1 + abs(l - x + 1))
            cost[result - 1] += 1
    for per in cost:
        print(per)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
num = input().split(' ')
num_data = [int(num[i]) for i in range(3)]
#N X Y
cost = [0 for i in range(num_data[0] - 1)] #start position has the lowest number
for i in range(num_data[0] - 1):
    for l in range(num_data[0] - i - 1):
        result = min(abs(i - l - i - 1),abs(i - num_data[1] + 1) + 1 + abs(l + i + 1 - num_data[2] + 1),abs(i - num_data[2] + 1) + 1 + abs(l + i + 1 - num_data[1] + 1))
        cost[int(result) - 1] += 1
for per in cost:
    print(per)


Fixed submission:
def main():
    n,x,y = map(int,input().split(' '))
    cost = [0 for i in range(n - 1)]
    for i in range(n - 1):
        for l in range(i + 1, n):
            result = min(abs(i - l),abs(i - x + 1) + 1 + abs(l - y + 1),abs(i - y + 1) + 1 + abs(l - x + 1))
            cost[result - 1] += 1
    for per in cost:
        print(per)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
num = input().split(' ')
num_data = [int(num[i]) for i in range(3)]
#N X Y
cost = [0 for i in range(num_data[0] - 1)] #start position has the lowest number
for i in range(num_data[0]):
    for l in range(num_data[0]):
        if(l != i):
            result = min(abs(i - l),abs(i - num_data[1] + 1) + 1 + abs(l - num_data[2] + 1),abs(i - num_data[2] + 1) + 1 + abs(l - num_data[1] + 1))
            cost[int(result) - 1] += 1
for per in cost:
    print(int(per/2))


Fixed submission:
def main():
    n,x,y = map(int,input().split(' '))
    cost = [0 for i in range(n - 1)]
    for i in range(n - 1):
        for l in range(i + 1, n):
            result = min(abs(i - l),abs(i - x + 1) + 1 + abs(l - y + 1),abs(i - y + 1) + 1 + abs(l - x + 1))
            cost[result - 1] += 1
    for per in cost:
        print(per)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
num = input().split(' ')
num_data = [int(num[i]) for i in range(3)]
#N X Y
cost = [0 for i in range(num_data[0] - 1)] #start position has the lowest number
for i in range(num_data[0]):
    for l in range(num_data[0] - 1):
        result = min(abs(i - l),abs(i - num_data[1] - 1) + 1 + abs(l - num_data[2] - 1),abs(i - num_data[2] - 1) + 1 + abs(l - num_data[1] - 1))
        cost[num_data[0] - result] += 1
print(cost)


Fixed submission:
def main():
    n,x,y = map(int,input().split(' '))
    cost = [0 for i in range(n - 1)]
    for i in range(n - 1):
        for l in range(i + 1, n):
            result = min(abs(i - l),abs(i - x + 1) + 1 + abs(l - y + 1),abs(i - y + 1) + 1 + abs(l - x + 1))
            cost[result - 1] += 1
    for per in cost:
        print(per)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
num = input().split(' ')
num_data = [int(num[i]) for i in range(3)]
#N X Y
data = [[i - 1,i + 1] if 0 < i and i < num_data[0] - 1 else [i + 1] for i in range(num_data[0])]
data[num_data[1] - 1].append(num_data[2] - 1)
data[num_data[2] - 1].append(num_data[1] - 1)
data[num_data[0] - 1][0] = num_data[0] - 2
cost = [0 for i in range(num_data[0] - 1)] #start position has the lowest number

key = 0
number = 0
for i in range(num_data[0]):
    curent = i
    count = 1
    seen = [False for i in range(num_data[0])]
    seen[i] = True
    todo = [i]
    key = 0
    while(all(seen) == False):
        if(key == 0):
            key = len(todo) - 1
        else:
            key -= 1
        for per in data[curent]:
            if(seen[per]):
                pass
            else:
                seen[per] = True
                todo.append(per)
                cost[count - 1] += 1
        todo.pop(0)
        curent = todo[0]
        if(key == 0):
            count += 1

for per in cost:
    print(int(per/2))


Fixed submission:
def main():
    n,x,y = map(int,input().split(' '))
    cost = [0 for i in range(n - 1)]
    for i in range(n - 1):
        for l in range(i + 1, n):
            result = min(abs(i - l),abs(i - x + 1) + 1 + abs(l - y + 1),abs(i - y + 1) + 1 + abs(l - x + 1))
            cost[result - 1] += 1
    for per in cost:
        print(per)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import os
num = input().split(' ')
num_data = [int(num[i]) for i in range(3)]
#N X Y
data = [[i - 1,i + 1] if 0 < i and i < num_data[0] - 1 else [i + 1] for i in range(num_data[0])]
data[num_data[1] - 1].append(num_data[2] - 1)
data[num_data[2] - 1].append(num_data[1] - 1)
data[num_data[0] - 1][0] = num_data[0] - 2
cost = [0 for i in range(num_data[0] - 1)] #start position has the lowest number

key = 0
for i in range(num_data[0]):
    curent = i
    count = 1
    seen = [False for i in range(num_data[0])]
    seen[i] = True
    todo = [i]
    key = 0
    while(all(seen) == False):
        if(key == 0):
            key = len(todo) - 1
        else:
            key -= 1
        for per in data[curent]:
            if(seen[per]):
                pass
            else:
                seen[per] = True
                todo.append(per)
                cost[count - 1] += 1
        todo.pop(0)
        curent = todo[0]
        if(key == 0):
            count += 1

for per in cost:
    print(int(per/2))


Fixed submission:
def main():
    n,x,y = map(int,input().split(' '))
    cost = [0 for i in range(n - 1)]
    for i in range(n - 1):
        for l in range(i + 1, n):
            result = min(abs(i - l),abs(i - x + 1) + 1 + abs(l - y + 1),abs(i - y + 1) + 1 + abs(l - x + 1))
            cost[result - 1] += 1
    for per in cost:
        print(per)

if __name__ == '__main__':
    main()