#A. [CCC2022 S1] Good Fours and Good Fives

    Type: RemoteJudge 1000ms 128MiB

[CCC2022 S1] Good Fours and Good Fives

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

Finn\rm Finn 非常喜欢 4455,他认为所有的数都可以用 4455 进行相加得出。

例:

14=5+5+414=5+5+4

20=4+4+4+4+420=4+4+4+4+420=5+5+5+520=5+5+5+5

40=4+4+4+4+4+4+4+4+4+440=4+4+4+4+4+4+4+4+4+440=4+4+4+4+4+5+5+5+540=4+4+4+4+4+5+5+5+540=5+5+5+5+5+5+5+540=5+5+5+5+5+5+5+5

当然,4455 的顺序并不重要,重要的是他们的个数。

给你一个正整数 nn,问有多少种方法可以用 4455 拼凑成 nn

输入格式

一行,一个整数 nn,表示要被拼凑的数。

输出格式

一行,表示方法的数量。如果这个数不能被拼凑,请输出 00

14
1
40
3
6
0

提示

对于 20%20\% 的数据:1n101\le n\le 10

对于另外 15%15\% 的数据:1n1051\le n\le10^5 并且保证 n0n\equiv0 (mod4)\pmod 4

对于另外 15%15\% 的数据:1n1051\le n\le10^5 并且保证 n0n\equiv0 (mod5)\pmod 5

对于 100%100\% 的数据:1n1061\le n\le 10^6

B班基础题单竞速3

Not Attended
Status
Done
Rule
Ledo
Problem
6
Start at
2024-8-9 8:25
End at
2024-8-9 10:25
Duration
2 hour(s)
Host
Partic.
12