#ifndef LOCAL #include using namespace std; #define debug(...) (void(0)) #else #include "algo/debug.h" #endif void solve() { int64_t D, A; cin >> D >> A; for(int i = 0; i < D; i++) { int64_t X; cin >> X; int64_t r = X / A; int64_t ans = (X * 2 < r * A * 2 + A ? r : r + 1); cout << ans << " \n"[i == D - 1]; } } int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int tt = 1; std::cin >> tt; while(tt--) { solve(); } }