#GD0000002. Nước ép hỗn hợp (Mix Juice)
Nước ép hỗn hợp (Mix Juice)
Mix Juice
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
A shop sells fruit types, and type costs . Choose exactly distinct types and buy one item of each. Find the minimum total price.
Input
The first line contains . The second line contains .
Output
Print the minimum total price.
Subtasks
General constraints:
-
.
-
.
-
Subtask 1 (20 points):
-
Subtask 2 (30 points):
-
Subtask 3 (50 points): No additional constraints.
Examples
Input
5 3
50 100 80 120 80
Output
210
Explanation
The three smallest prices are , whose sum is .