Language: C++

#include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;

template<Int Mod = 1000000007> class modint{
public:
	Int val;
	constexpr modint(const Int x = 0) : val(x % Mod) {if(val < 0) val += Mod;}
	constexpr modint operator+(const modint rhs) const {
		return modint(*this) += rhs;
	}
	constexpr modint operator-(const modint rhs) const {
		return modint(*this) -= rhs;
	}
	constexpr modint operator*(const modint rhs) const {
		return modint(*this) *= rhs;
	}
	constexpr modint operator/(const modint rhs) const {
		return modint(*this) /= rhs;
	}
	constexpr modint operator-() const {
		return modint(Mod - val);
	}
	constexpr modint &operator+=(const modint rhs){
		val += rhs.val;
		if(val >= Mod) val -= Mod;
		return *this;
	}
	constexpr modint &operator-=(const modint rhs){
		if(val < rhs.val) val += Mod;
		val -= rhs.val;
		return *this;
	}
	constexpr modint &operator*=(const modint rhs){
		val *= rhs.val;
		val %= Mod;
		return *this;
	}
	constexpr modint &operator/=(const modint rhs){
		return *this *= inv(rhs);
	}
	constexpr modint &operator++(){
		++val;
		if(val == Mod) val = 0;
		return *this;
	}
	constexpr modint &operator--(){
		--val;
		if(val == -1) val = Mod - 1;
		return *this;
	}
	constexpr modint operator<<(const Int rhs) const {
		return modint(*this) << rhs;
	}
	constexpr modint operator>>(const Int rhs) const {
		return modint(*this) >> rhs;
	}
	constexpr modint &operator<<=(const Int rhs){
		val <<= rhs;
		val %= Mod;
		return *this;
	}
	constexpr modint &operator>>=(const Int rhs){
		val >>= rhs;
		val %= Mod;
		return *this;
	}
	constexpr bool operator==(const modint rhs) const {
		return val == rhs.val;
	}
	constexpr bool operator!=(const modint rhs) const {
		return val != rhs.val;
	}
	constexpr bool operator<(const modint rhs) const {
		return val < rhs.val;
	}
	constexpr bool operator>(const modint rhs) const {
		return val > rhs.val;
	}
	constexpr bool operator<=(const modint rhs) const {
		return val <= rhs.val;
	}
	constexpr bool operator>=(const modint rhs) const {
		return val >= rhs.val;
	}
	friend ostream& operator<<(ostream& os, const modint<Mod>& m){
		return os << m.val;
	}
	friend istream& operator>>(istream& is, modint<Mod>& m){
		return is >> m.val;
	}
	static constexpr modint inv(modint m){
		Int a = m.val, b = Mod, u = 1, v = 0;
		while(b){
			Int t = a / b;
			a -= t * b;
			swap(a, b);
			u -= t * v;
			swap(u, v);
		}
		u %= Mod;
		if(u < 0) u += Mod;
		return modint(u);
	}
	static vector<modint> fact;
	static constexpr modint comb(modint n, modint r){
		if(fact.empty()) fact.push_back(1);
		while(Int(fact.size()) <= Int(n))
			fact.push_back(fact.back() * modint(fact.size()));
		return fact[n] / fact[r] / fact[n-r];
	}
	constexpr operator Int() const {
		return val;
	}
};

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	Int n, k; cin >> n >> k;
	using mint = modint<>;
	for(Int i=1; i<=k; ++i){
		mint ans = mint::comb(n-k+1, i) * mint::comb(k-1, i-1);
		cout << ans << "\n";
	}
}

Compiler output:
/usr/bin/ld: /tmp/ccBVCF2O.o: warning: relocation against `_ZN6modintILl1000000007EE4factE' in read-only section `.text._ZN6modintILl1000000007EE4combES0_S0_[_ZN6modintILl1000000007EE4combES0_S0_]'
/usr/bin/ld: /tmp/ccBVCF2O.o: in function `modint<1000000007l>::comb(modint<1000000007l>, modint<1000000007l>)':
a.cc:(.text._ZN6modintILl1000000007EE4combES0_S0_[_ZN6modintILl1000000007EE4combES0_S0_]+0x16): undefined reference to `modint<1000000007l>::fact'
/usr/bin/ld: a.cc:(.text._ZN6modintILl1000000007EE4combES0_S0_[_ZN6modintILl1000000007EE4combES0_S0_]+0x45): undefined reference to `modint<1000000007l>::fact'
/usr/bin/ld: a.cc:(.text._ZN6modintILl1000000007EE4combES0_S0_[_ZN6modintILl1000000007EE4combES0_S0_]+0x56): undefined reference to `modint<1000000007l>::fact'
/usr/bin/ld: a.cc:(.text._ZN6modintILl1000000007EE4combES0_S0_[_ZN6modintILl1000000007EE4combES0_S0_]+0x77): undefined reference to `modint<1000000007l>::fact'
/usr/bin/ld: a.cc:(.text._ZN6modintILl1000000007EE4combES0_S0_[_ZN6modintILl1000000007EE4combES0_S0_]+0xa3): undefined reference to `modint<1000000007l>::fact'
/usr/bin/ld: /tmp/ccBVCF2O.o:a.cc:(.text._ZN6modintILl1000000007EE4combES0_S0_[_ZN6modintILl1000000007EE4combES0_S0_]+0xb2): more undefined references to `modint<1000000007l>::fact' follow
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status