#P2251. 质量检测
质量检测
Description
To check the quality of a total of products on a production line, we first assign each product a score indicating its quality. Then we compute , the score of the worst-quality product among the first products, and similarly compute the for products through , for products through , ... Finally, compute for products through . We will further evaluate based on .
Please compute the sequence as quickly as possible.
Input Format
The input contains two lines.
The first line contains two numbers and , separated by a space, as described above.
The second line contains numbers, representing the quality scores of the products.
Output Format
Output lines.
Lines through each contain one number. On line , output , as described above.
10 4
16 5 6 9 5 13 14 20 8 12
5
5
5
5
5
8
8
Hint
[Constraints]
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号