//完全背包 求方案数目 //f[i][j] 只从前i个物品中选,且总体积恰好为j的方案的集合 //f[i][j]=f[i-1][j]+f[i-1][j-v*1]+f[i-1][j-v*2]+...f[i-1][j-v*s] //f[i][j-v]= f[i-1][j-v*1]+f[i-1][j-v*2]+...f[i-1][j-v*s] //所以 f[i][j]=f[i-1][j]+f[i][j-v] #include <iostream> using namespace std; const int N = 1010; int n; int v[4] = {10, 20, 50, 100}; int f[N]; int main() { cin >> n; f[0] = 1; for (int i = 0; i < 4; i ++ ) for (int j = v[i]; j <= n; j ++ ) f[j] =f[j] + f[j - v[i]]; cout << f[n] << endl; return 0; }