#include #include #include #include using mint = atcoder::modint; constexpr int N = 100000; int main() { int n, m, c; std::cin >> n >> m >> c; mint::set_mod(m); std::vector a(n); for (auto &e : a) std::cin >> e; std::sort(a.begin(), a.end(), std::greater()); const int s = std::accumulate(a.begin(), a.end(), 0); bool take_compl = 2 * c >= n; if (take_compl) { c = n - c; } std::vector dp(c + 1, std::vector(s + 1)); dp[0][0] = 1; for (int val : a) { for (int num = std::min(c, s / val); num >= 1; --num) { for (int sum = num * val; sum <= s; ++sum) { dp[num][sum] += dp[num - 1][sum - val]; } } } for (int sum = 1; sum <= s; ++sum) { std::cout << dp[c][take_compl ? s - sum : sum].val() << " \n"[sum == s]; } return 0; }