#include <iostream> #include <cstring> using namespace std; static const auto Initialize = [] { cin.sync_with_stdio(false); cin.tie(nullptr); return nullptr; }(); int main() { int people, times, DP[30][30][31]; while (cin >> people >> times) { memset(DP, 0, sizeof(DP)); for (int i = 0; i < people; ++i) DP[i][(i + 1) % people][1] = DP[i][(i + people - 1) % people][1] = 1; for (int t = 2; t <= times; ++t) for (int i = 0; i < people; ++i) for (int j = 0; j < people; ++j) DP[i][j][t] = DP[(j + 1) % people][i][t - 1] + DP[(j + people - 1) % people][i][t - 1]; cout << DP[0][0][times] << '\n'; } }