Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define FOR(i,m,n) for(ll i=(m);i<(n);++i)
#define dFOR(i,m,n) for(ll i=(m)-1;i>=(n);--i)
#define rep(i,n) FOR(i,0,(n))
#define drep(i,n) dFOR(i,(n)-1,(0)) // decrease
#define rng(a) (a).begin(),(a).end()
#define rrng(a) (a).rbegin(),(a).rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
typedef vector<T> vt;
//inline int in() { int x; scanf("%d",&x); return x;}
inline ll in() { ll x; cin >> x; return x; }
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10; //epsilon
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;
#define chmin(x,y) x = min(x,y)

const int MOD = 1000000007;
struct mint {
  ll x;
  mint(ll x=0):x(x%MOD){}
  mint& operator+=(const mint a) { if ((x += a.x) >= MOD) x -= MOD; return *this; }
  mint& operator-=(const mint a) { if ((x += MOD-a.x) >= MOD) x -= MOD; return *this; }
  mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this; }
  mint operator+(const mint a) const { mint res(*this); return res+=a; }
  mint operator-(const mint a) const { mint res(*this); return res-=a; }
  mint operator*(const mint a) const { mint res(*this); return res*=a; }
  mint operator++() { return *this = mint(x + 1); }
  mint operator--() { return *this = mint(x - 1); }
};

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
map<ll, ll> prime_factor(ll n) {
  map<ll, ll> ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}

const int MAX = 1001001;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++){
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
ll nCr(int n, int k){
  if (n < k || n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

struct Edge { int to, id;};
vv(Edge) e;
vi c;
void dfs(int v, int color=-1, int from=-1) {
  int cnt = 1;
  rep(i,e[v].size()) {
    int eid = e[v][i].id;
    if (e[v][i].to == from) continue;
    if (cnt == color) ++cnt;
    c[eid] = cnt; ++cnt;
    dfs(e[v][i].to,c[eid],v);
  }
}

/*-------------------------------------------------*/
mint comb[2521][2521];
mint cb(mint a, mint b) {
  if (b<0||b>a||a<0) return 0;
  return comb[a][b];
}
int main() {
  ll n=in(), k=in(); // n-k:red,k:blue
  rep(i,2521)rep(j,2521){
    if(i==j||j==0)comb[i][j]=1;
    else if(j>i)comb[i][j]=0;
    else comb[i][j]=comb[i-1][j]+comb[i-1][j-1];
  }
  FOR(i,1,k+1){
    mint ans = cb(n-k+1,i)*cb(k-1,i-1);
    cout << and << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'mint cb(mint, mint)':
a.cc:122:8: error: no match for 'operator<' (operand types are 'mint' and 'int')
  122 |   if (b<0||b>a||a<0) return 0;
      |       ~^~
      |       | |
      |       | int
      |       mint
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
                 from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
 1143 |     operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
 1224 |     operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1317 |     operator<(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
 1391 |     operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1485 |     operator<(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
 1560 |     operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
 1660 |     operator<(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1045 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::pair<_T1, _T2>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  448 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::reverse_iterator<_Iterator>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  493 |     operator<(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::reverse_iterator<_Iterator>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1694 |     operator<(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::move_iterator<_IteratorL>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1760 |     operator<(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::move_iterator<_IteratorL>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
  673 |     operator< (basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'std::basic_string_view<_CharT, _Traits>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
  680 |     operator< (basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'std::basic_string_view<_CharT, _Traits>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
  688 |     operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3874 |     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
 3888 |     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note:   template argument deduction/substitution failed:
a.cc:122:9: note:   'mint' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  122 |   if (b<0||b>a||a<0) return 0;
      |         ^
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candi