4067: 【14NOIP提高组】解方程

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:1

Description

已知多项式方程:n$a_0 + a_1x + a_2x^2 + ... + a_nx^n = 0$n求这个方程在$[1, m]$内的整数解($n$ 和 $m$ 均为正整数)。

Input

输入共 $n+2$ 行。 n第一行包含 $2$ 个整数 $n、m$,每两个整数之间用一个空格隔开。 n接下来的 $n+1$ 行每行包含一个整数,依次为$a_0,a_1,a_2, … ,a_n$。

Output

第一行输出方程在[$1, m$]内的整数解的个数。 n接下来每行一个整数,按照从小到大的顺序依次输出方程在[$1, m$]内的一个整数解。

Sample Input Copy

2 10
1
-2
1

Sample Output Copy

1
1

Source/Category