#include #include #include using namespace std; using ll = long long; void solve (int D, ll A, vector& X) { for (int i = 0; i < D; i++) { if ((2*X[i]) % A == 0) { cout << (X[i] + A - 1) / A; } else { double v = (double) X[i] / A; cout << (ll) round(v); } if (i < D-1) cout << " "; } cout << "\n"; } int main () { int T; cin >> T; for (int t = 0; t < T; t++) { int D; ll A; cin >> D >> A; vector X(D); for (int i = 0; i < D; i++) cin >> X[i]; solve(D, A, X); } }