question archive Chef has a sequence of integers AAANB For each integer which appears in B 1,2,
Subject:Computer SciencePrice: Bought3
Chef has a sequence of integers AAANB For each integer which appears in B
1,2,...,. He takes a sheet of paper and for each non-empty subsequence of this sequence, he does the following:
For each integer between 1 and N inclusive, find out how many times it appears on Chef's sheet of paper. Since these numbers may be very large, compute them modulo 1,000,000,007 (10^9+7).
Input
Output
For each test case, print a single line containing N space-separated integers. For each valid i, the i-th of these integers should be the number of occurrences of i on Chef's sheet of paper.
Example Input
3 3 2 2 3 2 1 2 3 1 2 2
Example Output
0 6 1 2 1 3 4 0