#P2085. 最小函数值
最小函数值
Description
There are functions, denoted . Define for . Given these , , and , find the smallest values among all function values of all 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 integers; on the -th line they are , , and .
Output Format
Output the first elements of the sorted sequence of all function values generated by the functions. Print these numbers on one 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
Constraints
For all test points, it is guaranteed that , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号