#include #include using namespace std; using namespace atcoder; using ll = long long; using mint = modint998244353; vector> partition(ll n, ll m){ vector res(n+1, vector(m+1)); res[0][0] = 1; for (int i=0; i<=n; i++){ for (int j=1; j<=m; j++){ res[i][j] = res[i][j-1]; if (i >= j) res[i][j] += res[i-j][j]; } } return res; } vector> partition2(ll n, ll m){ vector res(n+1, vector(m+1)); res[0][0] = 1; for (int i=0; i<=n; i++){ for (int j=1; j<=m; j++){ res[i][j] = res[i][j-1]; if (i >= j) res[i][j] += res[i-j][j]; } } return res; } int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); /* M(i, j) = iの分割で最大値がjのもの M(i, j) = sum_{k=0}^{i/j} M(i-kj, j-1) = L(i, j) */ int N=4000, M=4000; vector> a; a = partition(N, M); int Q, t, x, y; cin >> Q; while(Q--){ cin >> t >> x >> y; cout << a[x][y].val() << endl; } return 0; }