#Lutece0927. Dart game
Dart game
Migrated from Lutece 927 Dart game
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Darts originated in Australia. Australia's aborigines initially for hunting and hit the enemy's weapon.
A game of darts in which the players attempt to score points by throwing the darts at a target.
Darts movement rules of the game is very simple, the target is - points and the central circle is small zoning, edge is division, the rough circle line of fan-shaped covered area is - points and three times the corresponding division. This game is generally played by two people but can be played by teams. Each player starts with N points. The goal for each player is to reach zero by subtracting the amount they score from the amount they had left,but final throwing must be double division. And the first to reduce his/her score to zero wins.
So the task is :
Given a dart scores that a player starts with, you are required to calculate how many different ways to reach zero. One is different way to another means at least one dart hits different division.Ways which have different orders and same divisions are the same way. For example,if ,there are different ways reach to zero:the first is double , the second is and double , the third is twice of double ,the fourth is twice of and double .
The answer may be very large,you have to module it by .
Input
The input contains several test cases.
Each test case contains an integer in a line.
means end of input and need not to process.
Output
For each test case, output how many different ways to reach zero.
Samples
5
4
3
2
1
0
6
4
1
1
0
Note
: no way
Resources
2011 Heilongjiang collegiate programming contest