#abc281e. E - Least Elements
E - Least Elements
Score : points
问题描述
你给定一个整数序列 ,其长度为 ,以及整数 和 。
对于每个 ,独立解决以下问题。
求在升序排列的 个整数 的有序列表中,前 个值的和。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given an integer sequence of length , and integers and .
For each , solve the following independent problem.
Find the sum of the first values in the sorted list of the integers in ascending order.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Let be the answer to the problem for , and print them in the following format:
Sample Input 1
6 4 3
3 1 4 1 5 9
Sample Output 1
5 6 10
- For , sorting in ascending order yields , where the sum of the first three values is .
- For , sorting in ascending order yields , where the sum of the first three values is .
- For , sorting in ascending order yields , where the sum of the first three values is .
Sample Input 2
10 6 3
12 2 17 11 19 8 4 3 6 20
Sample Output 2
21 14 15 13 13
update @ 2024/3/10 11:48:29