Buggy python submission (verdict: Time Limit Exceeded):
import sys
input=sys.stdin.readline
n,a,b = map(int, input().split())
h=[int(input()) for i in range(n)]

def solve(num,hit):
    all_b = num*b
    cnt=0
    for i in range(len(hit)):
        rest = hit[i] - all_b
        if rest>0:
            cnt+=(rest - 1) // (a-b) + 1
    if cnt <= num:
        return True
    else:
        return False

import copy
l=0
r=10**10
while r-l>1:
    hit = copy.deepcopy(h)
    mid=(l+r)//2

    if solve(mid,hit):
        r=mid
    else:
        l=mid
print(r)

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

def solve(num):
    all_b = num*b
    cnt=0
    for i in range(len(h)):
        rest = h[i] - all_b
        if rest>0:
            cnt+=(rest - 1) // (a-b) + 1
    if cnt <= num:
        return True
    else:
        return False

import copy
l=0
r=10**10
while r-l>1:
    mid=(l+r)//2

    if solve(mid):
        r=mid
    else:
        l=mid
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input=sys.stdin.readline
n,a,b = map(int, input().split())
h=[int(input()) for i in range(n)]

def solve(num,hit):
    all_b = num*b
    cnt=0
    for i in range(len(hit)):
        rest = hit[i] - all_b
        if rest>0:
            cnt+=(rest - 1) // (a-b) + 1
    if cnt <= num:
        return True
    else:
        return False

import copy
l=0
r=10**18
while r-l>1:
    hit = copy.deepcopy(h)
    mid=(l+r)//2

    if solve(mid,hit):
        r=mid
    else:
        l=mid
print(r)

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

def solve(num):
    all_b = num*b
    cnt=0
    for i in range(len(h)):
        rest = h[i] - all_b
        if rest>0:
            cnt+=(rest - 1) // (a-b) + 1
    if cnt <= num:
        return True
    else:
        return False

import copy
l=0
r=10**10
while r-l>1:
    mid=(l+r)//2

    if solve(mid):
        r=mid
    else:
        l=mid
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input=sys.stdin.readline
n,a,b = map(int, input().split())
h=[int(input()) for i in range(n)]

def solve(num,hit):
    all_b = num*b
    for i in range(len(hit)):
        hit[i] -= all_b
    cnt=0
    for i in range(len(hit)):
        if hit[i]>0:
            cnt+=(hit[i] - 1) // (a-b) + 1
    if cnt <= num:
        return True
    else:
        return False

import copy
l=0
r=10**18
while r-l>1:
    hit = copy.deepcopy(h)
    mid=(l+r)//2

    if solve(mid,hit):
        r=mid
    else:
        l=mid
print(r)

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

def solve(num):
    all_b = num*b
    cnt=0
    for i in range(len(h)):
        rest = h[i] - all_b
        if rest>0:
            cnt+=(rest - 1) // (a-b) + 1
    if cnt <= num:
        return True
    else:
        return False

import copy
l=0
r=10**10
while r-l>1:
    mid=(l+r)//2

    if solve(mid):
        r=mid
    else:
        l=mid
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int, input().split())
h=[int(input()) for i in range(n)]


def solve(num,hit):
    all_b = num*b
    for i in range(len(hit)):
        hit[i] -= all_b
    cnt=0
    for i in range(len(hit)):
        if hit[i]>0:
            cnt+=(hit[i] - 1) // (a-b) + 1
    if cnt <= num:
        return True
    else:
        return False

import copy
l=0
r=10**18
while r-l>1:
    hit = copy.deepcopy(h)
    mid=(l+r)//2

    if solve(mid,hit):
        r=mid
    else:
        l=mid
print(r)

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

def solve(num):
    all_b = num*b
    cnt=0
    for i in range(len(h)):
        rest = h[i] - all_b
        if rest>0:
            cnt+=(rest - 1) // (a-b) + 1
    if cnt <= num:
        return True
    else:
        return False

import copy
l=0
r=10**10
while r-l>1:
    mid=(l+r)//2

    if solve(mid):
        r=mid
    else:
        l=mid
print(r)