#include <bits/stdc++.h>
//#include "fish.h"
using namespace std;
#define int long long
signed main(){
int n, t; cin >> n >> t;
int ans = 0, x = 0, y = 0;
vector<int> a(n);
for (int i = 0; i < n; i++){
cin >> a[i];
if ((a[i] % t) <= t / 2) ans += (a[i] % t);
else ans += t - (a[i] % t);
}
cout << (ans + n - 1) / n << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |