Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, m = [ int(v) for v in input().split() ]
connect_list = [ [] for i in range(n) ]
for i in range(m):
    a, b = [ int(v)-1 for v in input().split() ]
    connect_list[a].append(b)
    connect_list[b].append(a)


def dfs(a):
    color = [ 0 for i in range(n) ]
    color[a] = 1
    stack = collections.deque([a])
    r = 0

    while stack:
        s = stack.pop()
        color[s] = 2
        r += 1
        for i in connect_list[s]:
            if color[i] == 0:
                color[i] = 1
                stack.append(i)
    return r

x, y = dfs(0), dfs(1)
x, y = max(x, y), min(x, y)

def part_edge(a):
    return a*(a-1)//2

x = n - y
total_edge = part_edge(x) + part_edge(y)
print(total_edge-m)


Fixed submission:
import collections

n, m = [ int(v) for v in input().split() ]
connect_list = [ [] for i in range(n) ]
for i in range(m):
    a, b = [ int(v)-1 for v in input().split() ]
    connect_list[a].append(b)
    connect_list[b].append(a)


def dfs(a):
    color = [ 0 for i in range(n) ]
    color[a] = 1
    stack = collections.deque([a])
    r = 0

    while stack:
        s = stack.pop()
        color[s] = 2
        r += 1
        for i in connect_list[s]:
            if color[i] == 0:
                color[i] = 1
                stack.append(i)
    return r

x, y = dfs(0), dfs(1)
x, y = max(x, y), min(x, y)

def part_edge(a):
    return a*(a-1)//2

x = n - y
total_edge = part_edge(x) + part_edge(y)
print(total_edge-m)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a_list = sorted([ int(v) for v in input().split() ])
b_list = sorted([ int(v) for v in input().split() ])
c_list = sorted([ int(v) for v in input().split() ])

ans = 0
for i in a_list:
    p = bisect.bisect_left(b_list,i+1)
    for j in b_list[p:]:
        q = bisect.bisect_left(c_list,j+1)
        ans += n - q
print(ans)


Fixed submission:

import bisect



def cumsum(inlist):
    s = 0
    outlist = []
    for i in inlist:
        s += i
        outlist.append(s)
    return outlist

n = int(input())
a_list = sorted([ int(v) for v in input().split() ])
b_list = sorted([ int(v) for v in input().split() ])
c_list = sorted([ int(v) for v in input().split() ])
a_b_list = [ bisect.bisect_right(a_list,i-1) for i in b_list]
b_c_list = [ bisect.bisect_right(b_list,i-1) for i in c_list]
a_b_cumsum_list = cumsum(a_b_list)
a_b_c_list = [ a_b_cumsum_list[i-1] for i in b_c_list if i != 0]
print(sum(a_b_c_list))
Buggy python submission (verdict: Runtime Error):
s = input()
ans = "No"
for i in range(len(s)-1):
  if s[i] == "A" and s[i+1] == "C":
    ans = "Yes"
 	break
print(ans)

Fixed submission:
    
s = input()
ans = "No"
for i in range(len(s)-1):
  if s[i] == "A" and s[i+1] == "C":
    ans = "Yes"
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
num_list = [ int(v) for v in input().split() ]

ans_list = [ 0 for i in range(n+2) ]

for i in num_list:
    ans_list[i] += 1
    ans_list[i+1] += 1
    ans_list[i+2] += 1

print(max(ans_list))

Fixed submission:

n = int(input())
num_list = [ int(v) for v in input().split() ]

ans_list = [ 0 for i in range(10**5+2) ]

for i in num_list:
    ans_list[i] += 1
    ans_list[i+1] += 1
    ans_list[i+2] += 1

print(max(ans_list))
Buggy python submission (verdict: Runtime Error):

s = sorted(list(set(input()))) + ["A"] *26
t = "abcdefghijklmnopqrstuvwxyz"

ans = "None"
for i in range(len(s)):
	if s[i] != t[i]:
		ans = (t[i])
		break
print(ans) 

Fixed submission:
s = sorted(list(set(input()))) + ["A"] *26
t = "abcdefghijklmnopqrstuvwxyz"

ans = "None"
for i in range(len(t)):
	if s[i] != t[i]:
		ans = (t[i])
		break
print(ans)

Buggy python submission (verdict: Runtime Error):

s = list(set(input()))
t = "abcdefghijklmnopqrstuvwxyz"

ans = -1
for i in len(s):
	if s[i] != t[i]:
		ans = (s[i])
		break
print(ans) 


Fixed submission:
s = sorted(list(set(input()))) + ["A"] *26
t = "abcdefghijklmnopqrstuvwxyz"

ans = "None"
for i in range(len(t)):
	if s[i] != t[i]:
		ans = (t[i])
		break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

import sys
input = sys.stdin.readline
n = input()
ans = 0
num_list = [ int(v) for v in input().split() ]
count_list = [ [num_list.count(i),i] for i in sorted(set(num_list),reverse = True)]

a, b = -1, -1
for i in count_list:
	if i[0] >= 4 and a == -1:
		ans = i[1]**2
		break
	elif i[0] >= 2:
		if a == -1:
			a = i[1]
		else:
			b = i[1]
			ans = a*b
			break

print(ans)

Fixed submission:
n = int(input())
ans = 0
num_list = sorted([ int(v) for v in input().split() ],reverse = True)

a, b = -1, -1
d = 0

for i in range(n-1):
	if num_list[i] != num_list[i+1]:
		d = 0
	else:
		if a != -1 and d == 0:
			b = num_list[i]
			ans = a*b
			break
		else:
			d += 1
			a = num_list[i]
			if d == 3:
				ans = a**2
				break

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()

print(s[0]+ str(len(s-2)) +s[-1])

Fixed submission:
s = input()

print(s[0]+ str(len(s)-2) +s[-1])
Buggy python submission (verdict: Runtime Error):
a, b = [ int(input()) for i in input().split() ]
ans = "Impossible"
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
  ans = "Possible"
print(ans)

Fixed submission:
a, b = [ int(v) for v in input().split() ]
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
  print("Possible")
else:
  print("Impossible")

Buggy python submission (verdict: Runtime Error):
a, b = [ int(input()) for i in input().split() ]
ans = "Impossible"
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
  ans = "Possible"
print(ans)

Fixed submission:
a, b = [ int(v) for v in input().split() ]
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
  print("Possible")
else:
  print("Impossible")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num_list = [ v for v in input().split() ]

b_list = []

for i in num_list:
	b_list.append(i)
	b_list.reverse()
print(" ".join(b_list))

Fixed submission:
n = int(input())
num_list = [ v for v in input().split() ]

if n % 2 == 0:
	print(" ".join(num_list[::-2]+num_list[::2]))
else:
	print(" ".join(num_list[::-2]+num_list[1::2]))
Buggy python submission (verdict: Runtime Error):

import bisect
n, k =  [ int(v) for v in input().split() ]
num_list = sorted([ tuple(map(int, input().split())) for i in range(n) ])
order_list, value_list = [ 0 for i in range(n) ], [ 0 for i in range(n) ]
for i in range(n):
	order_list[i] = num_list[i][1] + order_list[i-1]
	value_list[i] = num_list[i][0]


print(value_list[bisect.bisect(order_list,k)])

Fixed submission:
n, k =  [ int(v) for v in input().split() ]
num_list = sorted([ tuple(map(int, input().split())) for i in range(n) ])
order_list, value_list = [ 0 for i in range(n) ], [ 0 for i in range(n) ]
for i in range(n):
	order_list[i] = num_list[i][1] + order_list[i-1]
	value_list[i] = num_list[i][0]


for i in range(n):
	if order_list[i] - k >= 0:
		print(value_list[i])
		break
Buggy python submission (verdict: Runtime Error):


a, b, c = [ int(v) for v in input().split() ]

if all([a==b,b==c]):
    print(-1)

else:
    t = 0
    while:
        a, b, c = map( int,[ b/2+c/2, c/2+a/2, a/2+b/2 ] )
        t += 1

        if not all([a%2==0,b%2==0,c%2==0]):
            print(t)
            break
        if all([a==b,b==c]):
            print(-1)
            break
        

Fixed submission:
a, b, c = [ int(v) for v in input().split() ]
t = 0

if not all([a%2==0,b%2==0,c%2==0]):
    print(t)
elif all([a==b,b==c]):
    print(-1)


else:
    while True:
        a, b, c = map( int,[ b/2+c/2, c/2+a/2, a/2+b/2 ] )
        t += 1

        if not all([a%2==0,b%2==0,c%2==0]):
            print(t)
            break
        elif all([a==b,b==c]):
            print(-1)
            break
Buggy python submission (verdict: Runtime Error):
ans = 0
a, b, c = [ int(v) for v in input().split() ]
for i in range(1,b+1):
    if (a * i) % b == c:
        ans = 1
        break
if ans == 1:
    print("YES")
else:

Fixed submission:
ans = 0
a, b, c = [ int(v) for v in input().split() ]
for i in range(1,b+1):
    if (a * i) % b == c:
        ans = 1
        break
if ans == 1:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

ans = "EQUAL"
la, lb = len(a), len(b)
if la < lb:
  ans = "LESS"
elif la > lb:
  ans = "GREATER"
else:
  for i in range(n):
    if a[i] < b[i]:
      ans = "LESS"
      break
  	elif a[i] > b[i]:
      ans = "GREATER"
      break
print(ans)

Fixed submission:

a = input()
b = input()
	
ans = "EQUAL"
la, lb = len(a), len(b)
if la < lb:
	ans = "LESS"
elif la > lb:
	ans = "GREATER"
else:
	for i in range(la):
		if a[i] < b[i]:
			ans = "LESS"
			break
		elif a[i] > b[i]:
			ans = "GREATER"
			break
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
num_list = [ int(v) for v in input().split() ]
mode = 1
ans = 0
for i in range(n-1):
  if mode == 1 and num_list[i+1] < num_list[i]:
  	mode = -1
    ans += 1
  elif mode == -1 and num_list[i+1] > num_list[i]:
  	mode = 1
    ans += 1
  
  
print(ans+1)

Fixed submission:
n = int(input())
num_list = [ int(v) for v in input().split() ]
cut_list = []
status = 0
for i in range(n-1):
    if status == 0:
        if num_list[i+1] > num_list[i]:
            status = 1
        elif num_list[i+1] < num_list[i]:
            status = -1
    elif status == 1:
        if num_list[i+1] < num_list[i]:
            cut_list.append(i)
            status = 0
    elif status == -1:
        if num_list[i+1] > num_list[i]:
            cut_list.append(i)
            status = 0

print(len(cut_list)+1)
Buggy python submission (verdict: Runtime Error):
a, b, c =  [ int(v) for v in input().split() ]

if (a-b) == (b-c):
  print("YES")
else:
  print("NO)

Fixed submission:
a, b, c =  [ int(v) for v in input().split() ]

if (a-b) == (b-c):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
print((int(input())+int(input()))%24)

Fixed submission:
a, b = [ int(v) for v in input().split() ]
print((a+b)%24)
Buggy python submission (verdict: Runtime Error):
if [input(),input()].count("H") == 1:
	print("D")
else:
	print("H")

Fixed submission:
if [ v for v in input().split() ].count("H") == 1:
	print("D")
else:
	print("H")

Buggy python submission (verdict: Runtime Error):
if [input(),input()].count("H") == 1:
  print("D")
else:
  print("H")

Fixed submission:
if [ v for v in input().split() ].count("H") == 1:
	print("D")
else:
	print("H")
Buggy python submission (verdict: Runtime Error):
def next_to_you(t,a):
	if a == "o":
		if t[-1] == "S":
			if  t[-2] == "W":
				return "W"
			elif t[-2] == "S":
				return "S"
		elif t[-1] == "W":
			if  t[-2] == "W":
				return "S"
			elif t[-2] == "S":
				return "W"
	elif a == "x":
		if t[-1] == "S":
			if  t[-2] == "W":
				return "S"
			elif t[-2] == "S":
				return "W"
		elif t[-1] == "W":
			if  t[-2] == "W":
				return "W"
			elif t[-2] == "S":
				return "S"



n = int(input())
s = input()
t1, t2, t3, t4 = "SS", "SW", "WS", "WW"

for i in range(1,n):
	t1 += next_to_you(t1,s[i])
	t2 += next_to_you(t2,s[i])
	t3 += next_to_you(t3,s[i])
	t4 += next_to_you(t4,s[i])

ans = -1
for i in [t1,t2,t3,t4]:
	if i[0] == i[-1]:
		ans = i[:n]
		break
print(ans)

Fixed submission:
n = int(input())
x = 800 * n
y = 200 * (n // 15)
print(x-y)
Buggy python submission (verdict: Runtime Error):
n = int(input())

power = 1
mod = 10**9+7

for i in range(n):
  p = (p * (i+1)) % mod
print(p)

Fixed submission:
n = int(input())

power = 1
mod = 10**9+7

for i in range(n):
  power = (power * (i+1)) % mod
print(power)
Buggy python submission (verdict: Runtime Error):
strength = [ str(i) for i in range(2,14) ] + ["1"]
a , b = [ v for v in input().split() ]
if a.index(strength) > b.index(strength):
  print("Alice")
elif a.index(strength) == b.index(strength):
  print("Draw")
else:
  print("Bob")

Fixed submission:
strength = [ str(i) for i in range(2,14) ] + ["1"]
a , b = [ v for v in input().split() ]
if strength.index(a) > strength.index(b):
  print("Alice")
elif strength.index(a) == strength.index(b):
  print("Draw")
else:
  print("Bob")
Buggy python submission (verdict: Runtime Error):
s = input()

for i in range(n):
  if s[i] == "A":
    l = i
    break
for i in range(n-1,-1,-1):
  if s[i] == "Z":
    r = i
    break
print(s[l:r+1])

Fixed submission:
s = input()
n = len(s)
for i in range(n):
	if s[i] == "A":
		l = i
		break
for i in range(n-1,-1,-1):
	if s[i] == "Z":
		r = i
		break
print(r-l+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())

a = n // 11 *2
b = n % 11
if c > 0:
	c = 1
elif b >= 7:
	c = 2
print(a+c)

Fixed submission:
n = int(input())

a = (n // 11) *2

b = n % 11

c = 0
if 7 > b > 0:
	c = 1
elif b >= 7:
	c = 2
print(a+c)
Buggy python submission (verdict: Runtime Error):
n, k = [ int(v) for v in input().split() ]
num = [ int(v) for v in input().split() ]
num_2 = [ max(i,0) for i in num ] 


cum_num, cum_num_2 = [0] + cumsum(num), [0] + cumsum(num_2)

ans = 0
for i in range(n-k+1):
    ansl = cum_num_2[i]
    ansm = cum_num[k+i] - cum_num[i]
    ansr = cum_num_2[n] - cum_num_2[i+k]
    ans = max(ansl+max(ansm,0)+ansr, ans)
print(ans)

Fixed submission:
def cumsum(inlist):
    s = 0
    outlist = []
    for i in inlist:
        s += i
        outlist.append(s)
    return outlist


n, k = [ int(v) for v in input().split() ]
num = [ int(v) for v in input().split() ]
num_2 = [ max(i,0) for i in num ] 


cum_num, cum_num_2 = [0] + cumsum(num), [0] + cumsum(num_2)

ans = 0
for i in range(n-k+1):
    ansl = cum_num_2[i]
    ansm = cum_num[k+i] - cum_num[i]
    ansr = cum_num_2[n] - cum_num_2[i+k]
    ans = max(ansl+max(ansm,0)+ansr, ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(inout())
time_list = [ int(v) for v in input().split() ]
total_time = sum(time_list)
m = int(input())

for i in range(m):
  p, t = [ int(v) for v in input().split() ]
  print(total_time - time_list[p-1] + t)

Fixed submission:
n = int(input())
time_list = [ int(v) for v in input().split() ]
total_time = sum(time_list)
m = int(input())

for i in range(m):
	p, t = [ int(v) for v in input().split() ]
	print(total_time - time_list[p-1] + t)
Buggy python submission (verdict: Runtime Error):
h, w = [ int(v) for v in input().split() ]

for i in range(k):
  s = input()
  print(s)
  print(s)

Fixed submission:
h, w = [ int(v) for v in input().split() ]

for i in range(h):
  s = input()
  print(s)
  print(s)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
stop = 0
while stop == 0:
    ls = list(s)
    for i in range(len(ls)-1):
        if ls[i] == "S" and ls[i+1] == "T":
            ls[i], ls[i+1] = "", ""
    new_s = "".join(ls)
    if s == new_s:
        stop = 1
    else:
        s = new_s 
print(len(s))

Fixed submission:
s = input()

del_list = [] 
l = 0
pointer = 0
for i,v in enumerate(s):
    if v == "S":
        del_list.append([i,-1])
        l += 1
    else:
        if l != 0 and pointer != l:
            del_list[pointer][1]  = i
            pointer += 1


rems = 0
delpair = 0
for i in del_list:
    if i[1] == -1:
        rems += 1
    else:
        delpair += 1

remt = s.count("T") - delpair
print(remt+rems)
Buggy python submission (verdict: Runtime Error):
n, a = [ int(v) for v in input().split() ]
num_list = [ int(v) for v in input().split() ]
max_num = max(num_list)
field = [ [ 0 for i in range(max_num*n+1) ] for i in range(n+1) ]
field[0][0] = 1

b = num_list[0]
for i in num_list:
    for j in range(n,0,-1):
        for k in range(max_num*n+1):
            if k >= i:
                field[j][k] += field[j-1][k-i]



ans = 0
for i in range(1,n+1):
    ans += field[i][a*i]
print(ans)


Fixed submission:

n, a = [ int(v) for v in input().split() ]
num_list = [ int(v) for v in input().split() ]
max_num = max(num_list)
field = [ [ 0 for i in range(5000) ] for i in range(n+1) ]
field[0][0] = 1

b = num_list[0]
for i in num_list:
    for j in range(n,0,-1):
        for k in range(5000):
            if k >= i:
                field[j][k] += field[j-1][k-i]



ans = 0
for i in range(1,n+1):
    ans += field[i][a*i]
print(ans)
Buggy python submission (verdict: Runtime Error):
n, l = [ v for v in input().split() ]
string_list = sorted([ input() for v in range(n) ])
print("".join(string_list))

Fixed submission:
n, l = [ int(v) for v in input().split() ]
string_list = sorted([ input() for v in range(n) ])
print("".join(string_list))
Buggy python submission (verdict: Runtime Error):

n, m = [ int(v) for v in input().split() ]
num_list = [ v for v in input().split() ]
t = n
while:
	if all([ ( v not in num_list ) for v in list(str(i))]):
		print(i)
		break
	t += 1

Fixed submission:

n, m = [ int(v) for v in input().split() ]
num_list = [ v for v in input().split() ]
t = n
while True:
	if all([ ( v not in num_list ) for v in list(str(t))]):
		print(t)
		break
	t += 1
Buggy python submission (verdict: Runtime Error):
s = input()

def digitsum(n):
    for i in n:
        ni = int(i)
        res += ni
    return res 

res = digitsum(s)
if res % 9 == 0:
    print("Yes")
else:
    print("No")


Fixed submission:
def digitsum(n):
    res = 0
    for i in n:
        #print(ni)
        ni = int(i)
        res += ni
    return res 

s = input()
r = digitsum(s)

if r % 9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())

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



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

if a < 10 and b < 10:
    print(a * b)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
N = int(input())
A = list(map(int, input().split()))

pairwise = True
setwise = False


seki = 1
for i in range(N):
    seki *= A[i]
tmp = 0

for j in range(N):
    gcd = fractions.gcd(A[j],seki//A[j])
    if gcd != 1:
        pairwise = False
        if tmp == 0:
            tmp = gcd
        else:
            tmp = fractions.gcd(gcd,tmp)

    else:
        setwise = True

if tmp == 1:
    setwise = True

if pairwise:
    print('pairwise coprime')
elif setwise:
    print('setwise coprime')
else:
    print('not coprime')




Fixed submission:
import fractions
N = int(input())
A = list(map(int, input().split()))

pairwise = True
setwise = False

M = 10**6+1

count = [0 for _ in range(M)]

for a in A:
    count[a] += 1

max_count = 0
for j in range(2,M):
    max_count = max(max_count,sum(count[j::j]))

if max_count == N:
    print('not coprime')
elif max_count >= 2:
    print('setwise coprime')
else:
    print('pairwise coprime')
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
N,M = list(map(int, input().split()))
ab = deque([])
for _ in range(M):
  A= list(map(int, input().split()))
  ab.append(A)

ans = [0]*(N+1)
done = [0]*(N+1)
done[0]=1
done[1]=1

stack = deque([1])

while stack:
  x = stack.pop()
  temp = deque([])
  for i in range(len(ab)):
    c = ab.pop()
    if x in c:
      if c[0] == x:
        if done[c[1]] == 0:
          done[c[1]]+=1
          stack.appendleft(c[1])
          ans[c[1]] = x
      else:
        if done[c[0]] == 0:
          done[c[0]] +=1
          stack.appendleft(c[0])
          ans[c[0]] = x
    else:
      temp.append(c)  
  ab = temp

print('Yes')
for i in range(2,len(ans)):
  print(ans[i])




Fixed submission:
from collections import deque
N,M = list(map(int, input().split()))
ab = deque([[] for i in range(N+1)])
for _ in range(M):
  A= list(map(int, input().split()))
  ab[A[0]].append(A[1])
  ab[A[1]].append(A[0])

ans = [0]*(N+1)
done = [0]*(N+1)
done[0]=1
done[1]=1

stack = deque([1])

while stack:
  x = stack.pop()
  temp = deque([])
  for i in ab[x]:
    if done[i] == 0:
      done[i] += 1
      ans[i] = x
      stack.appendleft(i)

print('Yes')
for i in range(2,len(ans)):
  print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
S = [0]*N
D = [0]*N

for i in range(N):
    S[i] = A[i]+i
    D[i] = i - A[i]

ans = 0
for l in range(N-1):
    ans += D[l+1:].count(S[l])

print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
S = [0]*N
D = [0]*N

for i in range(N):
    if A[i]+i < N:
        S[A[i]+i] += 1
    if i - A[i] > 0:
        D[i - A[i]] += 1
ans = 0
for l in range(N):
    ans += S[l]*D[l]
    

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
K = int(input())
ans = 0

for i in range(1,K+1):
    for j in range(1,K+1):
        n = gcd(i,j)
        for k in range(1,K+1):
            ans += gcd(k,n)

print(ans)



Fixed submission:
from fractions import gcd
K = int(input())
ans = 0
dp = [0]*201

for i in range(1,K+1):
    for j in range(1,K+1):
        S = 0
        n = gcd(i,j)
        if dp[n] != 0:
            ans += dp[n]
        else:
            for k in range(1,K+1):
                S += gcd(k,n)
            ans += S
            dp[n] = S

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,X,Y = list(map(int, input().split()))

dp = [[0]*(N+1) for _ in range(N+1)]

for i in range(1,N+1):
    for j in range(i+1,N+1):
        dp[i][j] = min(j-i,abs(j-Y)+abs(i-X)+1)

dp = sum(dp,[])
for j in range(1,N):
    print(dp.count(j))



Fixed submission:
N,X,Y = list(map(int, input().split()))

ans = [0]*(N+1)

for i in range(1,N+1):
    for j in range(i+1,N+1):
        ans[min(j-i,abs(j-Y)+abs(i-X)+1)] += 1

for j in range(1,N):
    print(ans[j])

Buggy python submission (verdict: Time Limit Exceeded):
N,X,Y = list(map(int, input().split()))

dp = [[0]*(N+1) for _ in range(N+1)]

for i in range(1,N+1):
    for j in range(i+1,N+1):
        dp[i][j] = min(j-i,abs(j-Y)+abs(i-X)+1)

dp = sum(dp,[])
for j in range(1,N):
    print(dp.count(j))



Fixed submission:
N,X,Y = list(map(int, input().split()))

ans = [0]*(N+1)

for i in range(1,N+1):
    for j in range(i+1,N+1):
        ans[min(j-i,abs(j-Y)+abs(i-X)+1)] += 1

for j in range(1,N):
    print(ans[j])

Buggy python submission (verdict: Time Limit Exceeded):
N,X,Y = list(map(int, input().split()))
inf = float('inf')

dp = [[0]*(N+1) for _ in range(N+1)]

for i in range(1,N+1):
    for j in range(i+1,N+1):
        dp[i][j] = min(j-i,abs(j-Y)+abs(i-X)+1)

for j in range(1,N):
    ans = 0
    for k in range(N+1):
        ans += dp[k].count(j)
    print(ans)



Fixed submission:
N,X,Y = list(map(int, input().split()))

ans = [0]*(N+1)

for i in range(1,N+1):
    for j in range(i+1,N+1):
        ans[min(j-i,abs(j-Y)+abs(i-X)+1)] += 1

for j in range(1,N):
    print(ans[j])