79002024-01-11 19:08:09AblablablaBájital (80 pont)cpp17Accepted 80/8039ms4392 KiB
#include <iostream>

using namespace std;

typedef long long ll;

int main()
{
    ll n, x;
    cin >> n >> x;

    ll elso = 0;
    ll masodik = 0;

    for(ll i = 0; i < n; i++){
        ll a;
        cin >> a;

        elso += a % x;
        masodik += a / x;
    }

    if(masodik < elso){
        cout << masodik << "\n";
    } else{
        cout << masodik - ((masodik - elso) / (x + 1) + ((masodik - elso) % (x + 1) == 0 ? 0 : 1)) << "\n";
    }
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1880 KiB
2Accepted0/03ms2116 KiB
3Accepted2/23ms2324 KiB
4Accepted2/23ms2572 KiB
5Accepted2/23ms2736 KiB
6Accepted2/23ms2952 KiB
7Accepted4/44ms3128 KiB
8Accepted4/43ms3360 KiB
9Accepted2/237ms3520 KiB
10Accepted2/237ms3608 KiB
11Accepted2/239ms3604 KiB
12Accepted2/239ms3740 KiB
13Accepted2/237ms3708 KiB
14Accepted2/237ms3840 KiB
15Accepted2/237ms4076 KiB
16Accepted2/237ms4064 KiB
17Accepted2/237ms4056 KiB
18Accepted2/237ms4056 KiB
19Accepted2/237ms4056 KiB
20Accepted2/237ms4064 KiB
21Accepted2/237ms4084 KiB
22Accepted2/237ms4184 KiB
23Accepted4/43ms4064 KiB
24Accepted4/43ms4064 KiB
25Accepted4/43ms4092 KiB
26Accepted4/424ms4056 KiB
27Accepted4/437ms4064 KiB
28Accepted4/439ms4196 KiB
29Accepted4/439ms4100 KiB
30Accepted2/237ms4064 KiB
31Accepted2/237ms4304 KiB
32Accepted2/239ms4268 KiB
33Accepted2/239ms4392 KiB