众所周知,伯兰的跳蚤只能垂直和水平跳跃,跳跃的长度总是等于s厘米。一只跳蚤发现自己处于 n×m 厘米大小的格子板某个牢房的中心(每个牢房为 1×1 厘米)。她可以随心所欲地跳跃任意次数,甚至可以不止一次访问牢房。唯一的限制是她不能跳出棋盘。
跳蚤可以计算她可以从起始位置(x,y)到达的细胞数量。让我们用dx,y.您的任务是找到此类起始位置 (x,y) 的数量,其最大可能值为dx,y.
It is known that fleas in Berland can jump only vertically and horizontally, and the length of the jump is always equal to s centimeters. A flea has found herself at the center of some cell of the checked board of the size n×m centimeters (each cell is 1×1 centimeters). She can jump as she wishes for an arbitrary number of times, she can even visit a cell more than once. The only restriction is that she cannot jump out of the board.
2 3 1000000
6
3 3 2
4
第一行包含三个整数 n、m、s (1≤n,m,s≤106) − 板的长度、板的宽度和跳蚤跳跃的长度。
输出唯一的整数 - 跳蚤所需的起始位置的数量。
Input
2 3 1000000
6
3 3 2
4
3 3 2
4