CodeEff/ECCO huggingface dataset:
# Original solution
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def bisearch_min(mn, mx, func):
    """ 条件を満たす最小値を見つける二分探索 """

    ok = mx
    ng = mn
    while ng+1 < ok:
        mid = (ok+ng) // 2
        if func(mid):
            # 下を探しに行く
            ok = mid
        else:
            # 上を探しに行く
            ng = mid
    return ok

def check(m):
    # 全体攻撃
    b = B * m
    H2 = [h-b for h in H]
    # 単体攻撃
    cnt = 0
    for h in H2:
        if h > 0:
            cnt += ceil(h, A)
    # 必要な単体攻撃の回数がm以下ならOK
    return cnt <= m

N, A, B = MAP()
H = LIST(N)
# Aを単体攻撃、Bを全体攻撃とする
A -= B

# 二分探索
res = bisearch_min(0, 10**9, check)
print(res)


# Optimized solution
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def bisearch_min(mn, mx, func):
    """ 条件を満たす最小値を見つける二分探索 """

    ok = mx
    ng = mn
    while ng+1 < ok:
        mid = (ok+ng) // 2
        if func(mid):
            # 下を探しに行く
            ok = mid
        else:
            # 上を探しに行く
            ng = mid
    return ok

def check(m):
    b = B * m
    cnt = 0
    for h in H:
        # 全体攻撃
        h -= b
        if h > 0:
            # 単体攻撃
            cnt += ceil(h, A)
    # 必要な単体攻撃の回数がm以下ならOK
    return cnt <= m

N, A, B = MAP()
H = LIST(N)
# Aを単体攻撃、Bを全体攻撃とする
A -= B

# 二分探索
res = bisearch_min(0, 10**9, check)
print(res)
# Original solution
from math import ceil 
n,a,b=list(map(int,input().split()))
l=[int(eval(input())) for i in range(n)]
def check(x):
    c=0
    l1=[i-b*x for i in l]
    #print(l1)
    for i in l1: 
         c+=ceil((i)/(a-b))
    return c<=x
lo=0 
ans=-1 
hi=10**19
while lo<=hi:
    mi=(lo+hi)>>1 
    if check(mi):
        ans=mi 
        hi=mi-1
    else:
        lo=mi+1 
print(ans)


# Optimized solution
from math import ceil 
n,a,b=list(map(int,input().split()))
l=[int(eval(input())) for i in range(n)]
def check(x):
    c=0
    l1=[i-b*x for i in l]
    for i in l1: 
         if i<=0:
             continue 
         c+=ceil((i)/(a-b))
    return c<=x
lo=0 
ans=-1 
hi=10**9+4 
while lo<=hi:
    mi=(lo+hi)>>1 
    if check(mi):
        ans=mi 
        hi=mi-1
    else:
        lo=mi+1 
print(ans)
# Original solution
# -*- coding:utf-8 -*-
import math
import sys

line = input().split(' ')
N = int(line[0])
A = int(line[1])
B = int(line[2])
hn = sorted([int(eval(input())) for i in range(N)])

maxT = int(hn[-1] / B) + 1
minT = 0

def enough(T):
    count = sum([math.ceil((h - B*T) / (A-B)) if math.ceil((h - B*T) / (A-B)) >= 0 else 0 for h in hn])
    return True if count <= T else False

while True:
    med = int((maxT + minT) / 2)
    if enough(med):
        maxT = med
    else:
        minT = med
    if maxT - minT <= 1:
        break
print(maxT)


# Optimized solution
# -*- coding:utf-8 -*-
import math

N, A, B = list(map(int, input().split(' ')))
hn = sorted([int(eval(input())) for i in range(N)])

maxT = int(hn[-1] / B) + 1
minT = 0

def enough(T):
    count = sum([math.ceil((h - B*T) / (A-B)) if (h - B*T) >= 0 else 0 for h in hn])
    return True if count <= T else False

while True:
    med = int((maxT + minT) / 2)
    if enough(med):
        maxT = med
    else:
        minT = med
    if maxT - minT <= 1:
        break
print(maxT)
# Original solution
import math
N,A,B = list(map(int,input().split()))
H = [int(eval(input())) for _ in range(N)]
low = sum(H)//((N-1)*B+A)-1
high = max(H)//B+1
while high-low>1:
    mid = (high+low)//2
    cnt = 0
    for i in range(N):
        cnt += math.ceil(max(H[i]-mid*B,0)/(A-B))
    if cnt<=mid:
        high = mid
    else:
        low = mid
print(high)

# Optimized solution
import math
N,A,B = list(map(int,input().split()))
H = [int(eval(input())) for _ in range(N)]
d = A-B
high = 10**9
low = 0
while high-low>1:
    mid = (high+low)//2
    D = []
    for i in range(N):
        if H[i]-mid*B>0:
            D.append(H[i]-mid*B)
    cnt = 0
    for h in D:
        cnt += math.ceil(h/d)
    if cnt<=mid:
        high = mid
    else:
        low = mid
print(high)
# Original solution
import math
"""
def search(min_,max_,A,B,arr):
#    print(min_,max_)
    if min_==max_:
        return min_
    mid=(max_+min_)//2
    
    tmp=arr-mid*B
    
    if len(tmp)==0:
        return search(min_,mid,A,B,arr)
    
    tmp=map(lambda x:math.ceil(x/(A-B)),tmp)
    sum_=sum(list(tmp))
    if sum_<=mid:
        return search(min_,mid,A,B,arr)
    else:
        return search(mid+1,max_,A,B,arr)

    while True:
        if k<0:
            if mid==min_:
                return max_
            else:
                #failure
                return search(mid,max_,A,B,arr[:L])
        elif len(tmp)==0:
            #success
            return search(min_,mid,A,B,arr)
        x=-tmp[0]
        tmp=np.delete(tmp,0)
        k-=x//(A-B)+(x%(A-B)>0)
"""
        
    
N,A,B=list(map(int,input().split()))
arr=[]

for i in range(N):
    arr.append(int(eval(input())))

max_=max(arr)//B+1
min_=min(arr)//A

d=A-B

while min_!=max_:
    mid=(max_+min_)//2
    
    sum_=0
    for x in arr:
        sum_+=max(0,math.ceil((x-mid*B)/d))
        
    if sum_<=mid:
        max_=mid
    else:
        min_=mid+1

print(min_)

# Optimized solution
import math        
    
N,A,B=list(map(int,input().split()))
arr=[]

for i in range(N):
    arr.append(int(eval(input())))

max_=max(arr)//B+1
min_=min(arr)//A

d=A-B

while min_!=max_:
    mid=(max_+min_)//2
    
    sum_=0
    for x in arr:
        y=(x-mid*B)
        if y<=0:
            continue
        sum_+=math.ceil(y/d)
        
    if sum_<=mid:
        max_=mid
    else:
        min_=mid+1

print(min_)
# Original solution
import math        
    
N,A,B=list(map(int,input().split()))
arr=[]

for i in range(N):
    arr.append(int(eval(input())))

max_=max(arr)//B+1
min_=min(arr)//A

d=A-B

while min_!=max_:
    mid=(max_+min_)//2
    
    sum_=0
    for x in arr:
        y=(x-mid*B)
        if y<=0:
            continue
        sum_+=math.ceil(y/d)
        
    if sum_<=mid:
        max_=mid
    else:
        min_=mid+1

print(min_)

# Optimized solution
import math

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

max_=max(arr)//B+1
min_=h_sum//(A+B*(N-1))

d=A-B

while min_!=max_:
    mid=(max_+min_)//2
    
    sum_=0
    for x in arr:
        y=(x-mid*B)
        if y<=0:
            continue
        sum_+=math.ceil(y/d)
        
    if sum_<=mid:
        max_=mid
    else:
        min_=mid+1

print(min_)
# Original solution
import math
N,A,B=list(map(int,input().split()))
S=[]
for i in range(N):
  S+=[int(eval(input()))] 
S.sort(reverse=1)
count=0

def Check(T):
  count=0
  for i in range(N):
    count+=max(0,math.ceil((S[i]-B*T)/(A-B)))
  if count<=T:
    return 1
  else:
    return 0

L=1
while True:
  if S[0]/B >=2**L:
    L+=1
  else:
    break

T=2**L#checkしたいナンバー。
for l in range(L,0,-1):
  if Check(T)==1:
    T-=2**(l-1)
  elif Check(T)==0:
    T+=2**(l-1)
if Check(T)==0:
  print((T+1))
else:
  print(T)

# Optimized solution
import math
N,A,B=list(map(int,input().split()))
S=[]
for i in range(N):
  S+=[int(eval(input()))] 
S.sort(reverse=1)
count=0

def Check(T):
  count=0
  for i in range(N):
    a=math.ceil((S[i]-B*T)/(A-B))
    if a>0:
      count+=a
    else:
      break
  if count<=T:
    return 1
  else:
    return 0

L=1
while True:
  if S[0]/B >=2**L:
    L+=1
  else:
    break

T=2**L#checkしたいナンバー。
for l in range(L,0,-1):
  if Check(T)==1:
    T-=2**(l-1)
  elif Check(T)==0:
    T+=2**(l-1)
if Check(T)==0:
  print((T+1))
else:
  print(T)
# Original solution
from math import ceil
n,a,b = list(map(int,input().split()))
h = [int(eval(input())) for _ in range(n)]
l = 0
r = 10**18

def f(x):
    res = 0
    for i in range(n): res += ceil(max(0,(h[i]-b*x))/(a-b))
    return res <= x

while l+1 < r:
    m = (l+r)//2
    if f(m): r = m
    else: l = m
print(r)

# Optimized solution
from math import ceil
n,a,b = list(map(int,input().split()))
h = [int(eval(input())) for _ in range(n)]
l = 0
r = max(h)

def f(x):
    res = 0
    for i in range(n): res += ceil(max(0,(h[i]-b*x))/(a-b))
    return res <= x

while l+1 < r:
    m = (l+r)//2
    if f(m): r = m
    else: l = m
print(r)
# Original solution
import sys
from bisect import bisect_right


def solve(t):
    global A, B, C
    k = bisect_right(H, B * t)
    cnt = 0
    for i in range(k, N):
        h = H[i]
        h -= B * t
        cnt += (h + C - 1) // C
    return cnt <= t


N, A, B = list(map(int, input().split()))
C = A - B
H = [int(s) for s in sys.stdin.readlines()]

H.sort()

# [ok, ng) - Maximum
# (ng, ok] - Minimum
# ok が 最終的な答え
ng = 0
ok = 10 ** 9 + 1000
k = 0
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if solve(mid):
        ok = mid
    else:
        ng = mid

print(ok)


# Optimized solution
import sys
from bisect import bisect_right


def solve(t):
    global A, B, C
    k = bisect_right(H, B * t)
    cnt = 0
    for i in range(k, N):
        h = H[i]
        h -= B * t
        cnt += (h + C - 1) // C
    return cnt <= t


N, A, B = list(map(int, input().split()))
C = A - B
H = [int(s) for s in sys.stdin.readlines()]

H.sort()

# [ok, ng) - Maximum
# (ng, ok] - Minimum
# ok が 最終的な答え
ng = 0
ok = H[-1] // B + 1
k = 0
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if solve(mid):
        ok = mid
    else:
        ng = mid

print(ok)
# Original solution
n,a,b,*h=list(map(int,open(0).read().split()));i,j=0,-(-max(h)*n//a)
while j-i>1:
 k=c=(j+i+1)//2
 for t in h:c+=min(0,(b*k-t)//(a-b))
 if c>=0:j=k
 else:i=k
print(j)

# Optimized solution
n,a,b,*h=list(map(int,open(0).read().split()));i,j=0,-(-max(h)*n//a)
while j-i>1:
 k=c=(j+i)//2
 for t in h:c+=min(0,(b*k-t)//(a-b))
 if c>=0:j=k
 else:i=k
print(j)
# Original solution
import sys,math

N,A,B=list(map(int,input().split()))
H = [0] * N
H = [int(eval(input())) for i in range(N)]

L=-1
R=sys.maxsize

def binary_search(D,U):
    MID=(D+U)//2
    if(MID==D):
        print(U)
    else:
        if sum(math.ceil(max(h-B*MID,0)/(A-B))for h in H)<=MID:
            binary_search(D,MID)
        else:
            binary_search(MID,U)


binary_search(L,R)


   


# Optimized solution
import math

N,A,B=list(map(int,input().split()))
H = [0] * N
H = [int(eval(input())) for i in range(N)]

maxH = max(H)
L=-1
R=math.ceil(maxH / B)

def binary_search(D,U):
    MID=(D+U)//2
    if(MID==D):
        print(U)
    else:
        if sum(math.ceil(max(h-B*MID,0)/(A-B))for h in H)<=MID:
            binary_search(D,MID)
        else:
            binary_search(MID,U)


binary_search(L,R)
# Original solution
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

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

h = [int(readline()) for i in range(N)]

C = A-B
ng = 0 #条件を常に満たさない
ok = INF #条件を常に満たす

def judge(mid):
    ans = 0
    for hi in h:
        ans += max(0,(hi-mid*B+C-1)//C)
    if ans <= mid:
        return True
    return False

while ok - ng > 1:
    mid = (ok + ng) // 2
    if judge(mid):
        ok = mid
    else:
        ng = mid
    #okが答えとなる
print(ok)


# Optimized solution
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**9
eps = 10**-7

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

h = [int(readline()) for i in range(N)]

C = A-B
ng = 0 #条件を常に満たさない
ok = INF #条件を常に満たす

def judge(mid):
    ans = 0
    for hi in h:
        ans += max(0,(hi-mid*B+C-1)//C)
    if ans <= mid:
        return True
    return False

while ok - ng > 1:
    mid = (ok + ng) // 2
    if judge(mid):
        ok = mid
    else:
        ng = mid
    #okが答えとなる
print(ok)
# Original solution
N, A, B = [int(i) for i in input().split()]
Hn = [int(eval(input())) for _ in range(N)]
dAB = A - B

def check(X):
  base = B * X
  counts = sum([max((h - base + dAB - 1)//dAB, 0) for h in Hn])
  return counts <= X
               
def min_binary_search(check, l=0, r=1000000000000000):
    while r - l > 1:
      mid = (l + r) // 2
      if check(mid):
        r = mid
      else:
        l = mid
    return r
print((min_binary_search(check)))

# Optimized solution
N, A, B = [int(i) for i in input().split()]
Hn = [int(eval(input())) for _ in range(N)]
dAB = A - B

def check(X):
  base = B * X
  counts = sum([max((h - base + dAB - 1)//dAB, 0) for h in Hn])
  return counts <= X
               
def min_binary_search(check, l=0, r=100000000000):
    while r - l > 1:
      mid = (l + r) // 2
      if check(mid):
        r = mid
      else:
        l = mid
    return r
print((min_binary_search(check)))
# Original solution

import bisect
import collections
import itertools


def getint(): return int(eval(input()))
def getints(): return list(map(int, input().split()))
def getint2d(rows): return [getints() for _ in range(rows)]
def getgrid(rows): return [eval(input()) for _ in range(rows)]
def array1d(n, value): return [value for _ in range(n)]
def array2d(n, m, value): return [array1d(m, value) for _ in range(n)]

n,a,b=getints()
hs=[getint() for _ in range(n)]
mx=max(hs)

min_cast = 0
max_cast = mx+1
c = a-b

while min_cast < max_cast:
    cast = (min_cast + max_cast) // 2
    values= list([s for s in [s - b*cast for s in hs] if s > 0])
    need = sum([(v + c - 1) // c for v in values])
    if need <= cast:
        max_cast = cast
    else:
        min_cast = cast + 1

print(min_cast)

# Optimized solution

import bisect
import collections
import itertools


def getint(): return int(eval(input()))
def getints(): return list(map(int, input().split()))
def getint2d(rows): return [getints() for _ in range(rows)]
def getgrid(rows): return [eval(input()) for _ in range(rows)]
def array1d(n, value): return [value for _ in range(n)]
def array2d(n, m, value): return [array1d(m, value) for _ in range(n)]

n,a,b=getints()
hs=[getint() for _ in range(n)]
mx=max(hs)

min_cast = 0
max_cast = mx+1
c = a-b

hs = list(sorted(hs,reverse=True))

while min_cast < max_cast:
    cast = (min_cast + max_cast) // 2
    #values= list(filter(lambda s: s > 0, map(lambda s: s - b*cast, hs)))
    #need = sum(map(lambda v: (v + c - 1) // c, values))
    need = 0
    dec = b * cast
    for v in hs:
        v = v - dec
        if v <= 0:
            break
        need += (v + c - 1) // c
    if need <= cast:
        max_cast = cast
    else:
        min_cast = cast + 1

print(min_cast)
# Original solution
import math

N, A, B = list(map(int, input().split()))
H = [int(eval(input())) for _ in range(N)]


def ok(n):
    d = n * B
    t = 0
    for h in H:
        if h <= d:
            continue
        t += math.ceil((h - d) / (A - B))
        # t += (h - d) // (A - B)
    return t <= n


lo, hi = 0, 10 ** 9

while lo < hi:
    mi = (lo + hi) // 2
    if ok(mi):
        hi = mi
    else:
        lo = mi + 1

print(hi)


# Optimized solution
import math

N, A, B = list(map(int, input().split()))
H = [int(eval(input())) for _ in range(N)]


def check(n):
    d = n * B
    t = 0
    for h in H:
        if h <= d:
            continue
        t += (h - d + (A - B - 1)) // (A - B)
    return t <= n


lo, hi = 0, 10 ** 9

while lo < hi:
    mi = (lo + hi) // 2
    if check(mi):
        hi = mi
    else:
        lo = mi + 1

print(hi)
# Original solution
import sys
from heapq import heapify, heappop, heappush
from collections import defaultdict
finput=lambda :sys.stdin.readline().strip()

def main():
    n,a,b=list(map(int,finput().split()))
    h=[int(finput()) for _ in range(n)]
    gs=lambda a,b:a//b+(a%b>0)
    def enough(t):
        s=sum([gs(max(x-t*b,0),a-b) for x in h])
        if s<=t:
            return True
        else:
            return False
    l=max(h)//b+1
    t=0
    while l>0:
        t=t+l//2
        if enough(t):
            t=t-l//2
            l=l//2
        else:
            t+=1
            l=l-l//2
    print(t)

if __name__=='__main__':
    main()



# Optimized solution
import sys
from heapq import heapify, heappop, heappush
from collections import defaultdict


def main():
    finput=lambda :sys.stdin.readline().strip()
    n,a,b=list(map(int,finput().split()))
    h=[int(finput()) for _ in range(n)]
    gs=lambda a,b:a//b+(a%b>0)
    def enough(t):
        s=sum([gs(max(x-t*b,0),a-b) for x in h])
        if s<=t:
            return True
        else:
            return False
    l=max(h)//b+1
    t=0
    while l>0:
        t=t+l//2
        if enough(t):
            t=t-l//2
            l=l//2
        else:
            t+=1
            l=l-l//2
    print(t)

if __name__=='__main__':
    main()
# Original solution
import math

def f(h, a, b, t):
    y = 0
    for hi in h:
        if hi-b*t <= 0:
            break
        else:
            y += math.ceil((hi-b*t)/(a-b))
    if y <= t:
        return True
    else:
        return False

n, a, b = list(map(int, input().split()))
h = []
for _ in range(n):
    h.append(int(eval(input())))
h.sort(reverse=True)

low = 1
high = math.ceil(h[0]/b)

while True:
    m = (low+high)//2
    if f(h,a,b,m):
        high = m
    else:
        low = m
    if low +1 == high:
        break

print(high)

# Optimized solution
import math

def f(h, a, b, t):
    y = 0
    for hi in h:
        if hi-b*t <= 0:
            break
        else:
            y += math.ceil((hi-b*t)/(a-b))
    if y <= t:
        return True
    else:
        return False

n, a, b = list(map(int, input().split()))
h = []
for _ in range(n):
    h.append(int(eval(input())))
h.sort(reverse=True)

low = 0
high = math.ceil(h[0]/b)

while True:
    m = (low+high)//2
    if f(h,a,b,m):
        high = m
    else:
        low = m
    if low +1 == high:
        break

print(high)
# Original solution
import math
n, a, b=[int(i) for i in input().split()]
ab=a-b
t=[int(eval(input())) for i in range(n)]
mx = sum([i//a +1 for i in t])
mi = 1

while mx - mi > 1:
  i = (mx + mi) // 2
    
  ti= [j- i * b for j in t]
  if sum([max(math.ceil(j/ab),0) for j in ti]) <= i:
    mx = i
  else:
    mi = i
  
print(mx)

# Optimized solution
import math
n, a, b=[int(i) for i in input().split()]
ab=a-b
t=[int(eval(input())) for i in range(n)]
mx = sum([i//a +1 for i in t])
mi = 1

while mx - mi > 1:
  i = (mx + mi) // 2
    
  if sum([max(math.ceil((j- i * b) /ab),0) for j in t ]) <= i:
    mx = i
  else:
    mi = i
  
print(mx)
# Original solution
n, a, b = list(map(int, input().split()))
ls = sorted([int(eval(input())) for _ in range(n)])
lo = (ls[-1] + a - 1) // a
hi = (ls[-1] + b - 1) // b + 1
mi = (hi + lo) // 2
while hi > lo + 1:
    mi = (hi + lo) // 2
    if sum([(max(x - mi * b, 0) + a - b - 1) // (a - b) for x in ls]) <= mi:
        hi = mi
    else:
        lo = mi
if sum([(max(x - lo * b, 0) + a - b - 1) // (a - b) for x in ls]) <= lo:
    print(lo)
else:
    print(hi)

# Optimized solution
n, a, b = list(map(int, input().split()))
ls = [int(eval(input())) for _ in range(n)]
m = max(ls)
lo = (m + a - 1) // a
hi = (m + b - 1) // b + 1
mi = (hi + lo) // 2
while hi > lo + 1:
    mi = (hi + lo) // 2
    if sum([(max(x - mi * b, 0) + a - b - 1) // (a - b) for x in ls]) <= mi:
        hi = mi
    else:
        lo = mi
if sum([(max(x - lo * b, 0) + a - b - 1) // (a - b) for x in ls]) <= lo:
    print(lo)
else:
    print(hi)
# Original solution
n, a, b = list(map(int, input().split()))
ls = [int(eval(input())) for _ in range(n)]
m = max(ls)
lo = (m + a - 1) // a
hi = (m + b - 1) // b + 1
mi = (hi + lo) // 2
while hi > lo + 1:
    mi = (hi + lo) // 2
    if sum([(max(x - mi * b, 0) + a - b - 1) // (a - b) for x in ls]) <= mi:
        hi = mi
    else:
        lo = mi
if sum([(max(x - lo * b, 0) + a - b - 1) // (a - b) for x in ls]) <= lo:
    print(lo)
else:
    print(hi)

# Optimized solution
n, a, b = list(map(int, input().split()))
ls = [int(eval(input())) for _ in range(n)]
m = max(ls)
lo = (m + a - 1) // a
hi = (m + b - 1) // b + 1
mi = (hi + lo) // 2
while hi > lo + 1:
    mi = (hi + lo) // 2
    if sum([(x - mi * b + a - b - 1) // (a - b)
            for x in ls if x - mi * b > 0]) <= mi:
        hi = mi
    else:
        lo = mi
if sum([(x - lo * b + a - b - 1) // (a - b)
        for x in ls if x - lo * b > 0]) <= lo:
    print(lo)
else:
    print(hi)
# Original solution
from math import ceil

n, a, b = list(map(int, input().split()))
h = [int(eval(input())) for _ in range(n)]


def f(x):
    cnt = 0
    for e in h:
        cnt += max(0, ceil((e - b * x) / (a - b)))

    if cnt > x:
        return False

    return True


l = 0
r = 10 ** 9 + 1
while r - l > 1:
    mid = (l + r) // 2
    if f(mid):
        r = mid
    else:
        l = mid

print(r)


# Optimized solution
from math import ceil

n, a, b = list(map(int, input().split()))
h = [int(eval(input())) for _ in range(n)]


def f(x):
    cnt = 0
    for e in h:
        cnt += max(0, ceil((e - b * x) / (a - b)))

    if cnt > x:
        return False

    return True


l = 0
r = ceil(max(h) / b)
while r - l > 1:
    mid = (l + r) // 2
    if f(mid):
        r = mid
    else:
        l = mid

print(r)
# Original solution
n,a,b = list(map(int,input().split()))
hls = [int(eval(input())) for i in range(n)]
l = 0
r = 10**15
while l<r:
  x = (l+r)//2
  cnt = 0
  for hp in hls:
    if hp-x*b>0:
      cnt += (hp-x*b+(a-b)-1)//(a-b)
  if cnt>x:
    l = x+1
  elif cnt<x:
    r = x
  else:
    ans = x
    break
if l == r:
  ans = l
print(ans)

# Optimized solution
import sys
input = sys.stdin.readline
n,a,b = list(map(int,input().split()))
hls = [int(eval(input())) for i in range(n)]
l = 0
r = sum(hls)
while l<r:
  x = (l+r)//2
  cnt = 0
  for hp in hls:
    if hp-x*b>0:
      cnt += (hp-x*b+(a-b)-1)//(a-b)
  if cnt>x:
    l = x+1
  elif cnt<x:
    r = x
  else:
    ans = x
    break
if l == r:
  ans = l
print(ans)
# Original solution
from math import ceil
def f(x,hp):
  hp=[hh-(b*x) for hh in hp]
  c=0
  for p in hp:
    if p<=0:continue
    c+=ceil(p/(a-b))
  return c<=x

n,a,b=list(map(int,input().split()))
h=[int(eval(input())) for i in range(n)]
ng=0
ok=10**9
while ok-ng>1:
  mid=(ok+ng)//2
  if f(mid,h):
    ok=mid
  else:
    ng=mid
print(ok)






# Optimized solution
from math import ceil

def f(x,h):
    hp = h
    hp = [hh-(b*x)  for hh in hp]
    count = 0
    for hh in hp:
        if hh <=0: continue
        count += ceil(hh/(a-b))
    return x >= count

n,a,b = list(map(int,input().split()))
h = [int(eval(input())) for i in range(n)]

ng = 0
ok = 10**9
while abs(ok-ng)>1:
    m = (ok+ng)//2
    if f(m,h):
        ok = m
    else:
        ng = m

print(ok)