//#define _GLIBCXX_DEBUG #include using namespace std; #if __has_include() #include using namespace atcoder; using mint = modint1000000007; // using mint = modint998244353; // using mint = modint; // const int MOD = mint::mod(); #endif #ifdef LOCAL_DEBUG #define cout cout<<' ' #endif using ll = long long; template using pqg = priority_queue, greater>; // constexpr int MOD = (int)1e9 + 7; // constexpr int MOD = (int)998244353; constexpr int INF = (int)1e9 + 1001010; constexpr ll llINF = (ll)4e18 + 11000010; constexpr double PI = 3.14159265358979; constexpr double EPS = 1e-10; #define Isize(x) (int)(size(x)) #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(),(x).rend() #define UNIQUE(x) (x).erase(unique(ALL(x)), (x).end()); #define endn "\n" #define SUM(v) accumulate(ALL(v), 0LL) #define MIN(v) *min_element(ALL(v)) #define MAX(v) *max_element(ALL(v)) #define popcount __builtin_popcount #define popcountll __builtin_popcountll template inline vector> vector2(const size_t &i, const size_t &j, const T &init = T()) { return vector>(i, vector(j, init)); } template inline vector>> vector3(const size_t &i, const size_t &j, const int &k, const T &init = T()) { return vector>>(i, vector>(j, vector(k, init))); } template inline vector>>> vector4(const size_t &i, const size_t &j, const size_t &k, const size_t &l, const T &init = T()) { return vector>>>(i, vector>>(j, vector>(k, vector(l, init)))); } const string VEC_ELEM_SEPARATION = " "; const string VEC_VEC_SEPARATION = endn; template istream & operator >> (istream &i, vector &A) {for(auto &I : A) {i >> I;} return i;} template ostream & operator << (ostream &o, const vector> &A) {int i=A.size(); for(auto &I : A){o << I << (--i ? VEC_VEC_SEPARATION : "");} return o;} template ostream & operator << (ostream &o, const vector &A) {int i=A.size(); for(auto &I : A){o << I << (--i ? VEC_ELEM_SEPARATION : "");} return o;} template ostream & operator << (ostream &o, const deque &A) {int i=A.size(); for(auto &I : A){o << I << (--i ? VEC_ELEM_SEPARATION : "");} return o;} template istream & operator >> (istream &i, pair &A) {i >> A.first >> A.second; return i;} template ostream & operator << (ostream &o, const pair &A) {o << A.first << " " << A.second; return o;} template istream & operator >> (istream &i, tuple&A) {i >> get<0>(A) >> get<1>(A) >> get<2>(A); return i;} template ostream & operator << (ostream &o, const tuple &A) {o << get<0>(A) << " " << get<1>(A) << " " << get<2>(A); return o;} template vector& operator ++(vector &A, int n) {for(auto &I : A) {I++;} return A;} template vector& operator --(vector &A, int n) {for(auto &I : A) {I--;} return A;} template bool chmax(T &a, const U &b){return ((a < b) ? (a = b, true) : false);} template bool chmin(T &a, const U &b){return ((a > b) ? (a = b, true) : false);} ll floor(ll a, ll b){assert(b != 0); return((a%b != 0 && ((a>0) != (b>0))) ? a/b-1 : a/b);} ll ceil (ll a, ll b){assert(b != 0); return((a%b != 0 && ((a>0) == (b>0))) ? a/b+1 : a/b);} ll gcd(ll a, ll b){return ((b==0) ? a : gcd(b, a%b));} ll lcm(ll a, ll b){return a / gcd(a,b) * b;} bool is_in(ll inf, ll n, ll sup){return(inf <= n && n <= sup);} // ================================== ここまでテンプレ ================================== template< class T > struct Matrix { vector< vector< T > > A; Matrix() {} Matrix(size_t n, size_t m) : A(n, vector< T >(m, 0)) {} Matrix(size_t n) : A(n, vector< T >(n, 0)) {}; size_t size() const { if(A.empty()) return 0; assert(A.size() == A[0].size()); return A.size(); } size_t height() const { return (A.size()); } size_t width() const { return (A[0].size()); } inline const vector< T > &operator[](int k) const { return (A.at(k)); } inline vector< T > &operator[](int k) { return (A.at(k)); } static Matrix I(size_t n) { Matrix mat(n); for(int i = 0; i < n; i++) mat[i][i] = 1; return (mat); } Matrix &operator+=(const Matrix &B) { size_t n = height(), m = width(); assert(n == B.height() && m == B.width()); for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) (*this)[i][j] += B[i][j]; return (*this); } Matrix &operator-=(const Matrix &B) { size_t n = height(), m = width(); assert(n == B.height() && m == B.width()); for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) (*this)[i][j] -= B[i][j]; return (*this); } Matrix &operator*=(const Matrix &B) { size_t n = height(), m = B.width(), p = width(); assert(p == B.height()); vector< vector< T > > C(n, vector< T >(m, 0)); for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) for(int k = 0; k < p; k++) C[i][j] = (C[i][j] + (*this)[i][k] * B[k][j]); A.swap(C); return (*this); } Matrix &operator^=(long long k) { Matrix B = Matrix::I(height()); while(k > 0) { if(k & 1) B *= *this; *this *= *this; k >>= 1LL; } A.swap(B.A); return (*this); } Matrix operator+(const Matrix &B) const { return (Matrix(*this) += B); } Matrix operator-(const Matrix &B) const { return (Matrix(*this) -= B); } Matrix operator*(const Matrix &B) const { return (Matrix(*this) *= B); } Matrix operator^(const long long k) const { return (Matrix(*this) ^= k); } friend ostream &operator<<(ostream &os, Matrix &p) { size_t n = p.height(), m = p.width(); for(int i = 0; i < n; i++) { os << "["; for(int j = 0; j < m; j++) { os << p[i][j] << (j + 1 == m ? "]\n" : ","); } } return (os); } T determinant() { Matrix B(*this); assert(width() == height()); T ret = 1; for(int i = 0; i < width(); i++) { int idx = -1; for(int j = i; j < width(); j++) { if(B[j][i] != 0) idx = j; } if(idx == -1) return (0); if(i != idx) { ret *= -1; swap(B[i], B[idx]); } ret *= B[i][i]; T vv = B[i][i]; for(int j = 0; j < width(); j++) { B[i][j] /= vv; } for(int j = i + 1; j < width(); j++) { T a = B[j][i]; for(int k = 0; k < width(); k++) { B[j][k] -= B[i][k] * a; } } } return (ret); } }; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n, k, l; cin >> n >> k >> l; Matrix mat(n); for(int i = 0; i < n; i++){ for(int j = 1; j <= l; j++){ mat[i][(i+j)%n] = 1; } } Matrix init(n, 1); init[0][0] = 1; auto ans = (mat^k) * init; for(int i = 0; i < n; i++){ cout << ans[i][0].val() << endn; } return 0; }