58012023-10-01 14:52:11xxxBájital (80 pont)cpp14Wrong answer 54/8037ms4904 KiB
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)

int 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
base54/80
1Accepted0/03ms1812 KiB
2Accepted0/03ms2000 KiB
3Accepted2/23ms2208 KiB
4Accepted2/23ms2424 KiB
5Accepted2/23ms2676 KiB
6Accepted2/23ms2764 KiB
7Accepted4/43ms2760 KiB
8Accepted4/43ms2828 KiB
9Wrong answer0/237ms3768 KiB
10Wrong answer0/237ms3740 KiB
11Wrong answer0/237ms3744 KiB
12Wrong answer0/237ms3744 KiB
13Wrong answer0/237ms3892 KiB
14Wrong answer0/237ms3744 KiB
15Wrong answer0/237ms3744 KiB
16Wrong answer0/237ms3868 KiB
17Wrong answer0/237ms3944 KiB
18Wrong answer0/237ms3948 KiB
19Wrong answer0/237ms3952 KiB
20Accepted2/237ms4100 KiB
21Accepted2/237ms4280 KiB
22Accepted2/237ms4024 KiB
23Accepted4/42ms3320 KiB
24Accepted4/43ms3564 KiB
25Accepted4/42ms3660 KiB
26Accepted4/423ms4448 KiB
27Accepted4/437ms4680 KiB
28Accepted4/437ms4660 KiB
29Accepted4/437ms4904 KiB
30Accepted2/237ms4660 KiB
31Accepted2/237ms4764 KiB
32Wrong answer0/237ms4764 KiB
33Wrong answer0/237ms4760 KiB