#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T;
    cin >> T;
    while (T--) {
        int n, k;
        cin >> n >> k;
        long long sum = 0, mx = 0;
        for (int i = 0; i < n; i++) {
            int x;
            cin >> x;
            mx += (x + k - 1) / k;
            sum += x;
        }
        long long mn = ((long long)sum + k - 1) / k;
        cout << mn << " " << mx << "\n";
    } 
    return 0;
}