#t503. 最小函数值

最小函数值

Minimum Function Value

Problem Background

Special for beginners, ^_^

Problem Description

There are nn functions F1,F2,…,FnF_1, F_2, \dots, F_n. They are defined as Fi(x)=Aix2+Bix+CiF_i(x) = A_i x^2 + B_i x + C_i (x∈N∗x \in N^*). Given Ai,Bi,CiA_i, B_i, C_i, find the smallest mm values among all the function values produced by all the functions (output a value as many times as it occurs if there are duplicates).

Input Format

The first line contains two positive integers nn and mm.

The following nn lines each contain three positive integers: the ii-th line gives AiA_i, BiB_i and CiC_i. The input guarantees Ai≤10A_i \le 10, Bi≤100B_i \le 100, Ci≤10000C_i \le 10000.

Output Format

Output the first mm elements after sorting all the function values that can be generated by the nn functions. These mm numbers should be printed on one line, separated by spaces.

Sample Input

3 10
4 5 3
3 4 5
1 7 1

Sample Output

9 12 12 19 25 29 31 44 45 54

Constraints

Time limit: 1s; memory limit: 1024 KiB for each test case. n,m≤10000n, m \le 10000.