51422023-04-20 03:40:00tomi7Bájital (80 pont)cpp11Wrong answer 20/8039ms5360 KiB
// Source: https://usaco.guide/general/io

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

/*long long lko(unsigned long long n, unsigned long long m){
	if(n%m==0 || m%n==0){
		return min(n, m);
	}
	if(n>m){
		return lko(n%m, m);
	}else{
		return lko(m%n, n);
	}
}*/

int main() {
	int n;
	int x;
	cin>>n>>x;
	vector<int> a(n);
	int valasz=0;
	int es=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		valasz+=a[i]/x;
		es+=a[i]%x;
	}
	if(es>=valasz){
		cout<<valasz<<'\n';
	}else{
		for(int i=0;i<n;i++){
			if(es+x>=valasz-1){
				valasz--;
				break;
			}else{
				es+=x;
				valasz--;
			}
		}
		cout<<valasz<<'\n';
	}
}
SubtaskSumTestVerdictTimeMemory
base20/80
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2056 KiB
3Wrong answer0/23ms2216 KiB
4Wrong answer0/23ms2424 KiB
5Wrong answer0/23ms2636 KiB
6Wrong answer0/23ms2892 KiB
7Wrong answer0/43ms3104 KiB
8Wrong answer0/43ms3152 KiB
9Wrong answer0/237ms3968 KiB
10Wrong answer0/237ms3948 KiB
11Wrong answer0/237ms3856 KiB
12Wrong answer0/237ms4000 KiB
13Wrong answer0/237ms4092 KiB
14Wrong answer0/237ms4060 KiB
15Wrong answer0/237ms4068 KiB
16Wrong answer0/237ms4064 KiB
17Wrong answer0/237ms4064 KiB
18Wrong answer0/237ms4292 KiB
19Wrong answer0/237ms4372 KiB
20Wrong answer0/237ms4368 KiB
21Wrong answer0/237ms4408 KiB
22Wrong answer0/237ms4640 KiB
23Wrong answer0/43ms3860 KiB
24Accepted4/43ms3856 KiB
25Accepted4/43ms3980 KiB
26Accepted4/423ms4904 KiB
27Wrong answer0/437ms4984 KiB
28Wrong answer0/437ms4988 KiB
29Accepted4/439ms4984 KiB
30Accepted2/237ms4988 KiB
31Accepted2/237ms4988 KiB
32Wrong answer0/237ms4984 KiB
33Wrong answer0/237ms5360 KiB