Score : $500$ points
You are given a sequence $A=(A_0,A_1,\ldots,A_{N-1})$ of length $N$.
There is an initially empty dish. Takahashi is going to repeat the following operation $K$ times.
Find how many candies are on the dish after the $K$ operations.
Input is given from Standard Input in the following format:
$N$ $K$ $A_0$ $A_1$ $\ldots$ $A_{N-1}$
Print the answer.
5 3 2 1 6 3 1
11
The number of candies on the dish transitions as follows.
Thus, after the $3$ operations, there will be $11$ candies on the dish. Note that you must not print the remainder divided by $N$.
10 1000000000000 260522 914575 436426 979445 648772 690081 933447 190629 703497 47202
826617499998784056
The answer may not fit into a $32$-bit integer type.