#D1388. Shopping
Shopping
Shopping
Example
Input
10 3 3 7 8 9 2 5
Output
23
inputFormat
Input
10 3 3 7 8 9 2 5
outputFormat
Output
23
样例
10 3
3 7
8 9
2 5
23
Example
Input
10 3 3 7 8 9 2 5
Output
23
Input
10 3 3 7 8 9 2 5
Output
23
10 3
3 7
8 9
2 5
23
By signing up a OpenJudge universal account, you can submit code and join discussions in all online judging services provided by us.