#include #include #include #include #include #include #include #include #include namespace ranges = std::ranges; namespace views = std::views; // #include "Src/Number/IntegerDivision.hpp" // #include "Src/Utility/BinarySearch.hpp" #include #include namespace zawa { using i16 = std::int16_t; using i32 = std::int32_t; using i64 = std::int64_t; using i128 = __int128_t; using u8 = std::uint8_t; using u16 = std::uint16_t; using u32 = std::uint32_t; using u64 = std::uint64_t; using usize = std::size_t; } // namespace zawa #include #include namespace zawa { template class CompressedSequence { public: static constexpr u32 NotFound = std::numeric_limits::max(); CompressedSequence() = default; template CompressedSequence(InputIterator first, InputIterator last) : comped_(first, last), f_{} { std::sort(comped_.begin(), comped_.end()); comped_.erase(std::unique(comped_.begin(), comped_.end()), comped_.end()); comped_.shrink_to_fit(); f_.reserve(std::distance(first, last)); for (auto it{first} ; it != last ; it++) { f_.emplace_back(std::distance(comped_.begin(), std::lower_bound(comped_.begin(), comped_.end(), *it))); } } CompressedSequence(const std::vector& A) : CompressedSequence(A.begin(), A.end()) {} inline usize size() const noexcept { return comped_.size(); } u32 operator[](const T& v) const { return std::distance(comped_.begin(), std::lower_bound(comped_.begin(), comped_.end(), v)); } u32 upper_bound(const T& v) const { return std::distance(comped_.begin(), std::upper_bound(comped_.begin(), comped_.end(), v)); } u32 find(const T& v) const { u32 i = std::distance(comped_.begin(), std::lower_bound(comped_.begin(), comped_.end(), v)); return i == comped_.size() or comped_[i] != v ? NotFound : i; } bool contains(const T& v) const { u32 i = std::distance(comped_.begin(), std::lower_bound(comped_.begin(), comped_.end(), v)); return i < comped_.size() and comped_[i] == v; } u32 at(const T& v) const { u32 res = find(v); assert(res != NotFound); return res; } inline u32 map(u32 i) const noexcept { assert(i < f_.size()); return f_[i]; } inline T inverse(u32 i) const noexcept { assert(i < size()); return comped_[i]; } inline std::vector comped() const noexcept { return comped_; } private: std::vector comped_; std::vector f_; }; } // namespace zawa // #include "Src/Sequence/RunLengthEncoding.hpp" // #include "Src/Algebra/Group/AdditiveGroup.hpp" // #include "Src/DataStructure/FenwickTree/FenwickTree.hpp" // #include "Src/DataStructure/SegmentTree/SegmentTree.hpp" // #include "Src/DataStructure/DisjointSetUnion/DisjointSetUnion.hpp" using namespace zawa; // #include "atcoder/modint" // using mint = atcoder::modint998244353; #include using namespace std; int N, H, T, A[100010]; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); cin >> N >> H >> T; for (int i = 0 ; i < N ; i++) cin >> A[i]; vector app(N); for (int i = 0 ; i < N ; i++) app[i] = (H + A[i] - 1) / A[i]; CompressedSequence comp{app}; vector> pos(ssize(comp)); for (int i = 0 ; i < N ; i++) pos[comp.map(i)].push_back(i); using qt = pair; priority_queue, greater> que; for (int i = 0 ; i < ssize(comp) ; i++) que.push({comp.inverse(i), i}); vector C(N); while (T > 0 and ssize(que)) { auto [t, id] = que.top(); que.pop(); vector arr = pos[id]; while (ssize(que) and que.top().first == t) { for (int x : pos[que.top().second]) arr.push_back(x); que.pop(); } sort(arr.begin(), arr.end()); for (int i : arr) { C[i]++; T--; if (T == 0) break; } que.push({t + comp.inverse(id), id}); } for (int i = 0 ; i < N ; i++) cout << C[i] << (i + 1 == N ? '\n' : ' '); }