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 , there is one way to do this which is . As another example, if Finn wants to form the number , this can be done two ways, which are and . As a final example, Finn can form the number in three ways: , , and .
Your task is to help Finn determine the number of ways that a number can be written as a sum of fours and fives.
The input consists of one line containing a number .
The following table shows how the available marks are distributed.
| Marks Awarded | Bounds on | Additional Constraints |
|---|---|---|
| 3 marks | None | |
| 2 marks | is a multiple of | |
| 2 marks | is a multiple of | |
| 8 marks | None |
Output the number of unordered sums of fours and fives which form the number . Output if there are no such sums of fours and fives.
This is one of the examples in the problem description.
This is one of the examples in the problem description.
There is no way to use a sum of fours and fives to get .
No comments yet. Be the first to comment!