Submission #3600195


Source Code Expand

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

Submission Info

Submission Time
Task D - Widespread
User chun1182
Language Python (3.4.3)
Score 400
Code Size 255 Byte
Status AC
Exec Time 1405 ms
Memory 15136 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 2940 KB
a02 AC 17 ms 2940 KB
a03 AC 17 ms 2940 KB
b04 AC 17 ms 2940 KB
b05 AC 524 ms 7836 KB
b06 AC 1405 ms 14936 KB
b07 AC 724 ms 14904 KB
b08 AC 754 ms 14904 KB
b09 AC 500 ms 10032 KB
b10 AC 456 ms 7072 KB
b11 AC 488 ms 7400 KB
b12 AC 519 ms 9952 KB
b13 AC 1127 ms 15136 KB