Time limit: 1.0 /
Memory limit: 256M
Point: 7

![]()
Ví dụ :
Input
5 2
2 1 2 1 6
Output
7
Nguồn
Time limit: 1.0 /
Memory limit: 256M
Point: 7

![]()
Ví dụ:
Input
10000 12000
Output
9
Nguồn
Time limit: 1.0 /
Memory limit: 256M
Point: 6

![]()
Ví dụ:
Input
5 2
2
3
5
1
4
Output
15
Nguồn