题目描述
You are given a grid of size M x N, where each square is colored with some random color among K colors with each having equal probability.
A Good Rectangle is defined as one where all squares lying on the inner border are of the same color.
What is the expected number of Good Rectangles in the given grid.
-----Input-----
- First Line contains M, N, K
-----Output-----
A single value rounded off to the nearest Integer corresponding to the required answer.
-----Constraints-----
- 1 <= N <= 105
- 1 <= M <= 105
- 1 <= K <= 105
-----Example-----
Input:
1 3 1
Output:
6
输入格式
见题面
输出格式
见题面
样例输入
['1 3 1']
样例输出
['6']