82322024-01-13 14:24:03xxxBájital (80 pont)cpp17Accepted 80/8043ms6104 KiB
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define int long long

signed main() {
	int n, x;
	cin >> n >> x;
	vector<int> a(n);
	int xs = 0, ns = 0, ans = 0;
	rep(i, n) {
		cin >> a[i];
		xs += a[i]/x;
		ns += a[i]%x;
	}

	
	if (ns >= xs) {
		cout << xs << "\n";
		return 0;
	}
	if ((xs-ns) % (x+1) == 0) {
		cout << xs - (xs-ns)/(x+1) << "\n";
	} else {
		cout << xs - ((xs-ns)/(x+1)+1) << "\n";
	}

	//cout << ((1+2)+(23)) << "asd";

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1812 KiB
2Accepted0/03ms2000 KiB
3Accepted2/23ms2216 KiB
4Accepted2/23ms2456 KiB
5Accepted2/23ms2672 KiB
6Accepted2/23ms2764 KiB
7Accepted4/43ms2764 KiB
8Accepted4/43ms2968 KiB
9Accepted2/243ms4536 KiB
10Accepted2/243ms4740 KiB
11Accepted2/243ms4740 KiB
12Accepted2/243ms4960 KiB
13Accepted2/241ms4940 KiB
14Accepted2/241ms5064 KiB
15Accepted2/243ms5028 KiB
16Accepted2/243ms5028 KiB
17Accepted2/241ms5172 KiB
18Accepted2/243ms5412 KiB
19Accepted2/241ms5408 KiB
20Accepted2/243ms5504 KiB
21Accepted2/243ms5388 KiB
22Accepted2/243ms5388 KiB
23Accepted4/43ms4224 KiB
24Accepted4/42ms4308 KiB
25Accepted4/42ms4304 KiB
26Accepted4/425ms5676 KiB
27Accepted4/443ms5672 KiB
28Accepted4/441ms5804 KiB
29Accepted4/443ms5888 KiB
30Accepted2/243ms5884 KiB
31Accepted2/243ms6016 KiB
32Accepted2/243ms6104 KiB
33Accepted2/243ms6096 KiB