Language: C++

//照れ照れ
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define mp make_pair
#define fi first
#define se second
#define pb push_back

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 998244353;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

ll fastPow(ll x, ll n)
{
    if (n == 0)
        return 1;
    if (n % 2 == 0)
        return fastPow(x * x % MOD, n / 2);
    else
        return x * fastPow(x, n - 1) % MOD;
}

ll fac[112345];
void combInit(int mx)
{
    fac[0] = 0;
    fac[1] = 1;
    for (int i = 2; i <= mx; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
    }
}

ll modDiv(ll a, ll b)
{
    return a * fastPow(b, MOD - 2) % MOD;
}

ll comb(ll a, ll b)
{
    if (b == 0)
        return 1;
    if (a < b)
        return 0;
    if (a <= 0 || b < 0)
        return 0;
    if (a == b)
        return 1;

    ll p, c;

    c = modDiv(fac[a], fac[a - b]);
    p = fac[b];

    ll res = modDiv(c, p);

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    combInit(112343);

    ll p2[2010];

    p2[0] = 1;
    for (int i = 1; i <= 2000; i++)
        p[i] = p[i - 1] * 2 % MOD;

    int k, n;
    cin >> k >> n;

    for (int i = 2; i <= 2 * k; i++)
    {
        ll res = 0;

        int p = 0;
        for (int j = 1; j <= i / 2; j++)
        {
            if (i - j <= k)
                p++;
        }

        if (p < 1)
        {
            cout << 0 << endl;
            continue;
        }

        if (i % 2)
        {
            for (int j = 0; j <= p; j++)
            {
                if ((k - j - (p - j) * 2) >= 0 && (n - j) >= 0)
                    res += p2[j] % MOD * comb(p, j) % MOD * comb(k - j - (p - j) * 2 + n - j - 1, n - j) % MOD;
                res %= MOD;
            }
        }
        else
        {
            p--;

            //不使用
            for (int j = 0; j <= p; j++)
            {
                if ((k - j - (p - j) * 2 - 1) >= 0 && (n - j) >= 0)
                    res += p2[j] % MOD * comb(p, j) % MOD * comb(k - j - (p - j) * 2 - 1 + n - j - 1, n - j) % MOD;
                res %= MOD;
            }

            //使用
            for (int j = 0; j <= p; j++)
            {
                if ((k - j - (p - j) * 2 - 1) >= 0 && (n - j - 1) >= 0)
                    res += p2[j] % MOD * comb(p, j) % MOD * comb(k - j - (p - j) * 2 - 1 + n - j - 1 - 1, n - j - 1) % MOD;
                res %= MOD;
            }
        }

        res += MOD;
        res %= MOD;

        cout << res << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:97:9: error: 'p' was not declared in this scope
   97 |         p[i] = p[i - 1] * 2 % MOD;
      |         ^