#include <vector>
#include <stddef.h>
#include <stdio.h>
int count(int n) {
std::vector<int> moves = { 3, 5, 10 };
std::vector<int> c(n + 1, 0);
c[0] = 1;
for (int m : moves) for (size_t i = m; i <= n; ++i) c[i] += c[i - m];
return c[n];
}
int main(void) {
int n = 20;
printf("Count for %d is %d\n", n, count(n));
n = 13;
printf("Count for %d is %d", n, count(n));
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHN0ZGRlZi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCmludCBjb3VudChpbnQgbikgewogICAgc3RkOjp2ZWN0b3I8aW50PiBtb3ZlcyA9IHsgMywgNSwgMTAgfTsKICAgIHN0ZDo6dmVjdG9yPGludD4gYyhuICsgMSwgMCk7CiAgICBjWzBdID0gMTsKICAgIGZvciAoaW50IG0gOiBtb3ZlcykgZm9yIChzaXplX3QgaSA9IG07IGkgPD0gbjsgKytpKSBjW2ldICs9IGNbaSAtIG1dOwogICAgcmV0dXJuIGNbbl07Cn0KaW50IG1haW4odm9pZCkgewogICAgaW50IG4gPSAyMDsKICAgIHByaW50ZigiQ291bnQgZm9yICVkIGlzICVkXG4iLCBuLCBjb3VudChuKSk7CiAKICAgIG4gPSAxMzsKICAgIHByaW50ZigiQ291bnQgZm9yICVkIGlzICVkIiwgbiwgY291bnQobikpOwogICAgcmV0dXJuIDA7Cn0=