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

N, X, Y = map(int, input().split())

for k in range(1,N):
    ans = 0
    for i in range(1,N):
        for j in range(i,N+1):
            min_dis = min((j-i), abs(X-i)+1+abs(j-Y))
            if min_dis == k:
                ans += 1
    print(ans)





### FIXED CODE ###

N, X, Y = map(int, input().split())

memo = [0] *(N)

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

for k in range(1,N):
    print(memo[k])
### BUGGY CODE ###

a,b,k=map(int,input().split())
for i in range(a,b+1):
    if i not in range(a+k,b+1-k):
        print(i)


### FIXED CODE ###

a,b,k=map(int,input().split())
for i in range(a,b+1):
    if i not in range(a+k,b+1-k):
        print(i)
### BUGGY CODE ###

import sys

sys.setrecursionlimit(10001)


def prepare(n, MOD):
    f = 1
    factorials = [1]
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    inv = pow(f, MOD - 2, MOD)
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv

    return factorials, invs


memo = {}


def dfs(i, remain):
    # i: number of person of group
    if (i, remain) in memo:
        return memo[i, remain]
    if remain == 0:
        memo[i, remain] = 1
        return 1
    if i > b or i * c > remain:
        memo[i, remain] = 0
        return 0

    ret = dfs(i + 1, remain)

    for j in range(c, d + 1):
        ij = i * j
        if ij > remain:
            break
        pattern = dfs(i + 1, remain - ij)
        new_pattern = pattern * facts[remain] * invs[remain - ij] % MOD
        new_pattern = new_pattern * pow(invs[i], j, MOD) * invs[j]
        ret = (ret + new_pattern) % MOD

    memo[i, remain] = ret
    return ret


n, a, b, c, d = map(int, input().split())
MOD = 10 ** 9 + 7
facts, invs = prepare(n, MOD)
print(dfs(a, n))


### FIXED CODE ###

def prepare(n, MOD):
    f = 1
    factorials = [1]
    for m in range(1, n + 1):
        f = f * m % MOD
        factorials.append(f)
    inv = pow(f, MOD - 2, MOD)
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv = inv * m % MOD
        invs[m - 1] = inv

    return factorials, invs


def solve(n, a, b, c, d, MOD):
    facts, invs = prepare(n, MOD)
    dp = [0] * (n + 1)
    dp[n] = 1
    for i in range(a, b + 1):
        iv = invs[i]
        for j in range(i * c, n + 1):
            base = dp[j] * facts[j] % MOD
            for k in range(c, d + 1):
                ik = i * k
                if ik > j:
                    break
                pat = base * invs[j - ik] % MOD
                pat = pat * pow(iv, k, MOD) * invs[k]
                dp[j - ik] = (dp[j - ik] + pat) % MOD
    return dp[0]


n, a, b, c, d = map(int, input().split())
MOD = 10 ** 9 + 7
print(solve(n, a, b, c, d, MOD))
### BUGGY CODE ###

import heapq
import sys


def main():
    input = sys.stdin.readline
    N, M = map(int, input().split())
    
    # heap queue
    h = [i for i in map(int, input().split())]
    h.sort()
    heapq.heapify(h)

    for i in range(M):
        B, C = map(int, input().split())
        for j in range(B):
            min_value = heapq.heappop(h)
            if min_value < C:
                heapq.heappush(h, C)
            else:
                heapq.heappush(h, min_value)
                break

    print(sum(h))


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
from collections import defaultdict


def main():
    input = sys.stdin.readline
    N, M = map(int, input().split())
    
    A = defaultdict(int)
    for i in map(int, input().split()):
        A[i] += 1
        
    for i in range(M):
        B, C = map(int, input().split())
        A[C] += B
        
    ret = 0
    count = 0
    for value, num_value in sorted(A.items(), key=lambda x:x[0])[::-1]:
        num_value = min(num_value, N - count)
        ret += value * num_value
        count += num_value
        if num_value == N:
            break
    
    print(ret)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

#d
n,a,b = map(int,input().split())

def cmb(n, r, m,g1,g2):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % m

def nCrMOD(n,r,m):
    g1 = [1, 1]
    g2 = [1, 1]
    inverse = [0, 1]
    for i in range( 2, n + 1 ):
        g1.append( ( g1[-1] * i ) % m )
        inverse.append( ( -inverse[m % i] * (m//i) ) % m )
        g2.append( (g2[-1] * inverse[-1]) % m )
    return cmb(n,r,m,g1,g2)


m=10**9+7

ans = 2**(n%(m-1))%m -1 - nCrMOD(n,a,m) -nCrMOD(n,b,m)
print(ans%m)

### FIXED CODE ###

#d
n,a,b = map(int,input().split())

def power(x, n, mod):
    """
    x**n mod in  O(log n)
    """
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K = K * x % mod
            x = x ** 2 % mod
            n = (n - 1) // 2
        else:
            x = x ** 2 % mod
            n = n // 2
    return K * x % mod
 
def nCrMOD(a,b,m):
    c = 1
    for i in range(b):
        c = c * (a - i) % m
        c = c * modinv(i + 1,m) % m
    return c
 
def egcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)
 
def modinv(a, m):
    (inv, q, gcd_val) = egcd(a, m)
    return inv % m

m=10**9+7

ans = power(2,n,m) -1 - nCrMOD(n,a,m) -nCrMOD(n,b,m)
print(ans%m)
### BUGGY CODE ###

N = int(input())
D = list(map(int, input().split()))
M = int(input())
T = list(map(int, input().split()))

cou = 0
if N >= M:
    for i in range(M):
        if T[i] in D:
            D.remove(T[i])
            cou += 1
        else:
            x = 'NO'
            break
            
    if cou == M:
        x = 'YES'
else:
    x = 'NO'

print(x)

### FIXED CODE ###

N = int(input())
D = list(map(int, input().split()))
M = int(input())
T = list(map(int, input().split()))

D_dic = {k: 0 for k in D}
T_dic = {k: 0 for k in T}

for i in range(N):
    d = D[i]
    if D_dic[d]:
        a = D_dic[d] + 1
        D_dic[d] = a
    else:
        D_dic[d] = 1
    
for j in range(M):
    t = T[j]
    if T_dic[t]:
        b = T_dic[t] + 1
        T_dic[t] = b
    else:
        T_dic[t] = 1

cou = 0
if N >= M:
    for k in range(M):
        tk = T[k]
        try:
            if D_dic[tk]:
                c = D_dic[tk] - 1
                D_dic[tk] = c
                cou += 1
            else:
                x = 'NO'
                break
        except KeyError:
            x = 'NO'
            break
            
    if cou == M:
        x = 'YES'
else:
    x = 'NO'

print(x)
### BUGGY CODE ###

n = int(input())
alist = list(map(int,input().split()))
aset = set(alist)
blist = list(aset)
from math import factorial
def cmb(n,r):
  a = factorial(n) // factorial(r) // factorial(n - r)
  return a
ans1 = sum([cmb(alist.count(i),2) for i in blist if alist.count(i) >= 2])
for i in range(n):
  if alist.count(alist[i]) >= 2:
    print(ans1-alist.count(alist[i])+1)
  else:
    print(ans1)


### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
alist = list(map(int,input().split()))
aalist = [0]*n
aset = set(alist)
adic = {}
for a in alist:
    if a not in adic:
        adic[a] = 0
    adic[a] += 1
a_counter = list(adic.items())

sigma = 0
for counter in a_counter:
    sigma += counter[1] * (counter[1] - 1) // 2

for i in range(n):
    aalist[i] = adic[alist[i]]-1

anslist = []
for a in aalist:
    anslist.append(sigma - a)

for ans in anslist:
    print(ans)
### BUGGY CODE ###

def bfs(q_list):
    cnt = -1
    while q_list:
        cnt += 1
        new_q_list = []
        for h, w in q_list:
            if not m_list[h][w+1]:
                m_list[h][w+1] = True
                new_q_list.append([h, w+1])
            if not m_list[h+1][w]:
                m_list[h+1][w] = True
                new_q_list.append([h+1, w])
            if not m_list[h][w-1]:
                m_list[h][w-1] = True
                new_q_list.append([h, w-1])
            if not m_list[h-1][w]:
                m_list[h-1][w] = True
                new_q_list.append([h-1, w])
        q_list = new_q_list
    return cnt


if __name__ == "__main__":
    h_len, w_len = map(int, input().split())
    m_list = [[True for _ in range(w_len+2)]]
    for _ in range(h_len):
        m_list.append([True] + [s=='#' for s in input()] + [True])
    m_list.append([True for _ in range(w_len+2)])
    q_list = []
    for h, w_list in enumerate(m_list[1:-1]):
        for w, a in enumerate(w_list[1:-1]):
            if a:
                q_list.append([h+1, w+1])
    ans = bfs(q_list)
    print(ans)
	

### FIXED CODE ###

def bfs(q_list):
    cnt = -1
    while q_list:
        cnt += 1
        new_q_list = []
        for h, w in q_list:
            if not m_list[h][w+1]:
                m_list[h][w+1] = True
                new_q_list.append((h, w+1))
            if not m_list[h+1][w]:
                m_list[h+1][w] = True
                new_q_list.append((h+1, w))
            if not m_list[h][w-1]:
                m_list[h][w-1] = True
                new_q_list.append((h, w-1))
            if not m_list[h-1][w]:
                m_list[h-1][w] = True
                new_q_list.append((h-1, w))
        q_list = new_q_list
    print(cnt)


if __name__ == "__main__":
    h_len, w_len = map(int, input().split())
    m_list = [[True for _ in range(w_len+2)]]
    for _ in range(h_len):
        m_list.append([True] + [s=='#' for s in input()] + [True])
    m_list.append([True for _ in range(w_len+2)])
    q_list = []
    for h in range(1, h_len+1):
        for w in range(1, w_len+1):
            if m_list[h][w]:
                q_list.append((h, w))
    bfs(q_list)
### BUGGY CODE ###

def main():
    s = input()
    n = len(s)
    mod = 10 ** 9 + 7

    table1 = [0] * 13
    table2 = [0] * 13
    table1[0] = 1
    pre = [[(10 * i + j) % 13 for j in range(10)] for i in range(13)]

    for l in s:
        for i in range(13):
            q = table1[i]
            if q == 0:
                continue
            if l == '?':
                for k in pre[i]:
                    table2[k] += q
            else:
                k = (10 * i + int(l)) % 13
                table2[k] += q

        table1 = table2
        table2 = [0] * 13

    print(table1[5] % mod)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    s = input()
    mod = 10 ** 9 + 7
    table1 = [0] * 13
    table2 = [0] * 13
    table1[0] = 1
    pre = [[((10 * i + j) % 13) for j in range(10)] for i in range(13)]

    for l in s:
        for i in range(13):
            q = table1[i] % mod
            if q == 0:
                continue
            if l == '?':
                for k in pre[i]:
                    table2[k] += q
            else:
                k = (10 * i + int(l)) % 13
                table2[k] += q

        table1 = table2
        table2 = [0] * 13

    print(table1[5] % mod)


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

from collections import Counter

n = int(input())
a = list(map(int, input().split()))

d = Counter(a)

dict1 = {}
dict2 = {}
for key in d:
  m = d[key]
  if m == 1:
    dict1[key] = 0
    dict2[key] = 0
  elif m == 2:
    dict1[key] = 1
    dict2[key] = 0
  else:
    dict1[key] = m*(m-1)//2
    dict2[key] = (m-1)*(m-2)//2

for each in a:
  tmp = sum(dict1.values()) - dict1[each] + dict2[each]
  print(tmp)

### FIXED CODE ###

from collections import Counter

n = int(input())
a = list(map(int, input().split()))

d = Counter(a)

dict1 = {}
dict2 = {}
for key in d:
  m = d[key]
  if m == 1:
    dict1[key] = 0
    dict2[key] = 0
  elif m == 2:
    dict1[key] = 1
    dict2[key] = 0
  else:
    dict1[key] = m*(m-1)//2
    dict2[key] = (m-1)*(m-2)//2

s = sum(dict1.values())
for each in a:
  tmp = s - dict1[each] + dict2[each]
  print(tmp)
### BUGGY CODE ###

import bisect
N = int(input())
P = list(map(int, input().split()))
P_id = [0]*(N + 1)

for i in range(N):
    P_id[P[i]] = i

A = [- 1, - 1, P_id[N], N, N] 

res = 0
for i in range(N - 1, 0, - 1):
    j = bisect.bisect_left(A, P_id[i])
    A.insert(j, P_id[i])
    l2, l1 = A[j - 2 : j]
    r1, r2 = A[j + 1: j + 3]
    res += i*((A[j] - l1)*(r2 - r1) + (l1 - l2)*(r1 - A[j]))
    
print(res)

### FIXED CODE ###

import bisect
import array
N = int(input())
P = list(map(int, input().split()))
P_id = [0]*(N + 1)

for i in range(N):
    P_id[P[i]] = i

A = array.array('i', [- 1, P_id[N], N])


res = 0
for i in range(N - 1, 0, - 1):
    j = bisect.bisect_left(A, P_id[i])
    A.insert(j, P_id[i])
    l1 = A[j - 1]
    r1 = A[j + 1]
    l2 = l1
    r2 = r1
    if l1 != - 1:
        l2 = A[j - 2]
    if r1 != N:
        r2 = A[j + 2]
    
    res += i*((A[j] - l1)*(r2 - r1) + (l1 - l2)*(r1 - A[j]))

print(res)
### BUGGY CODE ###

import sys
import bisect
input = sys.stdin.readline

n,m = map(int,input().split())
a = list(map(int,input().split()))
bc = []
for _ in range(m):
    bc.append(list(map(int,input().split())))

a.sort()

bc.sort(key=lambda x: x[1], reverse=True)
num = 0
for i in range(m):
    index = bisect.bisect_left(a[num:],bc[i][1])
    if index == 0:
        break
    elif index > bc[i][0]:
        for j in range(bc[i][0]):
            a[num+j] = bc[i][1]
    else:
        for j in range(index):
            a[num+j] = bc[i][1]

    num += bc[i][0]
    if num >= n:
        break

print(sum(a))


### FIXED CODE ###

import sys

def main():
    input = sys.stdin.readline

    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    bc = []
    for _ in range(m):
        bc.append(list(map(int,input().split())))

    a.sort()
    a = tuple(a)

    bc.sort(key=lambda x: x[1], reverse=True)

    num = 0
    ans = 0

    for i in range(m):
        b = bc[i][0]
        c = bc[i][1]
        for j in range(num,min(num+b,n)):
            if c > a[j]:
                ans += c
            else:
                ans += a[j]

        num += b
        if num >= n:
            break

    if num < n:
        print(ans + sum(a[num:]))
    else:
        print(ans)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

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

ans = 1
for a in A:
    ans *= a
    if ans > 10**18:
        ans = -1
        continue
    if a == 0:
        ans = 0
        break
print(ans)

### FIXED CODE ###

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

x = 10**18
ans = 1
for a in A:
    if ans != -1:
        ans *= a
    if ans > x:
        ans = -1
    if a == 0:
        ans = 0
        break
print(ans)
### BUGGY CODE ###

K = int(input())  # ぜんぜんちがう
ans = -1
 
def moduloseven(K):
	for i in range(1000000):
		sev = int(str(7)*(i+1))
		if sev % K == 0:
			ans = i+1
			break
		else:
			ans = K-1
	return(ans)
 
if K % 2 != 0:
	if K % 5 != 0:
		ans = moduloseven(K)
print(ans)

### FIXED CODE ###

#ABC_174_C_Respect_review.py

K = int(input())
ans = 1

if K % 2 == 0:
	print(-1)
	exit()
if K % 5 == 0:
	print(-1)
	exit()

temp = 7
for i in range(1*10**6):
	if temp % K == 0:
		print(ans)
		exit()
	res = temp % K
	temp = res*10 + 7
	ans += 1
print(-1)
### BUGGY CODE ###

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


if __name__ == '__main__':
    N = int(input())
    prime = prime_factorize(N)
    res = N - 1
    for i in range(2**len(prime)):
        a = 1
        b = 1
        for j in range(len(prime)):
            if i & (1 << j):
                a *= prime[j]
            else:
                b *= prime[j]
        res = min(res, a+b-2)
    print(res)



### FIXED CODE ###


if __name__ == '__main__':
    N = int(input())
    res = 1
    for i in range(2, int(N**.5)+1):
        if N % i == 0:
            res = i
    print(res + N//res - 2)
### BUGGY CODE ###

N = int(input())

p = 1
for i in range(1, N+1):
  p = p * i
 
print(p % (10**9 + 7))

### FIXED CODE ###

N = int(input())
MOD = 10**9 + 7

p = 1
for i in range(1, N+1):
  p = (p * i) % MOD
 
print(p)
### BUGGY CODE ###



def cal():
    number = int(input())
    strList1 = []
    for i in range(number):
        strList1.append(list(map(str, input().rstrip().split())))
    strList2 = [strList1[0]]
    for each in strList1:
        flag = 1
        for item in strList2:
            if item == each:
                flag = 0
        if flag == 1:
            strList2.append(each)
    print(len(strList2))


cal()




### FIXED CODE ###



def cal():
    number = int(input())
    strList = []
    for i in range(number):
        temp = input()
        strList.append(temp)

    count = {}

    for item in strList:
        count[item] = count.get(item, 0) + 1
    print(len(count))


cal()
### BUGGY CODE ###

n = int(input())
al = list(map(int,input().split()))

b = []
for i in range(n):
    ai = al[i]
    b.append(str(ai))
    b.reverse()
print(' '.join(b))


### FIXED CODE ###

from collections import deque
n = int(input())
al = list(map(int,input().split()))

b = deque()

if n % 2 == 0:
    for i in range(n):
        if i % 2 != 0:
            b.appendleft(str(al[i]))
        else:
            b.append(str(al[i]))
else:
    for i in range(n):
        if i % 2 == 0:
            b.appendleft(str(al[i]))
        else:
            b.append(str(al[i]))

print(' '.join(b))
### BUGGY CODE ###

n = int(input())
S = input()
patterns = ["RGB","RBG","GBR","GRB","BRG","BGR"]
anss = [ [0] * (n + 1) for _ in range(n+1)]
acc  = [ [0] * (n + 1) for _ in range(n+1)]
ans = 0
for pattern in patterns:
    c1 = pattern[0]
    c2 = pattern[1]
    c3 = pattern[2]
    cands = []
    #i c1の位置で
    for i1 in range(n):
        for i2 in range(i1 + 1,n):
            if S[i1] == c2 and S[i2] == c3:
                cands.append((i1,i2-i1))
    # anss[i1][i2-i1]→左をi1に固定したときの、距離i2-i1の組の個数

    for  i in range(0,n):
        if S[i] == c1:
            for cand in cands:
                if  cand[0] - i  != cand[1] and cand[0] > i:
                    ans += 1

print(ans)


### FIXED CODE ###

from collections import defaultdict
n = int(input())
S = input()
patterns = ["RGB","RBG","GBR","GRB","BRG","BGR"]
acc  = [ [0] * (n + 1) for _ in range(n+1)]

ans = 0
for pattern in patterns:
    c1 = pattern[0]
    c2 = pattern[1]
    c3 = pattern[2]
    cands = []
    #i c1の位置で
    for i1 in range(n):
        for i2 in range(i1 + 1,n):
            if S[i1] == c2 and S[i2] == c3:
                cands.append((i1,i2-i1))
    # anss[i1][i2-i1]→左をi1に固定したときの、距離i2-i1の組の個数
    cands.reverse()
    di = defaultdict(lambda :set())
    for cand in cands:
        left,dist = cand
        di[left].add(dist)
    acc = [0]
    for i in range(1,n):
        acc.append(acc[i-1] + len(di[i]))

    for  i in range(0,n):
        if S[i] == c1:
            ans += acc[n - 1] -acc[i]
            for i2 in range(i + 1,n):
                if i2 - i in di[i2]:
                    ans -=1
print(ans)
### BUGGY CODE ###

def main():
    S = input()
    N = len(S)

    MOD = 10**9 + 7
    dp = [[0 for _ in range(13)] for _ in range(N)]  # dp[i][j]: S[i]までみて13で割ってjあまるものの個数

    # 初期値
    if S[0] == "?":
        for j in range(10):
            dp[0][j] = 1
    else:
        dp[0][int(S[0])] = 1

    # dpテーブル更新式
    for i in range(1, N):
        if S[i] == "?":
            for si in range(10):
                for j in range(13):
                    dp[i][(j*10 + si)%13] += dp[i-1][j]
                    dp[i][(j*10 + si)%13] %= MOD
        else:
            si = int(S[i])
            for j in range(13):
                dp[i][(j*10 + si)%13] += dp[i-1][j]
                dp[i][(j*10 + si)%13] %= MOD

    print(dp[N-1][5])

if __name__ == '__main__':
    main()


### FIXED CODE ###

INF = 10 ** 9 + 7

S = input()
# dp[i][j]はうしろからi桁を13で割った余りがjであるものの個数
dp = [[0] * 13 for _ in range(len(S) + 1)]
dp[0][0] = 1
mul = 1

for i in range(len(S)):
    x = S[-(i + 1)]
    if x == "?":
        for k in range(10):
            for j in range(13):
                dp[i + 1][(mul * k + j) % 13] += dp[i][j]
                dp[i + 1][(mul * k + j) % 13] %= INF
    else:
        k = int(x)
        for j in range(13):
            dp[i + 1][(mul * k + j) % 13] += dp[i][j]
            dp[i + 1][(mul * k + j) % 13] %= INF
    mul = mul * 10 % 13

print(dp[len(S)][5])
### BUGGY CODE ###

import collections
import sys
sys.setrecursionlimit(10**8)

n=int(input())
arr=[input() for _ in range(n)]
g=[[] for _ in range(n)]
for i in range(n):
  for j in range(n):
    if i==j:
      continue
    if arr[i][j]=='1':
      g[i].append(j)

colors=[0]*n

def dfs(v,color):
  colors[v]=color
  for u in g[v]:
    if colors[u]==color:
      return False
    if colors[u]==0 and not dfs(u,-color):
      return False
  return True

def is_bipartite():
  return dfs(0,1)

if is_bipartite()==False:
  print(-1)
  exit()

ans=0
for v in range(n):
  q=collections.deque()
  q.append((v,1))
  checked=[0]*n
  while len(q)!=0:
    tmp,depth=q.popleft()
    ans=max(ans,depth)
    checked[tmp]=1
    for v in g[tmp]:
      if checked[v]==0:
        q.append((v,depth+1))
print(ans)

### FIXED CODE ###

from scipy.sparse.csgraph import floyd_warshall
import sys
sys.setrecursionlimit(10**8)

n=int(input())
arr=[input() for _ in range(n)]
g=[[] for _ in range(n)]
for i in range(n):
  for j in range(n):
    if i==j:
      continue
    if arr[i][j]=='1':
      g[i].append(j)
g2=[[0]*n for _ in range(n)]
for i in range(n):
  for j in range(n):
    g2[i][j]=int(arr[i][j])

colors=[0]*n

def dfs(v,color):
  colors[v]=color
  for u in g[v]:
    if colors[u]==color:
      return False
    if colors[u]==0 and not dfs(u,-color):
      return False
  return True

def is_bipartite():
  return dfs(0,1)

if is_bipartite()==False:
  print(-1)
  exit()

ans=0
d=floyd_warshall(g2)
for i in range(n):
  ans=max(ans,int(max(d[i])+1))
print(ans)
### BUGGY CODE ###

import numpy as np

N,A,B = list(map(int,input().split()))
h=[]
for i in range(N):
    h.append(int(input()))

def jugde(n):
    count = 0
    for i in range(N):
        count+=max(np.ceil((h[i]-B*n)/(A-B)),0)
    if count<=n:
        return True
    else:
        return False

def bisect(i,j):
    if j-i==1:
        return j
    else:
        if jugde((i+j)//2):
            return bisect(i,(i+j)//2)
        else:
            return bisect((i+j)//2,j)

print(bisect(0,10**9))

### FIXED CODE ###


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

h=[]
for i in range(N):
    h.append(int(input()))

def jugde(n):
    count = 0
    for i in range(N):
        if (h[i]-B*n)%(A-B)==0:
            count+=max((h[i]-B*n)//(A-B),0)
        else:
            count+=max((h[i]-B*n)//(A-B)+1,0)
    if count<=n:
        return True
    else:
        return False

def bisect(i,j):
    if j-i==1:
        return j
    else:
        if jugde((i+j)//2):
            return bisect(i,(i+j)//2)
        else:
            return bisect((i+j)//2,j)

print(bisect(0,10**9))