Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

# 解説放送の解法

class BIT:
    '''https://tjkendev.github.io/procon-library/python/range_query/bit.html'''
    def __init__(self, n):
        self.n = n
        self.data = [0]*(n+1)
        self.el = [0]*(n+1)
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s
    def add(self, i, x):
        self.el[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i
    def query(self, i, j=None):
        if j is None:
            return self.el[i]
        return self.sum(j) - self.sum(i)
      
N,Q=map(int,input().split())
*C,=map(int,input().split())

# 重複度を数える。
res=[]
tmp_dict={}
for i in range(N):
  if tmp_dict.get(C[i]) != None:
    #(クエリの種類、l, r, 意味なし）
    res.append((0,tmp_dict[C[i]],i,0))
    del tmp_dict[C[i]]
  tmp_dict[C[i]] = i
  
# クエリと合わせてソート。
X = []
for i in range(Q):
  l,r = map(int,input().split())
  # (クエリの種類、l, r, 元のクエリの順番)
  X.append((1,l-1,r-1,i))

X.extend(res) 
X = sorted(X,key=lambda x:(x[1],-x[0]),reverse=True)

# 平面走査
bit = BIT(N)
ans=[]
for q,l,r,idx in X:
  if q == 0:
    bit.add(r,1)
  else:
    ans.append((idx,r-l+1-bit.query(l-1,r)))

# 元の順番にソートし直して出力
print(*list(zip(*sorted(ans)))[1])

### FIXED CODE ###

from time import time
start = time()

# 解説放送の解法

class BIT:
    '''https://tjkendev.github.io/procon-library/python/range_query/bit.html'''
    def __init__(self, n):
        self.n = n
        self.data = [0]*(n+1)
        self.el = [0]*(n+1)
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s
    def add(self, i, x):
        self.el[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i
    def query(self, i, j=None):
        if j is None:
            return self.el[i]
        return self.sum(j) - self.sum(i)
      
def main():
  N,Q=map(int,input().split())
  *C,=map(int,input().split())
  q = [tuple(map(int,input().split())) for _ in range(Q)]

  # 重複度を数える。
  res=[]
  tmp_dict={}
  for i in range(N):
    if tmp_dict.get(C[i]) != None:
      #(クエリの種類、l, r）
      res.append((tmp_dict[C[i]]<<40) | (Q<<20) | i)
      del tmp_dict[C[i]]
    tmp_dict[C[i]] = i

  # クエリと合わせてソート。
  X = []
  for i in range(Q):
    l,r = q[i]
    # (元のクエリの順番、l, r)
    X.append(((l-1)<<40) | (i<<20) | r-1)
    
  X.extend(res) 
  X = sorted(X)

  # 平面走査
  bit = BIT(N)
  ans=[0]*Q
  mask = (1<<20) - 1
  for l in reversed(X):
    r = l & mask
    l >>= 20
    idx = l & mask
    l >>= 20
    if idx == Q:
      bit.add(r,1)
    else:
      ans[idx] = r-l+1-bit.query(l-1,r)
      
  print(*ans)
  
if __name__=="__main__":
  main()
### BUGGY CODE ###

import heapq
#from collections import deque
h,w,k = list(map(int, input().split()))
x1,y1,x2,y2 = list(map(int, input().split()))
x1,y1,x2,y2 = x1-1,y1-1,x2-1,y2-1
c = [[] for _ in range(h)]
dp = [[-1]*w for _ in range(h)]
que = []
c = [input() for _ in range(h)]

dp[x1][y1] = 0
heapq.heappush(que, (dp[x1][y1], [x1,y1]))
dx = [1,0,-1,0]
dy = [0,1,0,-1]
while que:
  p= heapq.heappop(que)
  p = p[1]
  if (p[0] == x2) & (p[1] == y2):exit(print(dp[x2][y2]))
  for i in range(4):
    for j in range(1,k+1):
      nx = p[0] + dx[i]*j
      ny = p[1] + dy[i]*j
      if not ((0 <= nx < h) & (0 <= ny < w)):break
      if c[nx][ny] == '@':break
      if 0 <= dp[nx][ny] <= dp[p[0]][p[1]]:break
      dp[nx][ny] = dp[p[0]][p[1]] + 1
      heapq.heappush(que, (dp[nx][ny], [nx,ny]))

if dp[x2][y2] != 0:
  print(dp[x2][y2])
else:
  print(-1)


### FIXED CODE ###

#import heapq
from collections import deque
h,w,k = list(map(int, input().split()))
x1,y1,x2,y2 = list(map(int, input().split()))
x1,y1,x2,y2 = x1-1,y1-1,x2-1,y2-1
dp = [[-1]*w for _ in range(h)]
#que = []
que = deque()
c = [input() for _ in range(h)]

dp[x1][y1] = 0
#heapq.heappush(que, (dp[x1][y1], [x1,y1]))
que.append((x1,y1))
dx = [1,0,-1,0]
dy = [0,1,0,-1]
while que:
  x,y=que.popleft()
  if x==x2 and y==y2:
    exit(print(dp[x][y]))
  for dx,dy in [[1,0],[-1,0],[0,-1],[0,1]]:
    for i in range(1,k+1):
      xx=x+dx*i
      yy=y+dy*i
      if not(0<=xx<h and 0<=yy<w) or c[xx][yy]=="@":break
      if 0<=dp[xx][yy]<=dp[x][y]:break
      if dp[xx][yy]==-1:que.append((xx,yy))
      dp[xx][yy]=dp[x][y]+1
print(-1)
### BUGGY CODE ###

n = int(input())
A = [int(i) for i in input().split()]

ans = []
for i in range(1, len(A)+1):
  ans.append(str(A.index(i)+1))

print(' '.join(ans))

### FIXED CODE ###

n = int(input())
A = [int(i) for i in input().split()]

pre = {}
for i in range(0, len(A)):
  pre[A[i]]  = i+1

tmp = sorted(pre.items())

ans = []
for tp in tmp:
  ans.append(str(tp[1]))
print(' '.join(ans))
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N,X=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]

A.sort(key=lambda x:x[2]*(X-x[0])+x[0]*x[1],reverse=True)
ALL=[a[2]*(X-a[0])+a[0]*a[1] for a in A]

from itertools import accumulate

SUM=[0]+list(accumulate(ALL))

MAX=0
MINUS=0

for a,r,l in A:
    MAX+=a
    MINUS+=a*r

OUT=-1

def binsearch(score):

    alluse=score//X
    rest=score-alluse*X

    for ri in range(N):
        plus=0
        
        if rest<A[ri][0]:
            plus+=rest*A[ri][1]
        else:
            plus+=rest*A[ri][2]+A[ri][0]*A[ri][1]-A[ri][0]*A[ri][2]

        if alluse<=ri:
            plus+=SUM[alluse]

        else:
            plus+=SUM[alluse+1]-ALL[ri]

        #print(score,ri,plus)

        if plus>=MINUS:
            return 1

    return 0


while MAX-OUT>1:
    mid=(MAX+OUT)//2

    x=binsearch(mid)

    if x==1:
        MAX=mid
    else:
        OUT=mid

print(MAX)


### FIXED CODE ###

import sys
input = sys.stdin.readline

from itertools import accumulate

def main():
    N,X=map(int,input().split())
    A=[list(map(int,input().split())) for i in range(N)]

    A.sort(key=lambda x:x[2]*(X-x[0])+x[0]*x[1],reverse=True)
    ALL=[a[2]*(X-a[0])+a[0]*a[1] for a in A]



    SUM=[0]+list(accumulate(ALL))

    MAX=0
    MINUS=0

    for a,r,l in A:
        MAX+=a
        MINUS+=a*r

    OUT=-1

    def binsearch(score):

        alluse=score//X
        rest=score-alluse*X

        for ri in range(N):
            plus=0
            b,l,u=A[ri]
            
            if rest<b:
                plus+=rest*l
            else:
                plus+=rest*u+b*l-b*u

            if alluse<=ri:
                plus+=SUM[alluse]

            else:
                plus+=SUM[alluse+1]-ALL[ri]

            #print(score,ri,plus)

            if plus>=MINUS:
                return 1

        return 0


    while MAX-OUT>1:
        mid=(MAX+OUT)//2

        if binsearch(mid)==1:
            MAX=mid
        else:
            OUT=mid

    print(MAX)

main()
### BUGGY CODE ###

from functools import reduce
from operator import mul

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

result = reduce(mul, A)
print(result if result <= 10**18 else -1)

### FIXED CODE ###

"""
from functools import reduce
from operator import mul

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

result = reduce(mul, A)
print(result if result <= 10**18 else -1)
"""
import sys

N = int(input())
A = list(map(int, input().split()))
A.sort()

result = 1
for a in A:
    result *= a
    if result > 10**18:
        print(-1)
        sys.exit()
else:
    print(result)
### BUGGY CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    Ch, Cw = LI_()
    Dh, Dw = LI_()
    S = [SS() for _ in range(H)]

    d = ((1, 0), (0, 1), (-1, 0), (0, -1)) 
    d_warp = []
    for i in itertools.product(range(-2, 3), repeat=2):
        if i != (0, 0) and i not in d:
            d_warp.append(i)
    dist = [[INF] * W for _ in range(H)]
    que = collections.deque()
    que.append((Ch, Cw, 0))
    dist[Ch][Cw] = 0
    while que:
        cy, cx, cost = que.popleft()
        for dy, dx in d:
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == '.' and cost < dist[ny][nx] :
                dist[ny][nx] = cost
                que.appendleft((ny, nx, cost))
        for dy, dx in d_warp:
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == '.' and cost + 1 < dist[ny][nx] :
                dist[ny][nx] = cost + 1
                que.append((ny, nx, cost + 1))

    if dist[Dh][Dw] == INF:
        print(-1)
    else:
        print(dist[Dh][Dw])

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    Ch, Cw = LI_()
    Dh, Dw = LI_()
    S = [SS() for _ in range(H)]

    d = ((1, 0), (0, 1), (-1, 0), (0, -1)) 
    dist = [[INF] * W for _ in range(H)]
    que = collections.deque()
    que.append((Ch, Cw, 0))
    dist[Ch][Cw] = 0
    while que:
        cy, cx, cost = que.popleft()
        for dy, dx in d:
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == '.' and cost < dist[ny][nx] :
                dist[ny][nx] = cost
                que.appendleft((ny, nx, cost))
        for dy, dx in itertools.product(range(-2, 3), repeat=2):
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == '.' and cost + 1 < dist[ny][nx] :
                dist[ny][nx] = cost + 1
                que.append((ny, nx, cost + 1))

    if dist[Dh][Dw] == INF:
        print(-1)
    else:
        print(dist[Dh][Dw])

if __name__ == '__main__':
    resolve()
### BUGGY CODE ###

n = int(input())
ln = []
ans = 0

for i in range(n):
    ln.append(''.join(sorted(input())))

for i in range(len(ln)):
    for j in range(i+1,len(ln)):
        if ln[i] == ln[j]:
            ans += 1
            continue

print(ans)


### FIXED CODE ###

n = int(input())
ln = []
cnt = 1
ans = 0

for i in range(n):
    ln.append(''.join(sorted(input())))

ln.sort()

for i in range(len(ln)-1):
    if ln[i] == ln[i+1]:
        cnt += 1
    else:
        ans += cnt*(cnt - 1)/2
        cnt = 1

ans += cnt*(cnt - 1)/2

print(int(ans))
### BUGGY CODE ###

import sys
from collections import Counter
import random

n=int(input())
x=list(map(int,input().split()))
z=x.copy()
c=n//2-1
for i in range(n):
    x=z.copy()
    x.pop(i)
    y=sorted(x)
    #print(y)
    print(y[c])

### FIXED CODE ###

import sys
from collections import Counter
import random
import numpy as np

n=int(input())
x=np.array(list(map(int,input().split())))
z=sorted(x)
cand=[z[n//2-1],z[n//2]]
#print(int(np.median(x)))
dic={}
for i in range(n):
    a=x[i]
    if(a<=cand[0]):print(cand[1])
    else:print(cand[0])
### BUGGY CODE ###

import sys
input = sys.stdin.readline
 
H, W = [int(x) for x in input().split()]
s = []
W_count = 0
for _ in range(H):
    tmp = list(input().rstrip())
    s.append(tmp)
    W_count += tmp.count('.')

from collections import deque
D = [[-1] * W for _ in range(H)]

def bfs():
    queue = deque([(0, 0, 0, 0)])
    D[0][0] = 0
    while queue:
        u = queue.popleft()
        x = u[0]
        y = u[1]
        D[x][y] = D[u[2]][u[3]] + 1
        for i in [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]:
            if 0 <= i[0] < H and 0 <= i[1] < W and D[i[0]][i[1]] < 0 and s[i[0]][i[1]] == ".":
                queue.append((i[0], i[1], x, y))
    return D

D = bfs()
if D[-1][-1] == -1:
    print(-1)
    sys.exit()
print(W_count - D[-1][-1])




### FIXED CODE ###

import sys
input = sys.stdin.readline
 
H, W = [int(x) for x in input().split()]
s = []
W_count = 0
for _ in range(H):
    tmp = list(input().rstrip())
    s.append(tmp)
    W_count += tmp.count('.')

from collections import deque
D = [[-1] * W for _ in range(H)]

def bfs():
    queue = deque([(0, 0, 0, 0)])
    D[0][0] = 0
    while queue and D[-1][-1] < 0:
        u = queue.popleft()
        x = u[0]
        y = u[1]
        D[x][y] = D[u[2]][u[3]] + 1
        for i in [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]:
            if 0 <= i[0] < H and 0 <= i[1] < W and D[i[0]][i[1]] < 0 and s[i[0]][i[1]] == ".":
                queue.append((i[0], i[1], x, y))
                s[i[0]][i[1]] = "#"
    return D

D = bfs()
if D[-1][-1] == -1:
    print(-1)
    sys.exit()
print(W_count - D[-1][-1])
### BUGGY CODE ###

s = input()
k = int(input())
n = len(s)
heads = []
d = set()
for c in s:
    d.add(c)

for key in d:
    heads.append(key)

heads.sort()
ind = 0
ans = []
while True:
    if ind > len(heads)-1:
        break
    head = heads[ind]
    p = set()
    for i in range(len(s)):
        if s[i] == head:
            p.add(i)
    # print(head)
    ext = 0
    while True:
        flag = False
        dis = -1
        for key in p:
            if key+ext > n-1:
                flag = True
                dis = key
        if flag:
            p.discard(dis)
            # print(ext)
            # print(p)
        if not p:
            break
        for key in p:
            temp = s[key]
            for j in range(1,ext+1):
                temp += s[key+j]
            # print(temp)
            if temp not in ans:
                ans.append(temp)
        ext += 1
        if len(ans) >= 500:
            break
    if len(ans) >= 500:
        break
    else:
        ind += 1

# print(ans)
ans.sort()
print(ans[k-1])

# for i in range(len(s)):
#     if


### FIXED CODE ###

s = input()
k = int(input())
n = len(s)
heads = []
d = set()
for c in s:
    d.add(c)

for key in d:
    heads.append(key)

heads.sort()
ind = 0
ans = []
while True:
    if ind > len(heads)-1:
        break
    head = heads[ind]
    p = set()
    for i in range(len(s)):
        if s[i] == head:
            p.add(i)
    # print(head)
    ext = 0
    while True:
        flag = False
        dis = -1
        for key in p:
            if key+ext > n-1:
                flag = True
                dis = key
        if flag:
            p.discard(dis)
            # print(ext)
            # print(p)
        if not p:
            break
        for key in p:
            temp = s[key]
            for j in range(1,ext+1):
                temp += s[key+j]
            # print(temp)
            if temp not in ans:
                ans.append(temp)
        ext += 1
        if ext > 5:
            break
        if len(ans) >= 500:
            break
    if len(ans) >= 500:
        break
    else:
        ind += 1

# print(ans)
ans.sort()
print(ans[k-1])

# for i in range(len(s)):
#     if
### BUGGY CODE ###


def resolve():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
#    print()
#    print(N,A,B,C,D,E)
    n,a,b,c,d,e,t = N,0,0,0,0,0,0
#    print(n,a,b,c,d,e,t)
    while (e != N):
        tmp = min(d,E)
        d -= tmp
        e += tmp
        tmp = min(c,D)
        c -= tmp
        d += tmp
        tmp = min(b,C)
        b -= tmp
        c += tmp
        tmp = min(a,B)
        a -= tmp
        b += tmp
        tmp = min(n,A)
        n -= tmp
        a += tmp
        t += 1
#        print(n,a,b,c,d,e,t)
    print(t)
resolve()


### FIXED CODE ###

import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
print(math.ceil(N/min(A,B,C,D,E))+4)
### BUGGY CODE ###

H,W=map(int, input().split())
A=[list(map(str,list(input()))) for i in range(H)]

def paint_center(a,b):
  paint_point(a-1,b)
  paint_point(a+1,b)
  paint_point(a,b-1)
  paint_point(a,b+1)

def paint_point(a,b):
  if 0<=a and a<H:
    if 0<=b and b<W:
      A[a][b]="#"

#黒いマスを探してその周りを黒く塗る


count=0
flag=False #白があればTrue
end_flag=False

while end_flag==False:
  #全マスが黒かどうかのチェック
  flag=False
  black_list=[[]]
  del black_list[0]
  
  for i in range(0,H):
    for j in range(0,W):
      if A[i][j]==".":
        flag=True
        #break
      else:
        #pass
        black_list.append([i,j])
        
  if flag==True:
    #for i in range(0,H):
    #  for j in range(0,W):
    #    if A[i][j]=="#":
    #      black_list.append([i,j])
    #print(black_list)
    for i,j in black_list:
      paint_center(i,j)
    count=count+1
    
  else:
    end_flag=True
    print(count)
    break

### FIXED CODE ###

from collections import deque
H,W=map(int,input().split())
A= [list(input()) for _ in range(H)]
d= [[2000 for _ in range(W)] for _ in range(H)]
move= [ (0,1),(0,-1),(1,0),(-1,0) ]
z= [[False for _ in range(W)] for _ in range(H)]
ans=0

v=deque([])
for i in range(H):
    for j in range(W):
        if A[i][j]=="#":
            v.append( [i,j] )
            z[i][j]=True
            d[i][j]=0
while v:
    a=v.popleft()
    #print(a,v)
    for mv in move:
        s=a[0]+mv[0]
        t=a[1]+mv[1]
        if 0<=s<H and 0<=t<W:
            if z[s][t]==False:
                z[s][t]=True
                d[s][t]=d[a[0]][a[1]]+1
                v.append([s,t])
                ans=max(ans,d[s][t])
#print(d)
print(ans)
### BUGGY CODE ###

h,n=map(int,input().split())
INF=10**9
A=[]; dp=[INF]*(h+10)
for i in range(n):
  x,y=map(int,input().split())
  A.append((x,y))
dp[0]=0
for a,b in A:
  for i in range(h):
    if dp[i]==INF: continue
    index=h if i+a>h else i+a
    dp[index]=dp[index]if dp[index]<dp[i]+b else dp[i]+b
print(dp[h])

### FIXED CODE ###

def IN(): return map(int,input().split())
ans = pow(2,31); mod = pow(10,9)+7
h,n=IN()
A=[]; dp=[pow(2,31)]*111111
for i in range(n):
  x,y=IN()
  A.append((x,y))
dp[0]=0
for a,b in A:
  for i in range(h+1111):
    dp[i+a]=min(dp[i+a],dp[i]+b)
for i in range(h,11111):
  ans=min(ans,dp[i])
print(ans)
### BUGGY CODE ###

from fractions import gcd
N = int(input())
As = list(map(int, input().split()))
# def gcd(n, m):
#     # 最大公約数
#     a = max(n,m)
#     b = min(n,m)
#     while b:
#         a, b = b, a % b
#     return a

lcm = 1

for a in As:
    gcd_now = gcd(lcm,a)
    lcm = lcm*a//gcd_now

mod = 10**9+7
ans = 0
ans = sum([(lcm//a)%mod for a in As])
print(ans%mod)

### FIXED CODE ###

from fractions import gcd
N = int(input())
As = list(map(int, input().split()))

lcm = 1
mod = 10**9+7

def getprime(n):
    if not isinstance(n, int):
        raise TypeError("Input int")
    if n < 2:
        raise ValueError("N >= 2")
    prime = []
    # 約数はsqrt(N)まで調べればOK
    data = [i+1 for i in range(1,n)]
    while True:
        p = data[0]
        if p >= int(n**0.5):
            return prime+data
        prime.append(p)
        # pで割り切れないものだけを残す
        data = [d for d in data if d%p != 0]

from collections import defaultdict
def factorization(n):
    factors = defaultdict(int)
    if n == 2 or n == 3:
        factors[n] = 1
        return factors
    primes = getprime(int(n**0.5))
    for prime in primes:
        while n % prime == 0:
            factors[prime] += 1
            n //= prime
            # print(factors,n)
    if n != 1:
        factors[n] += 1
    return factors

d = defaultdict(int)
factors_list = []
cnt_1 = 0
for a in As:
    if a == 1:
        cnt_1 += 1
        continue
    factors = factorization(a)
    factors_list.append(factors)
    for f in factors.keys():
        d[f] = max(d[f],factors[f])

for f in d.keys():
    lcm *= f ** d[f]
    lcm %= mod

As_inv = [pow(a,mod-2,mod) for a in As]
a = sum(As_inv)%mod



print((lcm*a)%mod)
### BUGGY CODE ###

import collections
from collections import deque
import sys
input = sys.stdin.readline

def tree(s):
    flag=True
    INF=-10**9
    dis = [INF for i in range(n)]
    dis[s]=0
    def bfs():
        d = deque()
        d.append(s)
        while len(d):
            x = d.popleft()
            for i,j in vec[x]:
                if dis[i] == INF:
                    dis[i]=dis[x]+j
                    d.append(i)
                else:
                    if dis[i]==dis[x]+j:
                        continue
                    else:
                        print('No')
                        exit()
        return flag
    return bfs()


n,m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
vec= [[] for i in range(n)]

for i in range(m):
    vec[a[i][0]-1].append((a[i][1]-1,a[i][2]))
    vec[a[i][1]-1].append((a[i][0]-1,-a[i][2]))

INF=float('inf')
visited=[INF]*n

for i in range(n):
    if visited[i]==INF:
        tree(i)
print('Yes')

### FIXED CODE ###

import collections
from collections import deque

def Dfs(now):
    flag = True
    d = deque()
    d.append(now)
    visited[now]=0
    while len(d):
        now = d.pop()
        for i,j in vec[now]:
            if visited[i]==INF:
                d.append(i)
                visited[i]=visited[now]+j
            else:
                if visited[i]==visited[now]+j:
                    continue
                else:
                    flag=False
                    break
    return flag


n,m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
vec= [[] for i in range(n)]

for i in range(m):
    vec[a[i][0]-1].append((a[i][1]-1,a[i][2]))
    vec[a[i][1]-1].append((a[i][0]-1,-a[i][2]))

INF=float('inf')
visited=[INF]*n

for i in range(n):
    if visited[i]==INF:
        if not Dfs(i):
            print('No')
            exit()
print('Yes')
### BUGGY CODE ###

import numpy as np


N, X, Y = map(int, input().split())
X, Y = X-1, Y-1
d = np.zeros((N, N))

for i in range(N-1):
    for j in range(i+1, N):
        if i >= Y or j <= X:
            d[i, j] = j-i
            continue
        d[i, j] = min(j-i, abs(X-i)+1+abs(Y-j))

for k in range(1, N):
    print(np.sum(d==k))

### FIXED CODE ###

N, X, Y = map(int, input().split())
X, Y = X-1, Y-1
ans = {i:0 for i in range(1, N)}

for i in range(N-1):
    for j in range(i+1, N):
        d = min(j-i, abs(X-i)+1+abs(Y-j))
        ans[d] += 1
        
for _, v in ans.items():
    print(v)