#include using namespace std; #define ALL(x) (x).begin(), (x).end() #define REP(i, n) for(ll i=0; i<(ll)(n); i++) template bool chmax(T& a, T b) { return a bool chmin(T& a, T b) { return a>b ? a=b, true : false; } using ll=long long; const int INF=1e9+10; const ll INFL=4e18; using VI=vector; using VVI=vector; using VL=vector; using VVL=vector; using PL=pair; using VP=vector; using WG=vector>>; #ifdef LOCAL #include "./debug.hpp" #else #define debug(...) #define print_line #endif //---------------------------------------------------------- void solve() { ll N,H,T; cin>>N>>H>>T; VL A(N); REP(i,N) cin>>A[i]; priority_queue> pq; REP(i,N) { ll a=(H+A[i]-1)/A[i];//Hを超えるまでの時間 ll b=H-A[i]*a;//a回操作したときの値 pq.push({-a,-b,-i}); } VL ans(N); REP(t,T) { auto [a,b,i]=pq.top(); pq.pop(); a=-a; b=-b; i=-i; ans[i]++; a+=(H+A[i]-1)/A[i]; pq.push({-a,-b,-i}); } REP(i,N) cout<>T; while(T--) solve(); }