213002026-01-12 18:03:00algoproBájital (80 pont)pypy3Accepted 80/8079ms31448 KiB
# UUID: e6e7033e-9cee-4795-a16c-da07b48ac581
n, x = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

# a.sort(reverse = True)
osszeg = sum(a)
szamlalo2 = osszeg // (x+1)

szamlalo = 0
for szam in a:
    if szam >= x:
        szamlalo += szam // x
if szamlalo > szamlalo2:
    print(szamlalo2)
else:
    print(szamlalo)






# bal = 0
# jobb = sum(a) // (x+1)
# valasz = 0

# while bal <= jobb:
# 	kozep = (bal + jobb) // 2

# 	marad = a[:]
# 	i = 0
# 	okes = True

# 	for i in range(kozep):
# 		while i < n and marad[i] < x:
# 			i += 1
# 		if i == n:
# 			okes = False
# 			break
# 		marad[i] -= x

# if okes  and sum(marad) >= kozep: 
# 	valasz =  kozep
# 	bal = kozep + 1
# else:
# 	jobb = kozep - 1  
	
# print(valasz)
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/039ms19436 KiB
2Accepted0/043ms19612 KiB
3Accepted2/239ms19668 KiB
4Accepted2/245ms19636 KiB
5Accepted2/245ms19688 KiB
6Accepted2/241ms19956 KiB
7Accepted4/454ms21424 KiB
8Accepted4/448ms21420 KiB
9Accepted2/275ms31208 KiB
10Accepted2/265ms31272 KiB
11Accepted2/264ms31044 KiB
12Accepted2/274ms31120 KiB
13Accepted2/275ms31188 KiB
14Accepted2/267ms31212 KiB
15Accepted2/264ms31208 KiB
16Accepted2/275ms31140 KiB
17Accepted2/275ms31216 KiB
18Accepted2/275ms31232 KiB
19Accepted2/265ms31208 KiB
20Accepted2/265ms31056 KiB
21Accepted2/275ms31136 KiB
22Accepted2/275ms31120 KiB
23Accepted4/439ms19400 KiB
24Accepted4/437ms19716 KiB
25Accepted4/439ms19416 KiB
26Accepted4/464ms31448 KiB
27Accepted4/475ms31172 KiB
28Accepted4/475ms31060 KiB
29Accepted4/465ms31212 KiB
30Accepted2/279ms31212 KiB
31Accepted2/275ms31124 KiB
32Accepted2/265ms31084 KiB
33Accepted2/264ms31064 KiB