#include #include using namespace std; using mint = atcoder::modint998244353; int main(){ ios::sync_with_stdio(false); cin.tie(0); int Q, pre = 1; cin >> Q; vector> query(Q); for(int i = 0; i < Q; i++){ int cmd, n, k; cin >> cmd >> n >> k; query[i] = make_tuple(k, n, i); } sort(query.begin(), query.end()); vector ans(Q), dp(4001); dp[0] = 1; for(auto &&[k, n, idx] : query){ while(pre <= k){ for(int i = pre; i <= 4000; i++) dp[i] += dp[i - pre]; pre++; } ans[idx] = dp[n]; } for(auto &&v : ans) cout << v.val() << '\n'; }