Language: C++

struct mint {
   ll x;
   mint(ll x = 0) : x((x % mod + mod) % mod) {}
   mint operator-() const { return mint(-x); }
   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 { return mint(*this) += a; }
   mint operator-(const mint a) const { return mint(*this) -= a; }
   mint operator*(const mint a) const { return mint(*this) *= a; }
   mint pow(ll t) const {
      if (!t) return 1;
      mint a = pow(t >> 1);
      a *= a;
      if (t & 1) a *= *this;
      return a;
   }

   mint inv() const { return pow(mod - 2); }
   mint& operator/=(const mint a) { return *this *= a.inv(); }
   mint operator/(const mint a) const { return mint(*this) /= a; }
};

mint c[4005][4005];
void init() {
   c[0][0] = 1;
   rep(i, 0, 4001) {
      rep(j, 0, i + 1) {
         c[i + 1][j] += c[i][j];
         c[i + 1][j + 1] += c[i][j];
      }
   }
}
mint comb(int n, int k) { return c[n][k]; }
mint f2(int n, int k) { return comb(n + k - 1, k - 1); }
mint f(int n, int k) {
   if (n < k) return 0;
   if (n == 0 && k == 0) return 1;
   if (k < 1) return 0;
   return f2(n - k, k);
}

int main() {
   init();
   int n, k;
   cin >> n >> k;
   rep(i, 1, k + 1) {
      mint blue = f(k, i);
      mint red = 0;

      red += f(n - k, i - 1);
      red += f(n - k, i);
      red += f(n - k, i);
      red += f(n - k, i + 1);
      mint ans = blue * red;
      printf("%lld\n", ans.x);
   }
   return 0;
}

Compiler output:
a.cc:2:4: error: 'll' does not name a type
    2 |    ll x;
      |    ^~
a.cc:3:11: error: expected ')' before 'x'
    3 |    mint(ll x = 0) : x((x % mod + mod) % mod) {}
      |        ~  ^~
      |           )
a.cc:20:13: error: 'll' has not been declared
   20 |    mint pow(ll t) const {
      |             ^~
a.cc: In member function 'mint mint::operator-() const':
a.cc:4:42: error: 'x' was not declared in this scope
    4 |    mint operator-() const { return mint(-x); }
      |                                          ^
a.cc: In member function 'mint& mint::operator+=(mint)':
a.cc:6:12: error: 'x' was not declared in this scope
    6 |       if ((x += a.x) >= mod) x -= mod;
      |            ^
a.cc:6:19: error: 'const struct mint' has no member named 'x'
    6 |       if ((x += a.x) >= mod) x -= mod;
      |                   ^
a.cc:6:25: error: 'mod' was not declared in this scope
    6 |       if ((x += a.x) >= mod) x -= mod;
      |                         ^~~
a.cc: In member function 'mint& mint::operator-=(mint)':
a.cc:10:12: error: 'x' was not declared in this scope
   10 |       if ((x += mod - a.x) >= mod) x -= mod;
      |            ^
a.cc:10:17: error: 'mod' was not declared in this scope
   10 |       if ((x += mod - a.x) >= mod) x -= mod;
      |                 ^~~
a.cc:10:25: error: 'const struct mint' has no member named 'x'
   10 |       if ((x += mod - a.x) >= mod) x -= mod;
      |                         ^
a.cc: In member function 'mint& mint::operator*=(mint)':
a.cc:14:8: error: 'x' was not declared in this scope
   14 |       (x *= a.x) %= mod;
      |        ^
a.cc:14:15: error: 'const struct mint' has no member named 'x'
   14 |       (x *= a.x) %= mod;
      |               ^
a.cc:14:21: error: 'mod' was not declared in this scope
   14 |       (x *= a.x) %= mod;
      |                     ^~~
a.cc: In member function 'mint mint::pow(int) const':
a.cc:21:22: error: could not convert '1' from 'int' to 'mint'
   21 |       if (!t) return 1;
      |                      ^
      |                      |
      |                      int
a.cc: In member function 'mint mint::inv() const':
a.cc:28:34: error: 'mod' was not declared in this scope
   28 |    mint inv() const { return pow(mod - 2); }
      |                                  ^~~
a.cc: In function 'void init()':
a.cc:35:14: error: no match for 'operator=' (operand types are 'mint' and 'int')
   35 |    c[0][0] = 1;
      |              ^
a.cc:1:8: note: candidate: 'constexpr mint& mint::operator=(const mint&)'
    1 | struct mint {
      |        ^~~~
a.cc:1:8: note:   no known conversion for argument 1 from 'int' to 'const mint&'
a.cc:1:8: note: candidate: 'constexpr mint& mint::operator=(mint&&)'
a.cc:1:8: note:   no known conversion for argument 1 from 'int' to 'mint&&'
a.cc:36:8: error: 'i' was not declared in this scope
   36 |    rep(i, 0, 4001) {
      |        ^
a.cc:36:4: error: 'rep' was not declared in this scope
   36 |    rep(i, 0, 4001) {
      |    ^~~
a.cc: In function 'mint f(int, int)':
a.cc:46:22: error: could not convert '0' from 'int' to 'mint'
   46 |    if (n < k) return 0;
      |                      ^
      |                      |
      |                      int
a.cc:47:33: error: could not convert '1' from 'int' to 'mint'
   47 |    if (n == 0 && k == 0) return 1;
      |                                 ^
      |                                 |
      |                                 int
a.cc:48:22: error: could not convert '0' from 'int' to 'mint'
   48 |    if (k < 1) return 0;
      |                      ^
      |                      |
      |                      int
a.cc: In function 'int main()':
a.cc:55:4: error: 'cin' was not declared in this scope
   55 |    cin >> n >> k;
      |    ^~~
a.cc:56:8: error: 'i' was not declared in this scope
   56 |    rep(i, 1, k + 1) {
      |        ^
a.cc:56:4: error: 'rep' was not declared in this scope
   56 |    rep(i, 1, k + 1) {
      |    ^~~