Macau casino has a popular game: horse racing. However, the rule is different from the normal ones. It is about guessing the kth fastest horse. Joy wants to apply a job in the casino, but his boss give him a test. He can get the job only if he passes the test. The rules are as followed:

Given the strength of n horses, (to simplify, the strength of the n horses is a permutation of 1 to n, and horse with larger strength run faster), the boss wants to know the sum of all the kth fastest horse in every consecutive interval of the n horses, and remember only the intervals equal or longer than k should be considered.

Joy is not good at math, so he turns to you for help.