CF703B Mishka and trip
Description
Little Mishka is a great traveller and she visited many countries. After thinking about where to travel this time, she chose XXX — beautiful, but little-known northern country.
Here are some interesting facts about XXX:
1. XXX consists of $ n $ cities, $ k $ of whose (just imagine!) are capital cities.
2. All of cities in the country are beautiful, but each is beautiful in its own way. Beauty value of $ i $ -th city equals to $ c_{i} $ .
3. All the cities are consecutively connected by the roads, including $ 1 $ -st and $ n $ -th city, forming a cyclic route $ 1—2—...—n—1 $ . Formally, for every $ 1
Input Format
The first line of the input contains two integers $ n $ and $ k $ ( $ 3
Output Format
Print the only integer — summary price of passing each of the roads in XXX.
Explanation/Hint
This image describes first sample case:

It is easy to see that summary price is equal to $ 17 $ .
This image describes second sample case:

It is easy to see that summary price is equal to $ 71 $ .