程序设计基础一的上机考试题目已在OJ开放,大家可以补题了。

Problem 1334. -- Dart game

1334: Dart game

Time Limit: 1 Sec  Memory Limit: 128 MB   64bit IO Format: %lld
Submitted: 3  Accepted: 2
[Submit][Status][Web Board]

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.
 


Figure:DART BOARD
Darts movement rules of the game is very simple, the target is 1-20 points and the central circle is 50 small zoning, edge is 25 division, the rough circle line of fan-shaped covered area is 1-20 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 N 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 N=4,there are 4 different ways reach to zero:the first is double 2,the second is 2 and double 1, the third is twice of double 1,the fourth is twice of 1 and double 1 .
The answer may be very large,you have to module it by 2011.

Input

   The input contains several test cases.
   Each test case contains an integer N ( 0 < N ≤ 1001 ) in a line.
   N=0 means end of input and need not to process.

Output

  For each test case, output how many different ways to reach zero.

Sample Input

5
4
3
2
1
0

Sample Output

6
4
1
1
0

[Submit][Status][Web Board]