题目描述
Problem Description
In a Cartesian coordinate system, there is a rectangle with diagonally opposite corners at $(1, -A)$ and $(L, B)$. This rectangle contains $L \times (A + 1 + B)$ points.
There are two guards positioned at $(0, -A)$ and $(0, B)$, both facing the rectangle. A guard cannot see a point within the rectangle if there is another point blocking the line of sight to that point.
For each point:
- If it can be seen by both guards, it is considered very safe;
- If it can be seen by only one guard, it is considered safe;
- If it cannot be seen by either guard, it is considered dangerous.
Given $A, B, L$, you need to determine the number of very safe, safe, and dangerous points.
Input Format
The first line contains two integers $A, B$.
The second line contains one integer $L$.
Output Format
Output three lines. Each line contains one integer, representing the number of dangerous, safe, and very safe points respectively.
Sample Input and Output
Input Sample #1
1 1
3
Output Sample #1
2
2
5
Input Sample #2
2 3
4
Output Sample #2
0
16
8
Input Sample #3
7 11
1000000
Output Sample #3
6723409
2301730
9974861
Notes
Data Size and Constraints
- For $50\%$ of the data, $L \le 1000$;
- For another $25\%$ of the data, $A, B \le 100$;
- For $100\%$ of the data, $1 \le A, B \le 2000$, $1 \le L \le 10^9$.
Notes
This problem is translated from COCI2008-2009 CONTEST #4 T5 TREZOR.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分