// yukicoder: 40 多項式の割り算 // 2019.6.2 bal4u #include #if 1 #define gc() getchar_unlocked() #else #define gc() getchar() #endif int in() // 整数の入力(負数対応) { int n = 0, c = gc(); if (c == '-') { c = gc(); do n = 10*n + (c & 0xf), c = gc(); while (c >= '0'); return -n; } do n = 10*n + (c & 0xf), c = gc(); while (c >= '0'); return n; } int a[10005], D; int ans[3]; // ans: Ax^2 + Bx + C int main() { int i, d, one, mone; D = in(); for (i = 0; i <= D; i++) a[i] = in(); if (D < 3) { for (i = 0; i <= D; i++) ans[i] = a[i]; } else { ans[0] = a[0]; one = mone = 0; for (i = 1; i <= D; i++) { one += a[i]; if (i & 1) mone -= a[i]; else mone += a[i]; } ans[2] = (one + mone) >> 1; ans[1] = one - ans[2]; } d = 0; for (i = 2; i > 0; i--) if (ans[i]) { d = i; break; } printf("%d\n", d); printf("%d", ans[0]); for (i = 1; i <= d; i++) printf(" %d", ans[i]); putchar('\n'); return 0; }