Fake Maxpooling
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Given a matrix of size and an integer , where , the least common multiple of and . You should determine the sum of the maximums among all submatrices.

输入描述:

Only one line containing three integers .

输出描述:

Only one line containing one integer, denoting the answer.
示例1

输入

复制
3 4 2

输出

复制
38

说明

The given matrix is:
1 2 3 4
2 2 6 4
3 6 3 12
The maximums among all 2\times 2 submatrices are {2, 6, 6, 6, 6, 12} respectively, and their sum is {38}.