Submission #5031882


Source Code Expand

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

h = []
for i in range(n):
    h.append(int(input()))
st,ed = 0,10**9+1
while st<ed-1:
    mid = (st+ed)//2
    #print(mid)
    tmp = 0
    for i in range(n):
        x = h[i]-mid*b
        if x>0:
            tmp+=(x//(a-b))+(x%(a-b)>0)
    if tmp<=mid:
        ed = mid
    else:
        st = mid
print(ed) 

Submission Info

Submission Time
Task D - Widespread
User Ruloch
Language Python (3.4.3)
Score 400
Code Size 362 Byte
Status AC
Exec Time 1826 ms
Memory 7076 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 13
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 AC 17 ms 3064 KB
a02 AC 17 ms 3064 KB
a03 AC 17 ms 3060 KB
b04 AC 17 ms 3060 KB
b05 AC 861 ms 7076 KB
b06 AC 1826 ms 7072 KB
b07 AC 1168 ms 7072 KB
b08 AC 1021 ms 7072 KB
b09 AC 802 ms 7064 KB
b10 AC 717 ms 7072 KB
b11 AC 788 ms 7068 KB
b12 AC 872 ms 7072 KB
b13 AC 1468 ms 7072 KB