222052026-01-14 17:49:26algoproBájital (80 pont)pypy3Wrong answer 14/8093ms31556 KiB
# UUID: 2fac86dd-c02e-4e37-889e-2f5ebdf444f8
n , x = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
#a.sort()
#b = []
c = 0
d = 0
for i in range(n):
    if a[i] >= x:
        #b.append((a[i] // x))
        d += a[i] // x
        c += a[i] % x
    else:
        c += a[i]
if(c >= d):
    print(d)
else:
    h = (d - c+x) // (x+1) #+ (d - c) % x
    print(c + h)

#x=3
#d=10  c=0 
#   9    3
#   8    6
#   7    9

SubtaskSumTestVerdictTimeMemory
base14/80
1Accepted0/052ms19352 KiB
2Wrong answer0/050ms19560 KiB
3Wrong answer0/252ms19588 KiB
4Wrong answer0/248ms19688 KiB
5Wrong answer0/252ms19760 KiB
6Wrong answer0/257ms21100 KiB
7Wrong answer0/464ms21536 KiB
8Wrong answer0/459ms21612 KiB
9Wrong answer0/290ms31072 KiB
10Wrong answer0/290ms31168 KiB
11Wrong answer0/279ms31176 KiB
12Wrong answer0/292ms31176 KiB
13Wrong answer0/276ms31136 KiB
14Wrong answer0/290ms31204 KiB
15Wrong answer0/293ms31284 KiB
16Wrong answer0/290ms31132 KiB
17Wrong answer0/272ms31072 KiB
18Wrong answer0/285ms31076 KiB
19Wrong answer0/286ms31184 KiB
20Wrong answer0/271ms31072 KiB
21Wrong answer0/286ms31208 KiB
22Wrong answer0/286ms31104 KiB
23Wrong answer0/445ms19364 KiB
24Accepted4/443ms19384 KiB
25Wrong answer0/454ms19356 KiB
26Accepted4/489ms31556 KiB
27Wrong answer0/490ms31120 KiB
28Wrong answer0/493ms31172 KiB
29Wrong answer0/492ms31112 KiB
30Accepted2/279ms31236 KiB
31Accepted2/293ms31132 KiB
32Accepted2/290ms31108 KiB
33Wrong answer0/287ms31212 KiB