// -fsanitize=undefined, // #define _GLIBCXX_DEBUG #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; #define rep(i,n) for (int i=0;i-1;i--) #define pb push_back #define all(x) (x).begin(), (x).end() #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << " )\n"; template using vec = vector; template using vvec = vec>; template using vvvec = vec>; using ll = long long; using pii = pair; using pll = pair; template bool chmin(T &a, T b){ if (a>b){ a = b; return true; } return false; } template bool chmax(T &a, T b){ if (a T sum(vec x){ T res=0; for (auto e:x){ res += e; } return res; } template void printv(vec x){ for (auto e:x){ cout< ostream& operator<<(ostream& os, const pair& A){ os << "(" << A.first <<", " << A.second << ")"; return os; } template ostream& operator<<(ostream& os, const set& S){ os << "set{"; for (auto a:S){ os << a; auto it = S.find(a); it++; if (it!=S.end()){ os << ", "; } } os << "}"; return os; } template ostream& operator<<(ostream& os, const vec& A){ os << "["; rep(i,A.size()){ os << A[i]; if (i!=A.size()-1){ os << ", "; } } os << "]" ; return os; } int res[1<<24][25]; void calc(int N,vec freq){ rep(S,1<> solve(int n,vec freq){ /* T in [0,2^n) に対して、 size(T & S)=kなるSに対するfreq[S]の総和 */ vec> res(1<(n+1,0)); if (n == 0){ res[0][0] = freq[0]; return res; } vec small = {freq.begin(),freq.begin()+(1<<(n-1))}; vec big = {freq.begin()+(1<<(n-1)),freq.end()}; auto small_res = solve(n-1,small); auto big_res = solve(n-1,big); for (int S=0;S<(1<<(n-1));S++){ for (int k=0;k<=n-1;k++){ res[S][k] += small_res[S][k] + big_res[S][k]; res[S^(1<<(n-1))][k] += small_res[S][k]; res[S^(1<<(n-1))][k+1] += big_res[S][k]; } } return res; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n,m,k; cin>>n>>m>>k; vec freq(1<>S; int val = 0; rep(j,n){ if (S[j] == '1'){ val += (1< g(m+1,n); for (int T=0;T<(1<>i) & 1) T_size++; } int f_T = 0; for (int i=k;i<=n;i++){ f_T += res[T][i]; } chmin(g[f_T],T_size); } for (int i=m-1;0<=i;i--){ chmin(g[i],g[i+1]); } for (int i=1;i<=m;i++){ cout << g[i] << "\n"; } }