You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below.
Fortunately, you are a skilled magician, capable of causing explosions that damage monsters. In one explosion, you can damage monsters as follows:
 - Select an alive monster, and cause an explosion centered at that monster. The health of the monster at the center of the explosion will decrease by A, and the health of each of the other monsters will decrease by B. Here, A and B are predetermined parameters, and A > B holds.
At least how many explosions do you need to cause in order to vanish all the monsters?

-----Constraints-----
 - All input values are integers.
 - 1 ≤ N ≤ 10^5
 - 1 ≤ B < A ≤ 10^9
 - 1 ≤ h_i ≤ 10^9

-----Input-----
Input is given from Standard Input in the following format:
N A B
h_1
h_2
:
h_N

-----Output-----
Print the minimum number of explosions that needs to be caused in order to vanish all the monsters.

-----Sample Input-----
4 5 3
8
7
4
2

-----Sample Output-----
2

You can vanish all the monsters in two explosion, as follows:
 - First, cause an explosion centered at the monster with 8 health. The healths of the four monsters become 3, 4, 1 and -1, respectively, and the last monster vanishes.
 - Second, cause an explosion centered at the monster with 4 health remaining. The healths of the three remaining monsters become 0, -1 and -2, respectively, and all the monsters are now vanished.

Difficulty: interview

Starter code:

Solutions:
import heapq

n, a, b = map(int, input().split())
h = []
for i in range(n):
    h.append(int(input()))
ac = (max(h) - 1) // b + 1
wa = 0
while ac - wa > 1:
    wj = (ac + wa) // 2
    num = 0
    for i in range(n):
        num += max((h[i] - b * wj - 1) // (a - b) + 1, 0)
    if num <= wj:
        ac = wj
    else:
        wa = wj
print(ac)

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

#めぐる式二分探索
#indexが条件を満たすか判定
def isOK(index, H):
  now_min = index * B
  all_H = []
  for i in range(len(H)):
    if H[i] > now_min:
      all_H.append(H[i] - now_min)
  count = 0 
  for j in all_H:
    if j % (A - B) == 0:
      count += int(j // (A - B))
    else:
      count += int(j // (A - B)) + 1
  if count <= index:
    return True
  else:
    return False
  
#にぶたん
#A : 配列
def binary_search(H):
  N = 10 ** 9 + 1
  ng = -1
  ok = N
  while (abs(ok - ng) > 1):
    mid = int((ok + ng) / 2)
    if isOK(mid, H):
      ok = mid
    else:
      ng = mid
  return ok
  

print((binary_search(H)))  


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

def judge(t):
    base_damage=B*t
    add_attack=0
    for hi in H:
        if hi <= base_damage:
            continue
        res=hi-base_damage
        q,r=divmod(res,A-B)
        add_attack+=q
        if r:
            add_attack+=1
    return add_attack<=t

MAX=max(H)
max_attack=MAX//B+1
min_attack=0
while True:
    mid=(min_attack+max_attack)//2
    if mid==min_attack:
        break
    else:
        if judge(mid):
            max_attack=mid
        else:
            min_attack=mid
print(max_attack)

import numpy as np

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

hi = 10**10
low = -1

def calc(x):
    y = h-x*b
    y[y<0] = 0
    f = np.ceil(y/(a-b)).sum()
    return f

while hi-low > 1:
    ave = (hi+low)//2
    if calc(ave) <= ave:
        hi = ave
    else:
        low = ave
    
print(hi)

n,a,b=map(int,input().split())
l=[int(input())for i in range(n)]
a-=b
def  enough(x):
    return sum(max((h-b*x+a-1)//a,0) for h in l)<=x
#(ng,ok]type
ok,ng=10**9,-1
# [ok,ng)type->eraseng,ok=ok,ng
eps=10**(-10)
while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if enough(mid):ok=mid
    else:ng=mid
print(ok)

def main():
    from math import ceil
    n, a, b, *k = list(map(int, open(0).read().split()))
    k.sort()

    l = 0
    r = k[-1]
    m = (l + r) // 2
    while l + 1 < r:
        c = sum(ceil((i - m * b) / (a - b)) if i - m * b > 0 else 0 for i in k)
        if c <= m:
            r = m
        else:
            l = m
        m = (l + r) // 2

    print(r)


def __starting_point():
    main()

__starting_point()

def binsearch(good, bad, fn):
    while abs(good - bad) > 1:
        m = (good + bad) // 2
        if fn(m):
            good = m
        else:
            bad = m
    return good

def main():
    N, A, B = list(map(int, input().split()))
    H = [int(input()) for _ in range(N)]
    c = A - B
    def helper(x):
        r = 0
        for h in H:
            r += max((h - B * x + c - 1) // c, 0)
        return r <= x

    return binsearch(10**9, 0, helper)

print((main()))


N, A, B = list(map(int, input().split()))
H = [int(input()) for _ in range(N)]
ok = 10**9
ng = 0
while ng + 1 < ok:
    c = ok + ng >> 1
    G = [max(0, h-c*B) for h in H]
    n = sum(-(-g//(A-B)) for g in G)
    if c >= n:
        ok = c
    else:
        ng = c
print(ok)


def main():
    from math import ceil
    from copy import deepcopy
    n, a, b, *k = list(map(int, open(0).read().split()))
    k.sort()

    def check(x):
        q = deepcopy(k)
        cnt = 0
        while q:
            p = q.pop() - x * b
            if p <= 0:
                break
            cnt += ceil(p / (a - b))

        return cnt <= x

    l = 0
    r = k[-1]
    m = (l + r) // 2
    while l + 1 < r:
        if check(m):
            r = m
        else:
            l = m
        m = (l + r) // 2

    print((m+1))


def __starting_point():
    main()

__starting_point()

import sys
input=sys.stdin.readline
n,a,b=map(int,input().split())
h=[]
for i in range(n):
    h.append(int(input()))

def enough(t):
    tmp=0
    for i in range(n):
        if h[i]>b*t:
            tmp+=(h[i]-b*t)//(a-b)+(1 if (h[i]-b*t)%(a-b)>0 else 0)
    return True if tmp<=t else False

ok=max(h)
ng=0
mid=(ok-ng)//2
while abs(ok-ng)>1:
    if enough(mid):
        ok=mid
    else:
        ng=mid
    mid=(ok+ng)//2
print(ok)

n,a,b = map(int,input().split())
h_list = []
for _ in range(n):
    h = int(input())
    h_list.append(h)

def ba(s):
    count = 0
    for i in h_list:
        i -= s*b
        if i > 0:
            count += -(-i//(a-b))
    if count <= s:
        return True
    else:
        return False


ng = 0
ok = 10**9
while ok  > ng +1 :
    mid = (ng+ok)//2
    if ba(mid):
        ok = mid
    else:
        ng = mid

print(ok)

n,a,b=list(map(int,input().split()))
h=[int(input())for _ in range(n)]
h.sort(reverse=True)
l=-1
r=10**9
while r-l>1:
	mid=(l+r)//2
	cnt=0
	for i in range(n):
		if h[i]-b*mid<=0:
			break
		else:
			cnt+=(h[i]-b*mid-1)//(a-b)+1
	if cnt>mid:
		l=mid
	else:
		r=mid
print(r)



def main():
    from math import ceil
    n, a, b, *k = list(map(int, open(0).read().split()))
    k.sort()

    l = k[-1] // a - 1
    r = k[-1] // b + 1
    m = (l + r) // 2
    while l + 1 < r:
        c = sum(ceil((i - m * b) / (a - b)) if i - m * b > 0 else 0 for i in k)
        if c <= m:
            r = m
        else:
            l = m

        m = (l + r) // 2

    print(r)


def __starting_point():
    main()

__starting_point()

import sys
from bisect import bisect_right


def solve(t):
    nonlocal 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)


n,a,b=list(map(int,input().split()))
h=[int(input()) for _ in range(n)]
def bisearch(k):# k回で倒せるかどうか
  ret=0
  for hi in h:
    ret+=max(0,(hi-b*k+a-b-1)//(a-b))
  return ret<=k
l,r=0,pow(10,9)
while r-l>1:
  x=(l+r+1)//2
  if bisearch(x):
    r=x
  else:
    l=x

print(r)


N, A, B = map(int, input().split())
diff = A - B
H = [int(input()) for i in range(N)]

def check(x):
  time = 0
  _H = [h-B*x for h in H]
  for _h in _H:
    if _h > 0:
      time += -(-_h//diff)
  return time <= x

left = 0 # False
right = 10**10 # True
while left + 1 < right:
  mid = (left + right) // 2
  if check(mid):
    right = mid
  else:
    left = mid

print(right)

def main():
    from math import ceil
    n, a, b, *k = list(map(int, open(0).read().split()))
    k.sort()

    l = k[-1] // a
    r = k[-1] // b + 1
    m = (l + r) // 2
    while l + 1 < r:
        c = sum(ceil((i - m * b) / (a - b)) if i - m * b > 0 else 0 for i in k)
        if c <= m:
            r = m
        else:
            l = m

        m = (l + r) // 2

    print(r)


def __starting_point():
    main()

__starting_point()

def resolve():
    def f(mid):
        return sum([(x - mid * b + a - b - 1) // (a - b) for x in h if x > mid * b]) <= mid
    n, a, b = list(map(int, input().split()))
    h = [int(input()) for _ in range(n)]
    ok, ng = 10 ** 10, 0
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if f(mid):
            ok = mid
        else:
            ng = mid
    print(ok)


def __starting_point():
    resolve()

__starting_point()

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

    # x回で出来るか
    def check(x):
        cnt = 0
        for i in h:
            nokori = i - b*x
            if nokori > 0:
                cnt += nokori // (a-b)
                if nokori % (a-b) != 0:
                    cnt += 1
            if cnt > x:
                return False
        return True

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

    print(r)

def __starting_point():
    main()
__starting_point()

N,A,B = list(map(int,input().split()))
H = []
for _ in range(N):
    H.append(int(input()))
H = sorted(H)
def check(x):
    cnt = 0
    for h in H:
        if h > x * B:
            tmp = (h - x*B) // (A-B)
            #切り上げ
            if tmp * (A-B) != h - x*B: tmp += 1
            cnt += tmp
    if cnt <= x:
        return True
    else:
        return False
# (l,r]
def bisect(l,r):
    if r - l == 1: return r
    mid = (l+r) // 2
    if check(mid):
        return bisect(l,mid)
    else:
        return bisect(mid,r)
    
print((bisect(0,10**28)))


n, a, b = map(int, input().split())
c = a-b
h = sorted([int(input()) for _i in range(n)], reverse=True)
left, right = 0, 10**9
while left < right:
    middle = (left+right)//2
    counter = 0
    checker = middle*b
    i = 0
    while checker < h[i]:
        counter -= (-h[i]+checker)//c
        i += 1
        if i >= n:
            break
    if counter <= middle:
        right = middle
    else:
        left = middle + 1
print(right)

import sys
from heapq import heapify, heappop, heappush
from collections import defaultdict
import numpy as np

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=np.sum([gs(max(x-t*b,0),a-b) for x in h])
        if s<=t:
            return True
        else:
            return False
    #def biser(t,l):
    #    if l==0:
    #        return t
    #    t=t+l//2
    #    if enough(t):
    #        return biser(t-l//2,l//2)
    #    else:
    #        return biser(t+1,l-l//2)
    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)

def __starting_point():
    main()


__starting_point()

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
    def biser(t,l):
        if l==0:
            return t
        t=t+l//2
        if enough(t):
            return biser(t-l//2,l//2)
        else:
            return biser(t+1,l-l//2)
    l=max(h)//b+1
    t=biser(0,l)
    #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)

def __starting_point():
    main()


__starting_point()

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

l = (min(h_s) - 1) // a + 1
r = (max(h_s) - 1) // b + 1

c = a - b
while l != r:
    pos = (l + r) // 2
    cnt = 0
    base = b * pos
    for h in h_s:
        rem = h - base
        cnt += max(0, (rem - 1) // c + 1)
    if cnt <= pos:
        r = pos
    else:
        l = pos + 1
print(r)

def abc063_d():
    n, a, b = map(int, input().split())
    H = [int(input()) for _ in range(n)]
    lower, upper = 0, 10**16
    d = a - b
    while upper - lower > 1:
        x = (upper + lower) // 2
        v = 0
        for hi in H:
            v += (max(0, hi - x*b) + d - 1) // d
        if v <= x: upper = x
        else: lower = x
    print(upper)

def __starting_point():
    abc063_d()
__starting_point()

import math
n,a,b=map(int,input().split())
h=[int(input()) for i in range(n)]
l,r=0,10**9
while r-l>1:
    m=(l+r)//2
    count=0
    for i in h:
        count+=max(math.ceil((i-b*m)/(a-b)),0)
    if count<=m:
        r=m
    else:
        l=m
print(r)

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

ok = (maxim_h + a - 1) // a * n
ng = 0
while abs(ok - ng) > 1:

    X = (ok + ng) // 2
    #X回爆発を起こす必要があると仮定する

    cnt = 0
    flag = 1
    for val in h:
        if val <= b * X:continue
        temp = (val - b * X + a - b - 1) // (a - b)
        cnt += temp

        if cnt > X:
            flag = 0
            break

    #print(X, cnt, ok)
    if flag:ok = X
    else:ng = X
print(ok)


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

l = (min(h_s) - 1) // a + 1
r = (max(h_s) - 1) // b + 1

c = a - b
while l != r:
    pos = (l + r) // 2
    cnt = 0
    base = b * pos
    for h in h_s:
        rem = h - base
        cnt += max(0, (rem - 1) // c + 1)
    if cnt <= pos:
        r = pos
    else:
        l = pos + 1
print(r)


n,a,b= list(map(int,input().split()))
sh = sorted([int(input()) for i in range(n)],reverse=True)
sumh = sum(sh)
def nibu(t):
    rt=0
    for i in range(n):
        temp = -1*(-1*max(0,sh[i]-t*b)//(a-b))
        if temp>0:rt+=temp
        else:break
        if rt>t:return False
    return True if t>=rt else False
l=max(sh)//a
r=max(sh)//b+1
while r-l!=1:
    m = (l+r)//2
    if nibu(m):r=m
    else:l=m
print(r)


n,a,b= map(int,input().split())
sh = sorted([int(input()) for i in range(n)],reverse=True)
sumh = sum(sh)
def nibu(t):
    rt=0
    for i in range(n):
        temp = -1*(-1*max(0,sh[i]-t*b)//(a-b))
        if temp>0:rt+=-1*(-1*max(0,sh[i]-t*b)//(a-b))
        else:break
        if rt>t:return False
    return True if t>=rt else False
l=max(sh)//a
r=max(sh)//b+1
while r-l!=1:
    m = (l+r)//2
    if nibu(m):r=m
    else:l=m
print(r)

N,A,B = map(int,input().split())
H = [int(input()) for n in range(N)]
L = 0
R = 10**9

while 1<R-L:
  m = (L+R)//2
  if m<-sum(min(0,(h-m*B)//(B-A)) for h in H):
    L = m
  else:
    R = m

print(R)

from math import ceil

def is_ok(m):

    tmp = h[:]

    for i in range(N):
        tmp[i] -= m*B

    if not any(tmp):
        return True

    rem = 0
    for i in tmp:
        if i > 0:
            rem += ceil(i/(A-B))

    if rem > m:
        return False

    return True

N,A,B = map(int,input().split())
h = list(int(input()) for _ in range(N))
s = sum(h)
##二分散策

r = 10**10
l = 0

while abs(l-r) > 1:

    m = (r+l)//2

    if is_ok(m):
        r = m
    else:
        l = m

print(r)

from math import ceil

def is_ok(m):

    tmp = h[:]

    for i in range(N):
        tmp[i] -= m*B
    
    flag = True

    for i in tmp:
        if i > 0:
            flag = False
            break

    if flag:##全部0以下
        return True
    else:
        rem = 0
        for i in tmp:
            if i > 0:
                rem += ceil(i/(A-B))

        if rem > m:
            return False

        return True

N,A,B = map(int,input().split())
h = list(int(input()) for _ in range(N))
s = sum(h)
##二分散策

r = 10**10
l = 0

while abs(l-r) > 1:

    m = (r+l)//2

    if is_ok(m):
        r = m
    else:
        l = m

print(r)

n,a,b=list(map(int,input().split()))
h=[int(input())for _ in range(n)]
h.sort(reverse=True)
l=-1
r=(max(h)-1)//b+1
while r-l>1:
	mid=(l+r)//2
	cnt=0
	for i in range(n):
		if h[i]-b*mid<=0:
			break
		else:
			cnt+=(h[i]-b*mid-1)//(a-b)+1
	if cnt>mid:
		l=mid
	else:
		r=mid
print(r)



import sys
import math
import collections
import bisect
import itertools

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list([int(x) - 1 for x in sys.stdin.readline().rstrip().split()])


# ===CODE===

def main():
    n, a, b = ns()

    h = [ni() for _ in range(n)]

    upper = 10 ** 9
    lower = 0

    while upper - lower > 1:
        mid = (upper + lower) // 2
        cnt = 0
        for hi in h:
            cnt += int(math.ceil(max(0, hi - b * mid) / (a - b)))
        if cnt <= mid:
            upper = mid
        else:
            lower = mid
    print(upper)


def __starting_point():
    main()

__starting_point()

import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

diff = a-b

hmax = max(h)

saiaku = -(-hmax//b)

def isok(ans):
    count = 0
    for i in range(n):
        count += max(-(-(h[i]-b*ans)//diff),0)
    if count > ans:
        return False
    return True

ok = saiaku
ng = -1 # -1にしとけば答えが0の時も普通に扱えるな

while ok - ng > 1:
    m = (ok+ng)//2
    if isok(m):
        ok = m
    else:
        ng = m
print(ok)


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)

def __starting_point():
    main()


__starting_point()

import sys
readline = sys.stdin.readline

N,A,B = map(int,readline().split())
H = [int(readline()) for i in range(N)]

# AをA - Bと読み替え、一回の攻撃で全体にBダメージと1体にAダメージと考える
# X回で達成できるかの二分探索

A -= B

ng = 0
ok = 10 ** 9
def isOk(x):
  # 各H_iを倒すのに必要な攻撃Aの回数をカウントする
  cnt = 0
  for i in range(len(H)):
    h = H[i] - x * B
    if h > 0:
      cnt += (h + A - 1) // A
  return cnt <= x
  
while abs(ok - ng)>1:
  mid = abs(ok + ng) // 2
  if isOk(mid):
    ok = mid
  else:
    ng = mid

print(ok)

def main():
    from math import ceil
    n, a, b, *k = list(map(int, open(0).read().split()))
    k.sort()

    l = k[-1] // a
    r = k[-1] // b + 1
    m = (l + r) // 2
    while l + 1 < r:
        c = sum(ceil((i - m * b) / (a - b)) if i - m * b > 0 else 0 for i in k)
        (l, r) = (l, m) if c <= m else (m, r)
        m = (l + r) // 2

    print(r)


def __starting_point():
    main()

__starting_point()

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

def ok(x):
    cnt = 0
    for h in H:
        cnt += max(0, (h - b*x-1)//(a-b)+1)
    return cnt <= x

top = 10**9
bottom = 0
while top - bottom > 1:
    mid = (top + bottom)//2
    if ok(mid):
        top = mid
    else:
        bottom = mid
print(top)


import math

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

def C(T):
    t = 0
    for i in range(N):
        if h[i] > B*T:
            t += math.ceil((h[i]-B*T)/(A-B))
    if t <= T:
        return True
    else:
        False
l, r = 0, 10**18
while r - l > 1:
    mid = (l+r) // 2
    if C(mid):
        r = mid
    else:
        l = mid


print(r)

import math
def binsearch(l, r, fn):
    while r - l > 1:
        m = (l + r) // 2
        if fn(m):
            l = m
        else:
            r = m
    return l

def main():
    N, A, B = list(map(int, input().split()))
    l = []
    C = A - B
    for _ in range(N):
        h = int(input())
        l.append(h)
    def func(i):
        if max(l) <= B*i:
            return False
        r = 0
        for j in l:
            r += max(math.ceil((j - B*i) / C), 0)
        if r <= i:
            return False
        return True
    return 1 + binsearch(0, 1000000000, func)

print((main()))


import math
import io

nim, mike, kite = list(map(int, input().split()))
H = [int(input()) for _ in range(nim)]

OK = max(H)//kite+1
NG = 0

ans = OK
while OK-NG > 1:
    mid = (OK+NG)//2  # 試行する値
    cnt = 0

    for h in H:
        if h > mid*kite:
            cnt += math.ceil((h-mid*kite)/(mike-kite))

    if cnt <= mid:
        OK = mid
    else:
        NG = mid

print(OK)


import sys
from bisect import bisect_right


def solve(t):
    nonlocal 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)


def judge(x):
    count = 0
    for hi in h:
        count += max(hi - b*x + c-1, 0)//c 
    if count<=x:
        return True
    else:
        return False

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

c= a-b

ng = 0
ok = 10**9

while ok - ng > 1:
    mid = (ng+ok)//2
    if judge(mid):
        ok = mid
    else:
        ng = mid
        
print(ok)

n,a,b = map(int,input().split())
h = [int(input()) for i in range(n)]
h.sort()
t = a-b
r = 10**9+5
l = 0

while r-l > 1:
    m = (r+l)//2
    mi = m*b
    count = 0
    for i in h:
        if i > mi:
            count += (i-mi+t-1)//t
    if count <= m:
        r = m
    else:
        l = m
print(r)

import sys
from math import ceil

def input():
    return sys.stdin.readline().strip()

def check(k):
    tmp = list(h)
    for i in range(N):
        tmp[i] -= B*k
    
    flag = False
    for i in tmp:
        if i > 0:
            flag = True
            break
    if not flag:
        return True

    lf = 0
    for i in tmp:
        if i > 0:
            lf += ceil(i/(A-B))

    if lf <= k:
        return True
    else:
        return False

N,A,B = map(int,input().split())
h = tuple(int(input()) for _ in range(N))

left = -1
right = 1e9

while abs(left-right) > 1:

    mid = (left+right)//2
    if check(mid):
        right = mid
    else:
        left = mid

print(int(right))

n,a,b = map(int,input().split())
h = [int(input()) for _ in range(n)]
l = 0
r = max(h)

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

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

def isok(arg):
    count = arg
    for i in range(n):
        if -(-(h[i]-b*arg)//(a-b)) >= 0:
            count -= -(-(h[i]-b*arg)//(a-b))
    if count >= 0:
        return True
    else:
        return False

def bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if isok(mid):
            ok = mid
        else:
            ng = mid
    return ok

n,a,b = list(map(int,input().split()))
h = []
for i in range(n):
    h.append(int(input()))
print((bisect(0,10**9)))


import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    def meguru_bisect(ok, ng):
        """
        is_okを定義して下さい
        :param ok: 取りうる最小の値-1
        :param ng: 取りうる最大の値+1
        :return: is_okを満たす最小(もしくは最大)の値
        """
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    def is_ok(x):
        cnt = 0
        for h in H:
            h -= b * x
            if h > 0:
                cnt += (h + ab - 1) // ab
        return cnt <= x

    n, a, b = list(map(int, input().split()))
    ab = a - b
    H = list(int(input()) for _ in range(n))

    res = meguru_bisect(10 ** 9 + 1, 0)
    print(res)


def __starting_point():
    resolve()

__starting_point()

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(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)







def submit():
    n, a, b = (int(e) for e in input().split())
    h = [int(input()) for _ in range(n)]

    # t回で倒せるか否かを判定する処理を実施し、
    # tについて2分探索する

    def judge(t):
        base_damage = b * t
        add_attack = 0
        for hi in h:
            if hi <= base_damage:
                continue
            res = hi - base_damage
            q, r = divmod(res, a - b)
            add_attack += q
            if r:
                add_attack += 1
        return add_attack <= t

    max_attack = 0
    for hi in h:
        max_attack += hi // a + 1
    min_attack = 0
    while True:
        mid = (min_attack + max_attack) // 2
        if mid == min_attack:
            break
        else:
            if judge(mid):
                max_attack = mid
            else:
                min_attack = mid

    print(max_attack)

             
def __starting_point():
    submit()
__starting_point()

nim, mike, kite = map(int, input().split())
H = [int(input()) for _ in range(nim)]
C = mike - kite
l, r = 0, 1<<30
while r - l > 1:
    m = (l + r) // 2
    if sum([max((h - kite * m + C - 1) // C, 0) for h in H]) <= m:
        r = m
    else:
        l = m
print(r)

"""
https://atcoder.jp/contests/abc063/submissions/5538114
"""

from numpy import ceil,array,sum
import sys

def input():
    return sys.stdin.readline().strip()

def is_ok(m):
    tmp = h - m*B
    tmp[tmp<0] = 0
    
    if ceil(tmp/(A-B)).sum() > m:
        return False
    return True

N,A,B = map(int,input().split())
h = array(list(int(input()) for _ in range(N)))
##二分散策

r = 10**9
l = 0

while abs(l-r) > 1:

    m = (r+l)//2

    if is_ok(m):
        r = m
    else:
        l = m

print(r)

import numpy as np
N, A, B = map(int, input().split())
h = np.sort([int(input()) for i in range(N)])

def enough(A, B, h, T):
    h = np.ceil((h - B * T) / (A - B))
    count = sum(h[h > 0])
    
    return True if count <= T else False
right = 10 ** 9
left = 1
while right != left:
    mid = (left + right) // 2
    if enough(A, B, h, mid):
        right = mid
    else:
        left = mid + 1

print(left)

import math
n, a, b = list(map(int, input().split()))
h_list = [int(input()) for _ in range(n)]

lb = 0
ub = 10**9 # これだけ唱えれば確実に全滅する

def is_ok(m):
    # m回の攻撃でモンスターが全滅するか
    tmp_ans = 0
    for h in h_list:
        tmp_h = max(h-m*b, 0) # モンスターの残り体力
        tmp_ans += math.ceil(tmp_h/(a-b)) # 爆発の中心になる回数
    if tmp_ans <= m:
        return True
    else:
        return False


ng = lb
ok = ub + 1
while ok - ng > 1:
    m = (ok + ng) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m

print(ok)


from math import ceil
n,a,b = map(int,input().split())
h = [int(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)

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


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

def f(a):
  E=[]
  for i in range(N):
    if D[i]-a*B>0:
      E.append(D[i]-a*B)
  cnt=0
  for i in E:
    cnt+=-(-i//(A-B))
  if cnt<=a:
    return True
  else:
    return False
l,r=0,10**9
for i in range(50):
  mid=(l+r)//2
  if f(mid):
    r=mid
  else:
    l=mid
print(r)

import sys
input = sys.stdin.readline

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

hi = 10**9 + 1
lo = -1

while hi - lo > 1:
    mid = (hi + lo) // 2
    rem = 0
    for i in range(N):
        rem += max(0, (H[i] - B * mid + C - 1) // C)
    if rem <= mid:
        hi = mid
    else:
        lo = mid

print(hi)

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)

def __starting_point():
    main()


__starting_point()

# ABC063 D
N, A, B = map(int, input().split())
h = [0] * N
for i in range(N):
    h[i] = int(input())

L = 0
R = sum((h[i]-1) // A + 1 for i in range(N)) + 1
while R - L > 1:
    M = (L+R-1) // 2 + 1
    count = sum((h[i] - B*M - 1) // (A-B) + 1 for i in range(N) if h[i] - B*M > 0)
#     print(L, R, M, count)
    if count > M:
        L = M
    else:
        R = M
print((L+R-1) // 2 + 1)

N,A,B=map(int,input().split())
hs = [int(input()) for _ in range(N)]
l=0
r=max(hs)

def enough(x):
  res = 0
  for i in range(N):
    res += max(0,(hs[i]-B*x+A-B-1))//(A-B)
  return res <= x

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

print(r)

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

def is_ok(arg):
  # 条件を満たすかどうか？問題ごとに定義
  cnt = 0
  C = A-B
  for h in H:
    wk = h - B*arg
    if wk<0:
      continue
    else:
      cnt += (wk+C-1) // C
  return cnt <= arg

def meguru_bisect(ng, ok):
  '''
    初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
    まずis_okを定義すべし
    ng ok は  とり得る最小の値-1 とり得る最大の値+1
    最大最小が逆の場合はよしなにひっくり返す
  '''
  while (abs(ok - ng) > 1):
    mid = (ok + ng) // 2
    if is_ok(mid):
      ok = mid
    else:
      ng = mid
  return ok

ng = 0
ok = 10**16

print(meguru_bisect(ng,ok))

def abc063_d():
    n, a, b = map(int, input().split())
    H = [int(input()) for _ in range(n)]
    lower, upper = 0, 10**16
    d = a - b
    while upper - lower > 1:
        x = (upper + lower) // 2
        v = 0
        for hi in H:
            v += (max(0, hi - x*b) + d - 1) // d
            if v > x: break
        if v <= x: upper = x
        else: lower = x
    print(upper)

def __starting_point():
    abc063_d()
__starting_point()

import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline
n, a, b = list(map(int, input().split()))
a -= b
h = [int(input()) for i in range(n)]


def check(k):
    # k回で可能か?
    tmp = list([x - b * k for x in h])
    return sum(0 - -i // a for i in tmp if i > 0) <= k


ng, ok = 0, 10 ** 18
while ng + 1 < ok:
    mid = (ng + ok) // 2
    if check(mid):
        ok = mid
    else:
        ng = mid
print(ok)


# 決め打ち二分探索
# 全員にBダメージ、その後1体選んで(A-B)ダメージと読み替える（対称性の確保。lesson.md参照）
# あとはk回以下で倒せるかを計算して二分探索
# Gluttonyと同様の構造なので、あちらと同様にTLEには注意して書くこと

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

additional = a - b

def feasible(k):
    additional_num = sum([max((hp-(b*k) + additional - 1) // additional, 0) for hp in hitpoints])
    return additional_num <= k

ok = 10**9+1
ng = 0

# めぐる式二分探索
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if feasible(mid):
        ok = mid
    else:
        ng = mid

print(ok)


N,A,B = list(map(int,input().split()))
H = []
for _ in range(N):
    H.append(int(input()))
H = sorted(H)
def check(x):
    cnt = 0
    for h in H:
        if h > x * B:
            tmp = (h - x*B) // (A-B)
            #切り上げ
            if tmp * (A-B) != h - x*B: tmp += 1
            cnt += tmp
    if cnt <= x:
        return True
    else:
        return False
# (l,r]
def bisect(l,r):
    if r - l == 1: return r
    mid = (l+r) // 2
    if check(mid):
        return bisect(l,mid)
    else:
        return bisect(mid,r)
    
print((bisect(0,10**12)))


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

def explode(x):
    nonlocal n
    c=0
    for i in range(n):
        if h[i]-x*b>0:
            c+=math.ceil((h[i]-x*b)/(a-b))
    return c<=x

#二分探索用のコード

#(1)l,rは両端点でl<=r
l,r=0,10**9
#(2)l=rもしくはl=r-1のときにbreak
while l+1<r:
    #(3)その閉区間の中点(の小数部分を切り捨てたもの)
    #オーバーフローを考慮すると以下の書き方になる
    k=l+(r-l)//2
    #ここでは境目以上のxで真になるので、
    #x=kで真の場合は大きい方の端点をkにし、x=kで偽の場合は小さい方の端点をkにする
    if explode(k):
        r=k
    else:
        l=k

print(r)

from bisect import bisect_right

N, A, B, *h = list(map(int, open(0).read().split()))

h.sort()
d = A - B

ng = (h[-1] + (A - 1)) // A - 1
ok = (h[-1] + (B - 1)) // B
while ok - ng > 1:
    m = (ok + ng) // 2
    b = B * m
    if m >= sum((h[i] - b + (d - 1)) // d for i in range(bisect_right(h, b), N)):
        ok = m
    else:
        ng = m
print(ok)


import math
N, A, B = map(int, input().split())
h = [int(input()) for _ in range(N)]

x = A-B

def func(cnt):
    dmg = B*cnt
    tmp = [max(0, val-dmg) for val in h]
    cnt2 = sum([math.ceil(val/x) for val in tmp])
    if cnt2 > cnt:
        return False
    else:
        return True

ok = 10**9 # exist
ng = 0 # not exist
while abs(ok-ng) > 1:
    cnt = (ok + ng) // 2
    if func(cnt):
        ok = cnt
    else:
        ng = cnt
print(ok)

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

def solve(k):
    cnt = 0
    for i in range(N):
        if H[i] > B * k:
            cnt += (H[i] - B * k - 1) // (A - B) + 1
    return cnt <= k


left = 0
right = 10 ** 9 + 1

while left + 1 < right:
    mid = (left + right) // 2
    if solve(mid):
        right = mid
    else:
        left = mid

print(right)

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)



# Proble D - Widespread

import math

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

# initialization
left = 0
right = 10**10

# count
while right-left>1:
    mid = (right + left) // 2

    # check
    count = 0
    for h in h_list:
        h = h - B * mid

        if h<0:
            h = 0

        tmp_count = math.ceil(h / (A - B))
        count += tmp_count

    if count>mid:
        left = mid
    else:
        right = mid

# output
print(right)


import math
N, A, B = list(map(int, input().split()))
all_attack = 0
enemy = [int(input()) for i in range(N)]


def possible_kill_all(attack):
    tmp_enemy = [v-B*attack for v in enemy]
    tmp_needed_attack = 0
    for v in tmp_enemy:
        if v>0:
            tmp_needed_attack += math.ceil(v/(A-B))
    if tmp_needed_attack <= attack:
        return True
    else:
        return False



possible = 10**14
impossible = 0

while possible - impossible > 1:
    M = (possible+impossible)//2
    if possible_kill_all(M):
        possible = M
    else:
        impossible = M

print(possible)



from math import ceil

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


def defeatable(k):
    hb = [max([h - k * b, 0]) for h in hs]
    n_attack = sum([ceil(h / (a - b)) for h in hb])
    return n_attack <= k


l, r = 0, ceil(max(hs) / b)

while r - l > 1:
    m = (l + r) // 2

    if defeatable(m):
        r = m
    else:
        l = m

print(r)



N,A,B = list(map(int,input().split()))
H = []
for _ in range(N):
    H.append(int(input()))
H = sorted(H)
def check(x):
    cnt = 0
    for h in H:
        if h > x * B:
            tmp = (h - x*B) // (A-B)
            #切り上げ
            if tmp * (A-B) != h - x*B: tmp += 1
            cnt += tmp
    if cnt <= x:
        return True
    else:
        return False
# (l,r]
def bisect(l,r):
    if r - l == 1: return r
    mid = (l+r) // 2
    if check(mid):
        return bisect(l,mid)
    else:
        return bisect(mid,r)
    
print((bisect(0,10**31)))


import math

def enough(HP,A,B,X):
    q = 0
    for i in range(len(HP)):
        q += max(math.ceil((HP[i] - B * X) / (A - B)),0)
    if q <= X:
        return True
    else:
        return False
    

over = 10 ** 9
under = 0
HP = []
N,A,B = list(map(int,input().rstrip().split(" ")))
for i in range(N):
    HP.append(int(input()))

while abs(over - under) > 1:
    mid = (over + under) // 2
    if enough(HP,A,B,mid):
        over = mid
    else:
        under = mid
print(over)


n, a, b = list(map(int, input().split()))
dab = a - b
H = []
for _ in range(n):
    H.append(int(input()))
maxh = max(H)

l = 0
r = -(-maxh//b)
def ht(mid):
    cnt = 0
    for h in H:
        rem = h - b*mid
        if rem > 0:
            cnt += -(-rem//dab)
    return cnt <= mid

while (r-l) > 1:
    mid = (l + r) // 2
    if ht(mid):
        r = mid
    else:
        l = mid
print(r)


import sys
from math import ceil
"""
def input():
    return sys.stdin.readline().strip()
"""
def check(k):
    tmp = list(h)
    for i in range(N):
        tmp[i] -= B*k
    
    flag = False
    for i in tmp:
        if i > 0:
            flag = True
            break
    if not flag:
        return True

    lf = 0
    for i in tmp:
        if i > 0:
            lf += ceil(i/(A-B))

    if lf <= k:
        return True
    else:
        return False

N,A,B = map(int,input().split())
h = tuple(int(input()) for _ in range(N))

left = -1
right = 1e9

while abs(left-right) > 1:

    mid = (left+right)//2
    if check(mid):
        right = mid
    else:
        left = mid

print(int(right))

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

def explode(x):
    nonlocal n
    c=0
    for i in range(n):
        if h[i]-x*b>0:
            c+=math.ceil((h[i]-x*b)/(a-b))
    return c<=x

#二分探索用のコード

#(1)l,rは両端点でl<=r
l,r=1,10**9
#(2)l=rもしくはl=r-1のときにbreak
while l+1<r:
    #(3)その閉区間の中点(の小数部分を切り捨てたもの)
    #オーバーフローを考慮すると以下の書き方になる
    k=l+(r-l)//2
    #ここでは境目以上のxで真になるので、
    #x=kで真の場合は大きい方の端点をkにし、x=kで偽の場合は小さい方の端点をkにする
    if explode(k):
        r=k
    else:
        l=k

print(l if explode(l) else r)

with open(0) as f:
    N, A, B, *H = map(int, f.read().split())

diff = A - B #追加ダメージ
T = (max(H)+B-1)//B #答えはT以下

def clearable(t): #t回以内で敵を全滅できるか判定
    Higher = [h-B*t for h in H if h-B*t > 0]
    return True if sum([(h+diff-1)//diff for h in Higher]) <= t else False

def binary_search(a, b, judge): #b must be a or higher
    if a == b:
        return a, b
    
    c = a + (b - a)// 2
    return (a, c) if judge(c) else (c+1, b)

a, b = 0, T
while a != b:
    a, b = binary_search(a, b, clearable)
print(a) 

import numpy as np

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

H = []

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

H = np.array(H)

def binary_search(x):
    H_tmp = H - B * x
    H_tmp = H_tmp[H_tmp > 0]
    count = ((H_tmp + A - B - 1) // (A - B)).sum()
    return x >= count

left = 0
right = 10**10

while(right - left > 1):
    mid = (left + right) // 2
    ret = binary_search(mid)
    if ret:
        right = mid
    else:
        left = mid

print(right)

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 = map(int,input().split())
h = [int(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)

import sys

input = sys.stdin.readline


def main():
    N, A, B = [int(x) for x in input().split()]
    H = [int(input()) for _ in range(N)]

    def isOK(mid):
        cnt = 0
        for h in H:
            if h > B * mid:
                sabun = h - B * mid
                cnt += 0 - - sabun // (A - B)
                if cnt > mid:
                    return False
        return True

    ok = 10 ** 9
    ng = 0

    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if isOK(mid):
            ok = mid
        else:
            ng = mid

    print(ok)


def __starting_point():
    main()

__starting_point()

import numpy as np

N, A, B = list(map(int, input().split()))
H = np.zeros(shape=N, dtype='int64')
for _ in range(N):
    h = int(input())
    H[_] = h


def calc(num, a):
    a -= num * B
    a = (a - 1)//(A - B) + 1
    if sum(a[a > 0]) <= num:
        return True
    else:
        return False


start = 0
end = 10 ** 10

while end - start > 1:
    mid = (start + end) // 2
    if calc(mid, H.copy()):
        end = mid
    else:
        start = mid

print(end)


N,A,B = list(map(int,input().split()))
H = []
for _ in range(N):
    H.append(int(input()))
H = sorted(H)
def check(x):
    cnt = 0
    for h in H:
        if h > x * B:
            tmp = (h - x*B) // (A-B)
            #切り上げ
            if tmp * (A-B) != h - x*B: tmp += 1
            cnt += tmp
    if cnt <= x:
        return True
    else:
        return False
# (l,r]
def bisect(l,r):
    if r - l == 1: return r
    mid = (l+r) // 2
    if check(mid):
        return bisect(l,mid)
    else:
        return bisect(mid,r)
    
print((bisect(0,10**20)))


import math


def check(k, A, B, H):
    return sum([max([0, math.ceil((h - B * k) / (A - B))]) for h in H]) <= k


def main():
    N, A, B = list(map(int, input().split(' ')))
    H = [int(input()) for _ in range(N)]
    ng, ok = 0, 10**9
    while ok - ng > 1:
        mid = (ok + ng) // 2
        if check(mid, A, B, H):
            ok = mid
        else:
            ng = mid
    print(ok)


def __starting_point():
    main()
__starting_point()

n, a, b = map(int, input().split())
h = []
for i in range(n):
    h.append(int(input()))
ac = (max(h) - 1) // b + 1
wa = 0
while ac - wa > 1:
    wj = (ac + wa) // 2
    num = 0
    for i in range(n):
        num += max((h[i] - b * wj - 1) // (a - b) + 1, 0)
    if num <= wj:
        ac = wj
    else:
        wa = wj
print(ac)

n, a, b = map(int, input().split())
h = [int(input()) for i in range(n)]
l, r = 0, max(h)
while l + 1 < r:
    m = (l + r) // 2
    cnt = 0
    for i in range(n):
        cnt += max(0, h[i] - b * m + a - b - 1) // (a - b)
    if cnt <= m:
        r = m
    else:
        l = m
print(r)

import sys

input = sys.stdin.readline

def main():
  n, a, b = map(int, input().split())
  h = [int(input()) for _ in range(n)]
  h.sort()
  
  l, r = -1, h[-1]+1
  while r-l > 1:
    key = (r+l)//2
    count = 0
    for i in range(n):
      if h[i] <= key*b:
        continue
      else:
        count += (h[i]-key*b-1)//(a-b)+1
    if count <= key:
      r = key
    else:
      l = key
  print(r)
  
def __starting_point():
  main()
__starting_point()

def check(T):
    res = 0
    for h in H:
        tmp = (h - B * T + A - B - 1) // (A - B)
        if tmp <= 0:
            break
        res += tmp
    return True if res <= T else False

N, A, B = list(map(int, input().split()))
H = [int(input()) for _ in range(N)]
H.sort(reverse=True)
res = 0
left = 0
right = 10 ** 9
while right != left:
    mid = (left + right) // 2
    if check(mid):
        right = mid
    else:
        left = mid + 1
print(left)



from math import ceil
def resolve():
    def chick(k):
        cnt = 0
        for i in range(N):
            h = ceil((H[i] - B * k) / (A - B))
            cnt += max(0, h)
        return cnt <= k

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

    # 最小の攻撃回数を求める
    # 魔法攻撃の回数をkとした時、すべての魔物は少なくともkBの体力が削られている
    # H[i] - kB > 0 であるような各iについて、その敵に対してA-Bの攻撃を何回当てれば体力が0になるかが算出される。
    # 上記の計算：(H[i] - kB) / (A-B) (ただし切り上げ)を計算して和を取る
    ok = 10 ** 10
    ng = 0
    while ok - ng > 1:
        k = (ok + ng) // 2
        if chick(k):
            ok = k
        else:
            ng = k

    print(ok)


def __starting_point():
    resolve()

__starting_point()

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([max(x-t*b,0)//(a-b)+(max(x-t*b,0)%(a-b)>0) for x in h])
        if s<=t:
            return True
        else:
            return False
    #def biser(t,l):
    #    if l==0:
    #        return t
    #    t=t+l//2
    #    if enough(t):
    #        return biser(t-l//2,l//2)
    #    else:
    #        return biser(t+1,l-l//2)
    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)

def __starting_point():
    main()


__starting_point()

import sys
input = sys.stdin.readline

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

l = 0
r = 10 ** 9 + 1


# x 回で全滅できるか否か
def check(x):
    cnt = 0
    for ri in R:
        if ri - x * b > 0:
            cnt += (ri - x * b + a-b - 1) // (a-b)
    return cnt <= x

while True:
    if r - l <= 1:
        break
    mid = (l + r) // 2
    if check(mid):
        r = mid
    else:
        l = mid

if check(l):
    print(l)
else:
    print(r)