#include #include #include using namespace std; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int main() { int K, N; cin >> K >> N; vectorsteps(N); for (int i=0; i> steps.at(i); } vectordp(K+1); dp[0] = 1; for (int i=0; i<=K; i++) { for (int j=0; j