Language: C++

#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>

#include<queue>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1844674407370955161
typedef long long int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

template<typename T>
T gcd(T a,T b){
	if(b>0){
		return gcd(b, a % b);
	}else{
		return a;
	}
}

template<typename T>
T lcm(T a,T b){
	T g = gcd(a, b);
	return a * b / g;
}

void clear( std::queue<pair<int,int> > &q )
{
   std::queue<pair<int,int> > empty;
   std::swap( q, empty );
}
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
template<typename T>
std::vector<T> enum_div(T n)//nの約数を列挙
{
	std::vector<T> ret;
	for(T i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}


class DisjointSet{
    public:
        vector<int> rank, p;

        DisjointSet(){
        }

        DisjointSet(int size){
            rank.resize(size, 0);
            p.resize(size, 0);
            for (int i = 0; i < size;i++){
                makeSet(i);
            }
        }
        void makeSet(int x){
            p[x] = x;
            rank[x] = 0;
        }

        bool same(int x,int y){
            return findSet(x) == findSet(y);
        }
        void unite(int x,int y){
            link(findSet(x), findSet(y));
        }
        void link(int x,int y){
            if(rank[x]>rank[y]){
                p[y] = x;
            }else{
                p[x] = y;
                if(rank[x]==rank[y]){
                    rank[y]++;
                }
            }
        }
        int findSet(int x){
            if(x!=p[x]){
                p[x] = findSet(p[x]);
            }
            return p[x];
        }
};

ll N, K;

vector<ll> fac(4002); //n!(mod M)
vector<ll> ifac(4002);

ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % MOD;
        x = x*x % MOD;
        n = n >> 1;
    }
    return ans;
}

ll comb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % MOD;
    tmp%=MOD;
    return tmp * fac[a] % MOD;
}


int main()
{
    
    cin >> N >> K;
    
    fac[0] = 1;
    ifac[0] = 1;
    for(ll i = 0; i<4001; i++){
        fac[i+1] = fac[i]*(i+1) % MOD; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, MOD-2) % MOD; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }
    if(N==1){
        cout<<2<<endl;
        return 0;
    }

    for(ll i = 1; i<=K; i++){
        if(i>N-K+1){
            cout<<0<<endl;
        }else{
        ll ans = (comb(N - K + 1, i)%MOD) * (mpow(i, K - i)%MOD)%MOD;
        ans %= MOD;
        cout << ans<< endl;
        }
    }
}#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>

#include<queue>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1844674407370955161
typedef long long int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

template<typename T>
T gcd(T a,T b){
	if(b>0){
		return gcd(b, a % b);
	}else{
		return a;
	}
}

template<typename T>
T lcm(T a,T b){
	T g = gcd(a, b);
	return a * b / g;
}

void clear( std::queue<pair<int,int> > &q )
{
   std::queue<pair<int,int> > empty;
   std::swap( q, empty );
}
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
template<typename T>
std::vector<T> enum_div(T n)//nの約数を列挙
{
	std::vector<T> ret;
	for(T i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}


class DisjointSet{
    public:
        vector<int> rank, p;

        DisjointSet(){
        }

        DisjointSet(int size){
            rank.resize(size, 0);
            p.resize(size, 0);
            for (int i = 0; i < size;i++){
                makeSet(i);
            }
        }
        void makeSet(int x){
            p[x] = x;
            rank[x] = 0;
        }

        bool same(int x,int y){
            return findSet(x) == findSet(y);
        }
        void unite(int x,int y){
            link(findSet(x), findSet(y));
        }
        void link(int x,int y){
            if(rank[x]>rank[y]){
                p[y] = x;
            }else{
                p[x] = y;
                if(rank[x]==rank[y]){
                    rank[y]++;
                }
            }
        }
        int findSet(int x){
            if(x!=p[x]){
                p[x] = findSet(p[x]);
            }
            return p[x];
        }
};

ll N, K;

vector<ll> fac(4002); //n!(mod M)
vector<ll> ifac(4002);

ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % MOD;
        x = x*x % MOD;
        n = n >> 1;
    }
    return ans;
}

ll comb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % MOD;
    tmp%=MOD;
    return tmp * fac[a] % MOD;
}


int main()
{
    
    cin >> N >> K;
    
    fac[0] = 1;
    ifac[0] = 1;
    for(ll i = 0; i<4001; i++){
        fac[i+1] = fac[i]*(i+1) % MOD; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, MOD-2) % MOD; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }
    if(N==1){
        cout<<2<<endl;
        return 0;
    }

    for(ll i = 1; i<=K; i++){
        if(i>N-K+1){
            cout<<0<<endl;
        }else{
        ll ans = (comb(N - K + 1, i)%MOD) * (mpow(i, K - i)%MOD)%MOD;
        ans %= MOD;
        cout << ans<< endl;
        }
    }
}

Compiler output:
a.cc:181:2: error: stray '#' in program
  181 | }#include <iostream>
      |  ^
a.cc:181:3: error: 'include' does not name a type
  181 | }#include <iostream>
      |   ^~~~~~~
a.cc:200:5: error: redefinition of 'template<class T> int vector_finder(std::vector<_Tp>, T)'
  200 | int vector_finder(std::vector<T> vec, T number) {
      |     ^~~~~~~~~~~~~
a.cc:20:5: note: 'template<class T> int vector_finder(std::vector<_Tp>, T)' previously declared here
   20 | int vector_finder(std::vector<T> vec, T number) {
      |     ^~~~~~~~~~~~~
a.cc:212:3: error: redefinition of 'template<class T> T gcd(T, T)'
  212 | T gcd(T a,T b){
      |   ^~~
a.cc:32:3: note: 'template<class T> T gcd(T, T)' previously declared here
   32 | T gcd(T a,T b){
      |   ^~~
a.cc:221:3: error: redefinition of 'template<class T> T lcm(T, T)'
  221 | T lcm(T a,T b){
      |   ^~~
a.cc:41:3: note: 'template<class T> T lcm(T, T)' previously declared here
   41 | T lcm(T a,T b){
      |   ^~~
a.cc:226:6: error: redefinition of 'void clear(std::queue<std::pair<int, int> >&)'
  226 | void clear( std::queue<pair<int,int> > &q )
      |      ^~~~~
a.cc:46:6: note: 'void clear(std::queue<std::pair<int, int> >&)' previously defined here
   46 | void clear( std::queue<pair<int,int> > &q )
      |      ^~~~~
a.cc:231:6: error: redefinition of 'bool IsPrime(int)'
  231 | bool IsPrime(int num)
      |      ^~~~~~~
a.cc:51:6: note: 'bool IsPrime(int)' previously defined here
   51 | bool IsPrime(int num)
      |      ^~~~~~~
a.cc:251:16: error: redefinition of 'template<class T> std::vector<_Tp> enum_div(T)'
  251 | std::vector<T> enum_div(T n)//nの約数を列挙
      |                ^~~~~~~~
a.cc:71:16: note: 'template<class T> std::vector<_Tp> enum_div(T)' previously declared here
   71 | std::vector<T> enum_div(T n)//nの約数を列挙
      |                ^~~~~~~~
a.cc:269:7: error: redefinition of 'class DisjointSet'
  269 | class DisjointSet{
      |       ^~~~~~~~~~~
a.cc:89:7: note: previous definition of 'class DisjointSet'
   89 | class DisjointSet{
      |       ^~~~~~~~~~~
a.cc:312:4: error: redefinition of 'll N'
  312 | ll N, K;
      |    ^
a.cc:132:4: note: 'll N' previously declared here
  132 | ll N, K;
      |    ^
a.cc:312:7: error: redefinition of 'll K'
  312 | ll N, K;
      |       ^
a.cc:132:7: note: 'll K' previously declared here
  132 | ll N, K;
      |       ^
a.cc:314:12: error: redefinition of 'std::vector<long long int> fac'
  314 | vector<ll> fac(4002); //n!(mod M)
      |            ^~~
a.cc:134:12: note: 'std::vector<long long int> fac' previously declared here
  134 | vector<ll> fac(4002); //n!(mod M)
      |            ^~~
a.cc:315:12: error: redefinition of 'std::vector<long long int> ifac'
  315 | vector<ll> ifac(4002);
      |            ^~~~
a.cc:135:12: note: 'std::vector<long long int> ifac' previously declared here
  135 | vector<ll> ifac(4002);
      |            ^~~~
a.cc:317:4: error: redefinition of 'll mpow(ll, ll)'
  317 | ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
      |    ^~~~
a.cc:137:4: note: 'll mpow(ll, ll)' previously defined here
  137 | ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
      |    ^~~~
a.cc:327:4: error: redefinition of 'll comb(ll, ll)'
  327 | ll comb(ll a, ll b){ //aCbをmod計算
      |    ^~~~
a.cc:147:4: note: 'll comb(ll, ll)' previously defined here
  147 | ll comb(ll a, ll b){ //aCbをmod計算
      |    ^~~~
a.cc:336:5: error: redefinition of 'int main()'
  336 | int main()
      |     ^~~~
a.cc:156:5: note: 'int main()' previously defined here
  156 | int main()
      |     ^~~~