92982024-02-20 11:22:36KristófBájital (80 pont)cpp17Accepted 80/8039ms4752 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, x;
	cin >> n >> x;
	long long sum = 0, maxx = 0;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		sum += a;
		maxx += a / x;
	}

	cout << min(maxx, sum / (x + 1));
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1872 KiB
2Accepted0/03ms2064 KiB
3Accepted2/23ms2312 KiB
4Accepted2/23ms2568 KiB
5Accepted2/23ms2636 KiB
6Accepted2/23ms2628 KiB
7Accepted4/43ms2832 KiB
8Accepted4/43ms3072 KiB
9Accepted2/237ms3196 KiB
10Accepted2/237ms3280 KiB
11Accepted2/237ms3404 KiB
12Accepted2/237ms3492 KiB
13Accepted2/235ms3552 KiB
14Accepted2/237ms3768 KiB
15Accepted2/237ms3884 KiB
16Accepted2/237ms3888 KiB
17Accepted2/237ms3964 KiB
18Accepted2/235ms4088 KiB
19Accepted2/235ms3968 KiB
20Accepted2/237ms3848 KiB
21Accepted2/237ms3972 KiB
22Accepted2/235ms3948 KiB
23Accepted4/43ms4068 KiB
24Accepted4/43ms4156 KiB
25Accepted4/43ms4284 KiB
26Accepted4/423ms4276 KiB
27Accepted4/437ms4164 KiB
28Accepted4/437ms4272 KiB
29Accepted4/437ms4520 KiB
30Accepted2/239ms4480 KiB
31Accepted2/237ms4488 KiB
32Accepted2/237ms4496 KiB
33Accepted2/237ms4752 KiB