QOJ.ac

QOJ

시간 제한: 3.0 s 메모리 제한: 32 MB 총점: 120

#17082. TREZOR

통계

Mirko 决定开一家新公司——银行金库。该银行的一个分行可以被看作一个平面,金库则是平面上的点。Mirko 的分行恰好包含 $L \cdot (A+1+B)$ 个金库,使得以 $(1, -A)$ 和 $(L, B)$ 为对角顶点的矩形内(包含边界)的每个整点都包含一个金库。

这些金库由两名警卫看守——一名位于 $(0, -A)$,另一名位于 $(0, B)$。如果连接警卫和金库的线段上没有其他金库,则警卫可以看到该金库。

如果两名警卫都看不到某个金库,则该金库是不安全的;如果只有一名警卫能看到它,则它是安全的;如果两名警卫都能看到它,则它是超级安全的。

给定 $A$、$B$ 和 $L$,输出不安全、安全和超级安全金库的数量。

输入格式

第一行包含两个由空格隔开的整数 $A$ 和 $B$($1 \le A \le 2000$,$1 \le B \le 2000$)。

第二行包含一个整数 $L$($1 \le L \le 1000000000$)。

输出格式

输出共三行,每行一个整数,分别表示不安全、安全和超级安全金库的数量。

子任务

  • 在占总分 50% 的测试数据中,$L$ 最大为 $1000$。
  • 在另占总分 25% 的测试数据中,$A$ 和 $B$ 最大为 $100$(但 $L$ 可以达到 $10^9$)。

样例

输入样例 1

1 1
3

输出样例 1

2
2
5

输入样例 2

2 3
4

输出样例 2

0
16
8

输入样例 3

7 11
1000000

输出样例 3

6723409
2301730
9974861

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.