luogu#P5248. [LnOI2019SP] 快速多项式变换(FPT)
[LnOI2019SP] 快速多项式变换(FPT)
Background

Problem Description
This is a constructive problem.
Shino thinks of a polynomial with terms. The degree of the -th term is , and its coefficient is :
Given and the value of (that is, the value of this polynomial when ), please construct a polynomial such that for any , is a non-negative integer.
Let the number of terms of the polynomial you construct be . Then it must satisfy , and the leading coefficient must be non-zero.
Input Format
Two integers, and .
Output Format
The first line outputs a positive integer , which represents the number of terms of the polynomial.
The second line outputs non-negative integers ( to ) in order, with exactly one space between each pair of adjacent integers.
10 10
2
0 1
Hint
For of the testdata, .
For of the testdata, .
For all testdata, the time limit is and the memory limit is . You may enable O2 optimization.
Translated by ChatGPT 5