Canadian Computing Competition: 2022 Stage 1, Senior #1
Finn loves Fours and Fives. In fact, he loves them so much that he wants to know the number
of ways a number can be formed by using a sum of fours and fives, where the order of the
fours and fives does not matter. If Finn wants to form the number
Your task is to help Finn determine the number of ways that a number can be written as a sum of fours and fives.
Input Specification
The input consists of one line containing a number
The following table shows how the available
Marks Awarded | Bounds on | Additional Constraints |
---|---|---|
None | ||
None |
Output Specification
Output the number of unordered sums of fours and fives which form the number
Sample Input 1
14
Output for Sample Input 1
1
Explanation of Output for Sample Input 1
This is one of the examples in the problem description.
Sample Input 2
40
Output for Sample Input 2
3
Explanation of Output for Sample Input 2
This is one of the examples in the problem description.
Sample Input 3
6
Output for Sample Input 3
0
Explanation of Output for Sample Input 3
There is no way to use a sum of fours and fives to get
Comments
use the combination of 4 and 5 to do this https://dmoj.ca/src/6228667
why 1gb memory limit?
CCC gives you a large memory limit for most problems.