#include <iostream>
#include <cstring>
using namespace std;
const int N = 11;
int n, m;
int f[N][N];
int main()
{
int T;
cin >> T;
while (T -- )
{
cin >> m >> n;
memset(f, 0, sizeof f);
f[0][0] = 1;
for (int i = 0; i <= m; i ++ )
for (int j = 1; j <= n; j ++ )
{
f[i][j] = f[i][j - 1];
if (i >= j) f[i][j] += f[i - j][j];
}
cout << f[m][n] << endl;
}
return 0;
}
信息学奥赛一本通——鸣人的影分身
于 2023-02-03 00:07:49 首次发布