Submission #2556992


Source Code Expand

n , a, b = map(int,input().split())
teki = []
ans = 0
for i in range(n):
    teki.append(int(input()))

q = a- b
ss = max(teki)

m =0
for i in range(n):
    u = teki[i] // b  + 1
    if m <= u:
        m = u

for i in range(n):
    teki[i] = teki[i] - b * (m)
    if teki[i] <= 0:
        teki[i] == 0
ans += m


while 0 in teki:
    teki.remove(0)
"""
while tekis != []:
    for i in range(len(tekis)):
        tekis[i] = tekis[i] - b
    
    k = max(tekis)
    tekis.remove(k)
    tekis.append(k + a- b)
    for i in range(len(tekis)):
        if tekis[i] <= 0:
            tekis[i] = 0
    while 0 in tekis:
        tekis.remove(0)
    ans += 1


"""
print(ans-1)

Submission Info

Submission Time
Task D - Widespread
User izuna385
Language Python (3.4.3)
Score 0
Code Size 708 Byte
Status WA
Exec Time 247 ms
Memory 7072 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 1
WA × 2
AC × 3
WA × 10
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 3060 KB
a02 WA 17 ms 3064 KB
a03 WA 17 ms 3064 KB
b04 AC 17 ms 3064 KB
b05 WA 247 ms 7072 KB
b06 WA 243 ms 7072 KB
b07 WA 241 ms 7072 KB
b08 AC 244 ms 7064 KB
b09 WA 236 ms 7068 KB
b10 WA 229 ms 7064 KB
b11 WA 246 ms 7072 KB
b12 WA 242 ms 7072 KB
b13 WA 246 ms 7064 KB