Buggy python submission (verdict: Time Limit Exceeded):
import sys,math

N,A,B=map(int,input().split())
H = [0] * N
H = [int(input()) for i in range(N)]
 
maxH = max(H)
L=-1
R=math.ceil(maxH / B)

while R-L>1:
    MID=(L+R)//2
    SUM=0
    for i in range(N):
        SUM+=max(0,math.ceil(max(H[i]-B*MID,0)/(A-B)))

    if SUM>MID:
        L=MID
    else:
        R=MID

print(R)


Fixed submission:
import math

N,A,B=map(int,input().split())
H = [0] * N
H = [int(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)

Buggy python submission (verdict: Time Limit Exceeded):
import sys,math

N,A,B=map(int,input().split())
H = [0] * N
H = [int(input()) for i in range(N)]
 
maxH = max(H)
L=-1
R=math.ceil(maxH / B)

while R-L>1:
    MID=int((L+R)/2)
    SUM=0
    for i in range(N):
        Q=float(float(H[i])-float(MID*B)+float(A-B-1))//float(A-B)
        SUM+=max(0,int(Q))

    if SUM>MID:
        L=MID
    else:
        R=MID

print(R)


Fixed submission:
import math

N,A,B=map(int,input().split())
H = [0] * N
H = [int(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)

Buggy python submission (verdict: Time Limit Exceeded):
import sys,math

N,A,B=map(int,input().split())
H = [0] * N
H = [int(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)


   


Fixed submission:
import math

N,A,B=map(int,input().split())
H = [0] * N
H = [int(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)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

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

L=-1
R=sys.maxsize

while R-L>1:
    MID=int((L+R)/2)
    SUM=0
    for i in range(N):
        Q=float(float(H[i])-float(MID*B)+float(A-B-1))//float(A-B)
        SUM+=max(0,int(Q))

    if SUM>MID:
        L=MID
    else:
        R=MID

print(R)


Fixed submission:
import math

N,A,B=map(int,input().split())
H = [0] * N
H = [int(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)