#include #include using namespace std; using mint = atcoder::modint998244353; int main(){ ios::sync_with_stdio(false); cin.tie(0); vector> dp(4001, vector(4001)); dp[0][0] = 1; for(int i = 1; i <= 4000; i++){ dp[i] = dp[i - 1]; for(int j = 0; j + i <= 4000; j++){ dp[i][j + i] += dp[i][j]; } } int Q; cin >> Q; while(Q--){ int cmd, n, k; cin >> cmd >> n >> k; cout << dp[k][n].val() << '\n'; } }