P8395 [CCC 2022 S1] Good Fours and Good Fives
题目描述
$\rm Finn$ 非常喜欢 $4$ 和 $5$,他认为所有的数都可以用 $4$ 和 $5$ 进行相加得出。
例:
$14=5+5+4$
$20=4+4+4+4+4$ 或 $20=5+5+5+5$
$40=4+4+4+4+4+4+4+4+4+4$ 或 $40=4+4+4+4+4+5+5+5+5$ 或 $40=5+5+5+5+5+5+5+5$
当然,$4$ 和 $5$ 的顺序并不重要,重要的是他们的个数。
给你一个正整数 $n$,问有多少种方法可以用 $4$ 和 $5$ 拼凑成 $n$。
输入格式
无
输出格式
无
说明/提示
对于 $20\%$ 的数据:$1\le n\le 10$
对于另外 $15\%$ 的数据:$1\le n\le10^5$ 并且保证
$n\equiv0$ $\pmod 4$
对于另外 $15\%$ 的数据:$1\le n\le10^5$ 并且保证
$n\equiv0$ $\pmod 5$
对于 $100\%$ 的数据:$1\le n\le 10^6$