#T110. 最小函数值 (minval)
最小函数值 (minval)
Description
There are functions, denoted as . Each function is defined as where .
Given the coefficients , , and for each function, determine the smallest function values among all possible values generated by these functions (if there are duplicates, output them multiple times).
Input Format
The first line contains two positive integers and .
Each of the following lines contains three positive integers representing the coefficients , , and for the -th function. It is guaranteed that , , and .
Output Format
Output the first smallest function values from the sorted list of all possible values generated by these functions. The numbers should be printed on a single line, separated by spaces.
3 10
4 5 3
3 4 5
1 7 1
9 12 12 19 25 29 31 44 45 54
Hint
【Data Scale】 .