Everyone Loves Permutations
A permutation of length is an array of length containing all integers from to , and all its elements are pairwise distinct.
Having grown up and played with arrays, Anton moved on to studying more interesting arrays — permutations. While writing his thesis, he faced a very difficult task.
He has a permutation of length and an integer . He decided to construct a two-dimensional array with sizes .
for all ();
for all () and ().
Let and , then we have the following array.
For each (), he wants to know the sum of all such that , where . In other words, he wants to find the sum of numbers — the indices of the number in each .
Consider the last example. If , the answer will be .
After some deliberation and simple ideas, Anton managed to solve this problem quickly. Now he wants to check if you can solve it too.
Input
The first line of the input contains two integers , (, ) — the length of the permutation and the number of repetitions of operations, respectively.
The second line contains the permutation ().
Output
Print integers, where the -th number is the answer for .
Examples
Scoring
( points): ;
( points): ;
( points): ;
( points): , for any and , there exists a such that , where the nesting is taken times;
( points): for any and , there exists a such that , where the nesting is taken times;
( points): without additional restrictions.