U Cluj

Time limit: 3s Memory limit: 512MB Input: Output:

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 NN and an integer PP. For every KK from 11 to PP, compute the number of ways you can write NN as a sum of KK numbers which can be written as 2x12^x - 1 for some integer x1x \geq 1, modulo 109+710^9 + 7".

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, NN and PP.

Output data

The first line of the output contains PP integers, separated by spaces. The KthK^{th} integer represents the number of ways you can write NN as a sum of KK numbers which can be written as 2x12^x - 1 for some integer x1x \geq 1, modulo 109+710^9 + 7.

Constraints and clarifications

  • 1N10181 \leq N \leq 10^{18}.
  • 1P5001 \leq P \leq 500.
# Points Restrictions
1 7 1N5001 \leq N \leq 500, 1P151 \leq P \leq 15
2 14 1N50 0001 \leq N \leq 50 \ 000, 1P501 \leq P \leq 50
3 28 1P501 \leq P \leq 50
4 22 1P1501 \leq P \leq 150
5 29 No additional constraints.

Example 1

stdin

4 2

stdout

0 1

Explanation

For K=1K = 1, there exists no solution.
For K=2K = 2, 4=3+14 = 3 + 1.

Example 2

stdin

14 4

stdout

0 1 0 1

Explanation

For K=1K = 1, there exists no solution.
For K=2K = 2, 14=7+714 = 7 + 7.
For K=3K = 3, there exists no solution.
For K=4K = 4, 14=7+3+3+114 = 7 + 3 + 3 + 1.

Example 3

stdin

9 3

stdout

0 0 2

Explanation

For K=1K = 1, there exists no solution.
For K=2K = 2, there exists no solution.
For K=3K = 3, 9=3+3+39 = 3 + 3 + 3 and 9=7+1+19 = 7 + 1 + 1.

Log in or sign up to be able to send submissions!