Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N , M = (map(int , input().split()))
X = list(map(int , input().split()))
sorted_x = sorted(X)
ans= 0
total_kukann = 0
kukann_kyori = []
a = N-1
for i in range(len(sorted_x)-1):
    kukann_kyori.append(sorted_x[i + 1] - sorted_x[i])
    total_kukann += sorted_x[i + 1] - sorted_x[i]
kukann_kyori.sort()
for j in range(1,a+1):
    total_kukann -= kukann_kyori[-j]
if N >= M:
    total_kukann = 0
print(total_kukann)

Fixed submission:
N , M = (map(int , input().split()))
X = list(map(int , input().split()))
sorted_x = sorted(X)
total_kukann = 0
kukann_kyori = []
a = N-1
for i in range(len(sorted_x)-1):
    kukann_kyori.append(sorted_x[i + 1] - sorted_x[i])
    total_kukann += sorted_x[i + 1] - sorted_x[i]
kukann_kyori.sort()
if N >= M:
    total_kukann = 0
else:
    for j in range(1,a+1):
        total_kukann -= kukann_kyori[-j]
print(total_kukann)
Buggy python submission (verdict: Runtime Error):
N , M = (map(int , input().split()))
tree = []
for i in range(N):
    tree.append(int(input()))
sort_tree = sorted(tree)
print(min([sort_tree[N-M+i] - sort_tree[i] for i in range(N-M+1)]))

Fixed submission:
N , M = (map(int , input().split()))
tree = []
for i in range(N):
    tree.append(int(input()))
sort_tree = sorted(tree)
print(min([sort_tree[i+M-1] - sort_tree[i] for i in range(N-M+1)]))
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
N , X = (map(int , input().split()))
x = list(map(int , input().split()))
x.sort()
ans_list = [x[i+1] - x[i] for i in range(0,len(x)-1)]
if X == 1 or len(ans_list) == 1:
    ans = ans_list[0]
    print(ans)
elif len(ans_list) >= 2:
    gcd_list = [gcd(ans_list[i], ans_list[i+1]) for i in range(0,len(ans_list)-1)]
    ans = min(gcd_list)
    print(ans)
else:
    ans = gcd(ans_list[0] , ans_list[1])
    print(ans)

Fixed submission:
from fractions import gcd
N , X = (map(int , input().split()))
x = list(map(int , input().split()))
ans = 0
for i in x:
    ans = gcd(ans , abs(X-i))
print(ans)

Buggy python submission (verdict: Runtime Error):
N , X = (map(int , input().split()))
x = list(map(int , input().split()))
x.sort()
ans_list = [x[i+1] - x[i] for i in range(0,len(x)-1)]
if X == 1:
    print(x[0]-X)
else:
    from fractions import gcd
    print(gcd(ans_list[0], ans_list[1]))

Fixed submission:
from fractions import gcd
N , X = (map(int , input().split()))
x = list(map(int , input().split()))
ans = 0
for i in x:
    ans = gcd(ans , abs(X-i))
print(ans)
Buggy python submission (verdict: Runtime Error):
ans = 0
if int(str(S)[0]) == 1 and K == 1:
    ans = 1
elif int(str(S)[0]) != 1:
    ans = int(str(S)[0])
else:
    ans = int(str(S)[1])
print(ans)

Fixed submission:
S = int(input())
K = int(input())

for i in range(len(str(S))):
    if int(str(S)[i]) == 1:
        if (K-1) == i:
            print(int(str(S)[i]))
            break
        continue
    else:
        print(int(str(S)[i]))
        break
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import math



def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b = stdin.readline().rstrip().split()


print(lcm(int(a), int(b)))

Fixed submission:
from sys import stdin
import fractions





a,b = [int(x) for x in stdin.readline().rstrip().split()]

f=fractions.gcd(a,b)
f2=a*b//f
print(f2)
Buggy python submission (verdict: Runtime Error):
from sys import stdin


n = int(stdin.readline().rstrip())
arr = [int(x) for x in stdin.readline().rstrip().split()]

rslt = []
for i in range(1,n):
    cntr = 0
    ex = 0
    for s in arr:
        s = int(s)
        if ex != 0:
            ex = s
        if s != ex +1:
            cntr += 1
        ex = s
    rslt.append(cntr)


print(rslt)
print(min(rslt))





Fixed submission:
from sys import stdin


n = int(stdin.readline().rstrip())
arr = [int(x) for x in stdin.readline().rstrip().split()]

rslt = []

ex = 0
cntr = 1
bb = 0

for a,j in enumerate(arr):
    if j == cntr:
        cntr += 1
    else:
        bb += 1


if bb == n:
    print(-1)
else:
    print(bb)
Buggy python submission (verdict: Runtime Error):
a,b,c = stdin.readline().rstrip().split()
if a+b+c >= 22:
  print('bust')
else:
  print('win')

Fixed submission:
from sys import stdin
a, b, c = [int(x) for x in stdin.readline().rstrip().split()]
if a+b+c >= 22:
  print('bust')
else:
  print('win')

Buggy python submission (verdict: Runtime Error):
a,b,c = stdin.readline().rstrip().split()
if a+b+c >= 22:
	print('bust')
else:
	print('win')

Fixed submission:
from sys import stdin
a, b, c = [int(x) for x in stdin.readline().rstrip().split()]
if a+b+c >= 22:
  print('bust')
else:
  print('win')
Buggy python submission (verdict: Runtime Error):
from sys import stdin

a,b = int(stdin.readline().rstrip().split())

if 1 <= a,b <= 10:
    print(a*b)
else:
    print(-1)

Fixed submission:
from sys import stdin

a,b = [int(x) for x in stdin.readline().rstrip().split()]

if 1 <= a <= 9 and 1 <= b <= 9:
    print(a*b)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

a,b=  stdin.readline().rstrip().split()

count = 0
for i,j in zip(a,b):
    if i ==j:
        count += 1



print(count)

Fixed submission:
from sys import stdin

a=  stdin.readline().rstrip()
b=  stdin.readline().rstrip()

count = 0
for i,j in zip(a,b):
    if i ==j:
        count += 1



print(count)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

a,b = [int(x) for x in stdin.readline().rstrip().split()]

arr =[]

arr.append(a+b)
arr.append(a-b)
arr.append(a*b)

print(arr.max())

Fixed submission:
from sys import stdin
 
a,b = [int(x) for x in stdin.readline().rstrip().split()]
 
arr =[]
 
arr.append(a+b)
arr.append(a-b)
arr.append(a*b)
 
print(max(arr))
Buggy python submission (verdict: Runtime Error):
 from sys import stdin

a,b,c = [int(x) for x in stdin.readline().rstrip().split()]

print(b+c-a)

Fixed submission:
from sys import stdin

a,b,c = [int(x) for x in stdin.readline().rstrip().split()]

if b+c-a>0:
    print(b+c-a)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
from sys import stdin




def gcd(n,m):
    if n<m:
        return gcd(m,n)
    if n%m==0:
        return m
    else:
        return gcd(m,n%m)



a,b,c,d = [int(x) for x in stdin.readline().rstrip().split()]

c_num = b//c-(a-1)//c
d_num = b//d-(a-1)//d

LCM = d*c//gcd(c,d)

LCM_num = int(b//(LCM)-(a-1)//(LCM))

ans = b-a+1
ans -= c_num
ans -= d_num
ans += LCM_num
print(ans)




Fixed submission:
from sys import stdin

n = stdin.readline().rstrip()
ex_str = n[0]
for i,a_str in enumerate(str(n)):

    
    if(i>0 and ex_str==a_str):
        print("Bad")
        break
    elif(ex_str!=a_str and i == len(n)-1):
        print("Good")
    ex_str = a_str
Buggy python submission (verdict: Runtime Error):

from sys import stdin

str = stdin.readline().rstrip()


cnt = 0
rslt = 0




for a in str:
    flg = 0
    for b in "ATGC":
        if a == b:
            cnt = cnt + 1
            flg = 1
            break
            
    print(a + " :" + str(cnt))
    
    if rslt <= cnt:
        rslt = cnt
        
    if flg == 0:
        cnt = 0


print(rslt)
    
            



Fixed submission:
from sys import stdin

str = stdin.readline().rstrip()


cnt = 0
rslt = 0




for a in str:
    flg = 0
    for b in "ATGC":
        if a == b:
            cnt = cnt + 1
            flg = 1
            break
            
    
    if rslt <= cnt:
        rslt = cnt
        
    if flg == 0:
        cnt = 0


print(rslt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
x = 0
m = A[0]

for x in range(1, N):
    m *= A[x]
if m > 10**18:
    m = -1
print(m)

Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if 0 in A:
        print(0)
        return

    m = 1
    for x in A:
        m *= x
        if m > 10**18:
            print(-1)
            return
    print(m)
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
x = 0
m = A[0]
for x in range(1, N):
    m *= A[x]

if m <= pow(10, 18):
    print(m)
else:
    print(-1)


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if 0 in A:
        print(0)
        return

    m = 1
    for x in A:
        m *= x
        if m > 10**18:
            print(-1)
            return
    print(m)
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
x = 0
m = A[0]
for x in range(1, N):
    m *= A[x]

if m > 10**18:
    print(-1)
else:
    print(m)

Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if 0 in A:
        print(0)
        return

    m = 1
    for x in A:
        m *= x
        if m > 10**18:
            print(-1)
            return
    print(m)
main()
Buggy python submission (verdict: Time Limit Exceeded):
import functools
import operator

n = int(input())
a = [int(i) for i in input().split(' ')]
if a[0] == 0:
    print(0)
else:
    x = functools.reduce(operator.mul, a)
    if x > 10**18:
        print(-1)
    else:
        print(x)


Fixed submission:
n = int(input())
a = [int(i) for i in input().split(' ')]
a = sorted(a)
if a[0] == 0:
    print(0)
else:
    x = 1
    for i in a:
        x = x * i
        if x > 10**18:
            print(-1)
            break
    else:
        print(x)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split(' ')]
if a[0] == 0:
    print(0)
else:
    x = 1
    for i in a:
        x = x * i
    if x > 10**18:
        print(-1)
    else:
        print(x)


Fixed submission:
n = int(input())
a = [int(i) for i in input().split(' ')]
a = sorted(a)
if a[0] == 0:
    print(0)
else:
    x = 1
    for i in a:
        x = x * i
        if x > 10**18:
            print(-1)
            break
    else:
        print(x)
Buggy python submission (verdict: Time Limit Exceeded):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b, a%b)

N = getInput()[0]
sums = 0
for i in range(1, N+1):
    for j in range(1, N+1):
        if i == j:
            n = i
        else:
            n = gcd(max(i, j), min(i,j))

        for k in range(1, N+1):
            if n == k:
                sums += n
            elif n == 1 or k == 1:
                sums += 1
            else:
                sums += gcd(max(n, k), min(n, k))

print(sums)


Fixed submission:
import math
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]


N = getInput()[0]
sums = 0
for i in range(1, N+1):
    for j in range(1, N+1):
        n = math.gcd(i, j)
        for k in range(1, N+1):
            sums += math.gcd(n, k)

print(sums)

Buggy python submission (verdict: Time Limit Exceeded):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b, a%b)

N = getInput()[0]
sums = 0
for i in range(1, N+1):
    for j in range(1, N+1):
        n = gcd(max(i, j), min(i,j))
        for k in range(1, N+1):
            sums += gcd(max(n, k), min(n, k))

print(sums)

Fixed submission:
import math
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]


N = getInput()[0]
sums = 0
for i in range(1, N+1):
    for j in range(1, N+1):
        n = math.gcd(i, j)
        for k in range(1, N+1):
            sums += math.gcd(n, k)

print(sums)
Buggy python submission (verdict: Runtime Error):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]
N, M = getInput()
A = getInput()
_4M = math.ceil(sum(A) / (4*M))
A.sort(reverse=True)
cnt = 0
for i in A:
    if i >= _4M:
        cnt += 1
print('Yes') if cnt >= M else print('No')

Fixed submission:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]
N, M = getInput()
A = getInput()
_4M = sum(A) / (4*M)
A.sort(reverse=True)
cnt = 0
for i in A:
    if i >= _4M:
        cnt += 1
print('Yes') if cnt >= M else print('No')
Buggy python submission (verdict: Runtime Error):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

def swap(x, K):
    return abs(x-K)

def loops (x, K, mins):
    if x < K:
        ab = swap(x, K)
        return min(ab, x)
    elif x % K == 0:
        return 0
    else:
        x = swap(x, K)
        if x == 0:
            return x
        if x < mins:
            mins = x
            x = loops(x, K, mins)
            return x
        else:
            return mins

N, K = getInput()
x = N
print(loops(x, K, x))


Fixed submission:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N, K = getInput()
t = N % K 
print(min(t, K -t))

Buggy python submission (verdict: Runtime Error):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

def swap(x, K):
    return abs(x-K)

def loops (x, K, mins):
    if x < K:
        ab = swap(x, K)
        return min(ab, x)
    elif x % K == 0:
        return 0
    else:
        x = swap(x, K)
        if x < mins:
            mins = x
            x = loops(x, K, mins)
            return x
        else:
            return mins

N, K = getInput()
x = N
print(loops(x, K, x))


Fixed submission:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N, K = getInput()
t = N % K 
print(min(t, K -t))

Buggy python submission (verdict: Runtime Error):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

def swap(x, K):
    return abs(x-K)

def loops (x, K):
    if x < K:
        ab = swap(x, K)
        return min(ab, x)
    elif x % K == 0:
        return 0
    else:
        x = swap(x, K)
        x = loops(x, K)
        return x

N, K = getInput()
x = N
print(loops(x, K))


Fixed submission:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N, K = getInput()
t = N % K 
print(min(t, K -t))

Buggy python submission (verdict: Time Limit Exceeded):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

def swap(x, K):
    return abs(x-K)

N, K = getInput()
x = N
mins = x

while(mins > 0):
    if K == 1:
        mins = 0
    x = swap(x, K)
    if  x < mins:
        mins = x
    else:
        break

print(mins)

Fixed submission:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N, K = getInput()
t = N % K 
print(min(t, K -t))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(i) for i in input().rstrip().split(' ')]
H = [int(i) for i in input().rstrip().split(' ')]
H.sort(reverse=True)
if len(H) <= K:print(0)
else:
    for hit in range(K):
        if len(H) == 0: break
        H.pop(0)
    print(sum(H))


Fixed submission:
N, K = [int(i) for i in input().rstrip().split(' ')]
H = [int(i) for i in input().rstrip().split(' ')]
H.sort(reverse=True)
if len(H) <= K:print(0)
else:
    lst = [h for k, h in enumerate(H) if k >= K]
    print(sum(lst))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(i) for i in input().rstrip().split(' ')]
H = [int(i) for i in input().rstrip().split(' ')]
H.sort(reverse=True)
for hit in range(K):
    if H: H.pop(0)
print(sum(H))


Fixed submission:
N, K = [int(i) for i in input().rstrip().split(' ')]
H = [int(i) for i in input().rstrip().split(' ')]
H.sort(reverse=True)
if len(H) <= K:print(0)
else:
    lst = [h for k, h in enumerate(H) if k >= K]
    print(sum(lst))
Buggy python submission (verdict: Runtime Error):
def calc(c, cnt):
    r = [i % 2 for i in c]
    if sum(r) > 0:
        print(cnt)
        return 1
    else:
        for k, num in enumerate(c):
            c[k] = num / 2
        cnt += 1
        if calc(c, cnt) == 1:
            return 1
        

N = int(input())
c = [int(i) for i in input().rstrip().split(' ')]
calc(c, 0)

Fixed submission:
arr = [int(i) for i in list(input())]
print(sum(arr))
Buggy python submission (verdict: Runtime Error):
int = int(input())
print(a*a*a+a*a+a)

Fixed submission:
i = int(input())
print(i*i*i+i*i+i)
Buggy python submission (verdict: Runtime Error):
i = list(map(int, input().split()))
s = list(map(int, input().split()))

out=0
s = sorted(s)
for i in range(3):
  out+=s[i]
print(out)

Fixed submission:
i = list(map(int, input().split()))
s = list(map(int, input().split()))

out=0
s = sorted(s)
for i in range(i[1]):
  out+=s[i]
print(out)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= A[i]

if ans > pow(10, 18):
    ans = -1

print(ans)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
if 0 in A:
    print(0)
    exit()

ans = 1
lim = pow(10, 18)
for a in A:
    ans *= a
    if ans > lim:
        ans = -1
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = 0

for i in range(n):
    si = s[i]
    for j in range(i+1, n):
        sj = s[j]
        if si == sj:
            continue
        else:
            dif = j - i
            for k in range(j+1, n):
                sk = s[k]
                if dif != k - j and sj != sk and sk != si:
                    ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()

ans = s.count('R') *  s.count('G') *  s.count('B')

for i in range(n):
    for j in range(i+1, n):
        k = 2 * j - i

        if k >= n:
            break
        elif s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
         
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = 0

for i in range(n):
    si = s[i]
    for j in range(i+1, n):
        sj = s[j]
        if si == sj:
            continue
        else:
            for k in range(j+1, n):
                sk = s[k]
                if j - i != k - j and sj != sk and sk != si:
                    ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()

ans = s.count('R') *  s.count('G') *  s.count('B')

for i in range(n):
    for j in range(i+1, n):
        k = 2 * j - i

        if k >= n:
            break
        elif s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
         
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = 0

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if j - i != k - j and s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
                ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()

ans = s.count('R') *  s.count('G') *  s.count('B')

for i in range(n):
    for j in range(i+1, n):
        k = 2 * j - i

        if k >= n:
            break
        elif s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
         
print(ans)
Buggy python submission (verdict: Runtime Error):
K = int(input())

queue = list(range(1, 10))

if K < 10:
    print(K)
else:
    i = 0
    while K > len(queue):
        if queue[i] % 10 != 0:
            l = 10 * queue[i] + queue[i] % 10 - 1
            queue.append(l)
        
        l = 10 * queue[i] + queue[i] % 10
        queue.append(l)
        
        if queue[i] % 10 != 9:
            l = 10 * queue[i] + queue[i] % 10 + 1
            queue.append(l)
        
        i += 1

    print(queue[K])

Fixed submission:
K = int(input())

queue = list(range(1, 10))

if K < 10:
    print(K)
else:
    i = 0
    while K > len(queue):
        if queue[i] % 10 != 0:
            l = 10 * queue[i] + queue[i] % 10 - 1
            queue.append(l)
        
        l = 10 * queue[i] + queue[i] % 10
        queue.append(l)
        
        if queue[i] % 10 != 9:
            l = 10 * queue[i] + queue[i] % 10 + 1
            queue.append(l)
        
        i += 1

    print(queue[K - 1])

Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

if K < 10:
    print(K)
else:
    count = 0
    num = 1
    runrun = list(range(1, 10))
    while count != K:
        s = str(num)
        judge = 0
        for i in range(1, len(s)):
            if abs(int(s[i - 1]) - int(s[i])) <= 1:
                judge += 1
            else:
                break
        
        if judge == len(s) - 1:
            runrun.append(num)
            count += 1
            

        num += 1
    print(num - 1)

Fixed submission:
K = int(input())

queue = list(range(1, 10))

if K < 10:
    print(K)
else:
    i = 0
    while K > len(queue):
        if queue[i] % 10 != 0:
            l = 10 * queue[i] + queue[i] % 10 - 1
            queue.append(l)
        
        l = 10 * queue[i] + queue[i] % 10
        queue.append(l)
        
        if queue[i] % 10 != 9:
            l = 10 * queue[i] + queue[i] % 10 + 1
            queue.append(l)
        
        i += 1

    print(queue[K - 1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = []
for k in range(n, 1, -1):
    N = n
    while N >= k:
        if N % k == 1 or N / k == 1 or N - (N % k) == 1:
            a.append(k)
            break
        elif N % k == 0:
            N = N / k
        else:
            break

# print(a)
print(len(a))

Fixed submission:
n = int(input())
a = [n]
if n != 2:
    a.append(n - 1)

def div_(N, k):
    while N % k == 0:
        N /= k
    if N % k == 1:
        a.append(k)

for k in range(2, int(n ** 0.5) + 1):
    if n % k == 0:
        div_(n,k)
        if k != n / k:
            div_(n, n // k)

    if (n - 1) % k == 0:
        a.append(k)
        if k != (n - 1) / k:
            a.append((n - 1) // k)

print(len(a))
Buggy python submission (verdict: Time Limit Exceeded):
n, x, y = map(int, input().split())

dis_list = [0] * (n - 1)

for i in range(n - 1):
    for j in range(i + 1, n):
        dis_list[min(abs(j - i), abs(x - i - 1) + 1 + abs(y - j - 1), abs(y - i - 1) + 1 + abs(x - j - 1)) - 1] += 1

for i in dis_list:
    print(i)

Fixed submission:
n, x, y = map(int, input().split())

dis_list = [0] * (n - 1)

for i in range(1, n):
    for j in range(i + 1, n + 1):
        dis_list[min(abs(j - i), abs(x - i) + 1 + abs(y - j), abs(y - i) + 1 + abs(x - j)) - 1] += 1

for i in dis_list:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n, x, y = map(int, input().split())

dis_list = [0] * (n - 1)

for i in range(0, n):
    for j in range(i + 1, n):
        dis = min(abs(j - i), abs(x - i - 1) + 1 + abs(y - j - 1), abs(y - i - 1) + 1 + abs(x - j - 1))
        # print(dis)
        dis_list[dis - 1] += 1

for i in range(n - 1):
    print(dis_list[i])

Fixed submission:
n, x, y = map(int, input().split())

dis_list = [0] * (n - 1)

for i in range(1, n):
    for j in range(i + 1, n + 1):
        dis_list[min(abs(j - i), abs(x - i) + 1 + abs(y - j), abs(y - i) + 1 + abs(x - j)) - 1] += 1

for i in dis_list:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n, x, y = map(int, input().split())

node = list(range(1, n + 1))

dis_list = []

for i in node:
    for j in node:
        if j != i:
            dis = min(abs(j - i), abs(x - i) + 1 + abs(y - j), abs(y - i) + 1 + abs(x - j))
            dis_list.append(dis)

for dis in range(1, n):
    print(len([i for i in dis_list if i == dis]) // 2)

Fixed submission:
n, x, y = map(int, input().split())

dis_list = [0] * (n - 1)

for i in range(1, n):
    for j in range(i + 1, n + 1):
        dis_list[min(abs(j - i), abs(x - i) + 1 + abs(y - j), abs(y - i) + 1 + abs(x - j)) - 1] += 1

for i in dis_list:
    print(i)