Count how many different arrays a[1], a[2], ..., a[n] where a[i] receives integer values positive in paragraph [1, M] so that there exists at least one paragraph K of the same consecutive value ?. Here the two arrays are different if there exists at least one position where the two array values are in this position is different (n, M, K <= 1e6) e.g: input: 3 2 2 output: 6