Codeforces Round 132 (Div. 2)
C
Crosses
Codeforces
2100
原题
← BD →
翻译中…

There is a board with a grid consisting of $*n*$ rows and $*m*$ columns, the rows are numbered from $1$ from top to bottom and the columns are numbered from $1$ from left to right. In this grid we will denote the cell that lies on row number $*i*$ and column number $*j*$ as $(*i*, *j*)$.

翻译中…

A group of six numbers $(*a*, *b*, *c*, *d*, *x*_{0}, *y*_{0})$, where $0 ≤ *a*, *b*, *c*, *d*$, is a cross, and there is a set of cells that are assigned to it. Cell $(*x*, *y*)$ belongs to this set if at least one of two conditions are fulfilled:

翻译中…
  • $|*x*_{0} - *x*| ≤ *a*$ and $|*y*_{0} - *y*| ≤ *b*$
  • $|*x*_{0} - *x*| ≤ *c*$ and $|*y*_{0} - *y*| ≤ *d*$
翻译中…

image The picture shows the cross $(0, 1, 1, 0, 2, 3)$ on the grid $3 × 4$.

翻译中…

Your task is to find the number of different groups of six numbers, $(*a*, *b*, *c*, *d*, *x*_{0}, *y*_{0})$ that determine the crosses of an area equal to $*s*$, which are placed entirely on the grid. The cross is placed entirely on the grid, if any of its cells is in the range of the grid (that is for each cell $(*x*, *y*)$ of the cross $1 ≤ *x* ≤ *n*; 1 ≤ *y* ≤ *m*$ holds). The area of the cross is the number of cells it has.

翻译中…

Note that two crosses are considered distinct if the ordered groups of six numbers that denote them are distinct, even if these crosses coincide as sets of points.

翻译中…

Input

翻译中…

The input consists of a single line containing three integers $*n*$, $*m*$ and $*s*$ ($1 ≤ *n*, *m* ≤ 500$, $1 ≤ *s* ≤ *n*·*m*$). The integers are separated by a space.

翻译中…

Output

翻译中…

Print a single integer — the number of distinct groups of six integers that denote crosses with area $*s*$ and that are fully placed on the $*n* × *m*$ grid.

翻译中…

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

翻译中…

Note

翻译中…

In the first sample the sought groups of six numbers are: $(0, 0, 0, 0, 1, 1)$, $(0, 0, 0, 0, 1, 2)$, $(0, 0, 0, 0, 2, 1)$, $(0, 0, 0, 0, 2, 2)$.

翻译中…

In the second sample the sought groups of six numbers are: $(0, 1, 1, 0, 2, 2)$, $(0, 1, 1, 0, 2, 3)$, $(1, 0, 0, 1, 2, 2)$, $(1, 0, 0, 1, 2, 3)$.

翻译中…

样例

Input #1
2 2 1
Output #1
4
InputCopy OutputCopy
Input #2
3 4 5
Output #2
4
InputCopy OutputCopy
题目信息
题号
215C
时间限制
2 s
内存限制
256 MB
标签
暴力
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。