严格意义上讲不是动态规划,是递推题目
#include <stdio.h>
long long dp[7490][6];
int main(void){
int i, j;
long long sum;
dp[0][0] = 1; dp[0][1] = dp[0][2] = dp[0][3] = dp[0][4] = dp[0][5] = 0;
for(i=1; i<=7489; i++){
for(j=1; j<=5; j++){
dp[i][j] = 0;
if(5 == j){
if(i>50) {dp[i][j] += dp[i-50][5]; dp[i][j] += dp[i-50][4]; dp[i][j] += dp[i-50][3]; dp[i][j] += dp[i-50][2]; dp[i][j] += dp[i-50][1];}
else if(50 == i){dp[i][j] = 1;}
}
else if(4 == j){
if(i>25) {dp[i][j] += dp[i-25][4]; dp[i][j] += dp[i-25][3]; dp[i][j] += dp[i-25][2]; dp[i][j] += dp[i-25][1];}
else if(25 == i){dp[i][j] = 1;}
}
else if(3 == j){
if(i>10) {dp[i][j] += dp[i-10][3]; dp[i][j] += dp[i-10][2]; dp[i][j] += dp[i-10][1];}
else if(10 == i) {dp[i][j] = 1;}
}
else if(2 == j){
if(i>5) {dp[i][j] += dp[i-5][2]; dp[i][j] += dp[i-5][1];}
else if(5 == i) {dp[i][j] = 1;}
}
else if(1 == j){
if(i>1) {dp[i][j] += dp[i-1][1];}
else if(1 == i) {dp[i][j] = 1;}
}
}
}
int mon;
//freopen("input.dat", "r", stdin);
while(scanf("%d",&mon) != EOF){
if(0 == mon){
printf("1\n");
continue;
}
sum = 0;
for(i=0; i<=5; i++){
sum += dp[mon][i];
}
printf("%lld\n", sum);
}
return 0;
}