Task
After RANDy sold U Cluj for their terrible performance last season, he is now wondering what to invest the money into. After hearing about the prestigious fireman olympiad, he had a marvelous idea: a fireman department business.
You are very eager to become a fireman, so you go to an interview and got the following question: "You are given an integer and an integer . For every from to , compute the number of ways you can write as a sum of numbers which can be written as for some integer , modulo ".
RANDy promises you that if you solve this problem, he will give you his best hose and put it on your shoulder, thus making you the most prolific fireman the world has ever seen, and you can be sure you'll get the gold medal at the fireman olympics!
Input data
The first line of the input contains two integers, and .
Output data
The first line of the output contains integers, separated by spaces. The integer represents the number of ways you can write as a sum of numbers which can be written as for some integer , modulo .
Constraints and clarifications
- .
- .
# | Points | Restrictions |
---|---|---|
1 | 7 | , |
2 | 14 | , |
3 | 28 | |
4 | 22 | |
5 | 29 | No additional constraints. |
Example 1
stdin
4 2
stdout
0 1
Explanation
For , there exists no solution.
For , .
Example 2
stdin
14 4
stdout
0 1 0 1
Explanation
For , there exists no solution.
For , .
For , there exists no solution.
For , .
Example 3
stdin
9 3
stdout
0 0 2
Explanation
For , there exists no solution.
For , there exists no solution.
For , and .