#include #include using namespace std; int main() { int d; cin >> d; vector a(d + 1); for (int i = 0; i <= d; ++i) { cin >> a[i]; } vector dividend(a); for (int i = d; i >= 3; --i) { int coef = dividend[i]; int power = i - 3; vector minuend(d + 1); // x^3 * coef * x ^ power minuend[power + 3] = coef; // -x * coef * x ^ power minuend[power + 1] = -coef; for (int k = d; k >= 0; --k) { dividend[k] -= minuend[k]; } } int dd; for (dd = dividend.size() - 1; dd > 0 && dividend[dd] == 0; --dd) { } cout << dd << endl; for (int i = 0; i <= dd; ++i) { cout << dividend[i] << " "; } cout << endl; }