QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 32 MB Total points: 100

#5300. Rectangles 2

统计

How many rectangles can you find in the figure below?

problem_10659_1.gif

We have found: 6 rectangles 1 × 1, 4 rectangles 2 × 1, 3 rectangles 1 × 2, 2 rectangles 2 × 2, 2 rectangles 3 × 1 and one rectangle 3 × 2, what gives 18 in total. Clearly, we are interested in rectangles with vertices in grid points, i.e., the points located at the intersections of vertical and horizontal line segments, and having vertical or horizontal sides. The above grid has dimensions 3 × 2.

And how many such rectangles of perimeter at least 6 can be found in the figure? You can find the answer in the Example section.

Input Format

The first and only line of the standard input contains three integers: $n$, $m$ and $p$ (1$ ≤ n, m ≤ 5\,000$, $4 ≤ p ≤ 2(n+m)$), representing the dimensions of the grid and the lower bound for the perimeter of the rectangles.

Output Format

In the first line of the standard output your program should output one integer: the number of rectangles with vertices in grid points of the grid $n × m$, having vertical or horizontal sides and which perimeter is at least $p$.

Example

Input

3 2 4

Output

18

Input 2

3 2 6

Output 2

12
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.