-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCF Round 694 Div 2 - Strange Partition (A).cpp
62 lines (56 loc) · 1.29 KB
/
CF Round 694 Div 2 - Strange Partition (A).cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Problem Link: https://codeforces.com/contest/1471/problem/A
#include<iostream>
#include<limits.h>
#include<math.h>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<algorithm>
using namespace std;
#define ll long long
#define ull unsigned long long
#define modulo 1000000007
#define mp make_pair
#define pb push_back
int main()
{
ll int tests;
cin >> tests;
while(tests--)
{
ll int n, x;
cin >> n >> x;
vector<ll int> arr(n);
for(auto i = 0; i < n; i++) {cin >> arr[i];}
ll int maxi = 0;
ll int mini = 0;
ll int sum = 0;
for(auto i = 0; i < n; i++)
{
if(arr[i]%x == 0)
{
maxi += arr[i]/x;
mini += arr[i]/x;
}
else
{
maxi += (arr[i]/x)+1;
sum += arr[i];
}
}
if(sum == 0) {cout << maxi << " " << maxi;}
else
{
if(sum%x == 0) {mini += sum/x;}
else {mini += (sum/x)+1;}
cout << mini << " " << maxi;
}
cout << "\n";
}
return 0;
}