Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define fst first
#define snd second
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
ll ncr(ll n, ll r){
  ll de = 1;
  ll nu = 1;
  REP(i, r){
    nu *= (n - i) % MOD;
    de *= (r - i) % MOD;
  }
  return (nu / de) % MOD;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, k;
  cin >> n >> k;
  VL ans(k, 0);
  for(int i = 1; i <= k; i++){
    if((n - k) < i - 1) break;
    else{
      ll res = n - k - (i - 1);
      if(i == 1) ans[i-1] = res + 1 % MOD;
      else ans[i-1] = ncr(k - 1, i - 1) % MOD * ncr(res + i, min(i, res)) % MOD;
    }
  }
  REP(i, k) out(ans[i]);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:65: error: no matching function for call to 'min(int&, ll&)'
   45 |       else ans[i-1] = ncr(k - 1, i - 1) % MOD * ncr(res + i, min(i, res)) % MOD;
      |                                                              ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:45:65: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   45 |       else ans[i-1] = ncr(k - 1, i - 1) % MOD * ncr(res + i, min(i, res)) % MOD;
      |                                                              ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:45:65: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   45 |       else ans[i-1] = ncr(k - 1, i - 1) % MOD * ncr(res + i, min(i, res)) % MOD;
      |                                                              ~~~^~~~~~~~