#include using namespace std; random_device rnd; mt19937 mt(rnd()); int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); long long N,H,T; cin >> N >> H >> T; vector A(N); for(auto &a : A) cin >> a; auto solve = [&]() -> void { vector B(N),C(N); long long add = 0; for(int t=0; t need(N); vector> A2(N); for(int i=0; i C(N),answer; while(high-low > 1){ long long mid = (high+low)/2; long long sum = 0; vector Last(N); for(int i=0; i= T){ if(sum-N <= T){ answer = C; for(auto [ign,p] : A2){ if(sum == T) break; if(Last.at(p)) sum--,answer.at(p)--; } } high = mid; } else low = mid; } for(auto &a : answer) cout << a << " "; cout << "\n"; }