Universal Cup Judging System

Universal Cup

Time Limit: 2.0 s Memory Limit: 1024 MB Total points: 100 Difficulty: [show] Hackable ✓
Statistics

Arona 想贏得區域賽冠軍。於是 Plana 根據關鍵詞「區域」為 Arona 出咗以下呢條問題。

俾三個整數 $n$、$m$ 同 $k$,你需要喺平面上面畫 $n$ 個圓、$m$ 個三角形同 $k$ 條直線,將個平面劃分成盡可能多嘅區域。

當然,Arona 嘅畫功同數學能力都相當麻麻。所以佢嚟搵你幫手。

輸入格式

有唔少測試數據。輸入嘅第一行包含一個整數 $T$($1 \le T \le 5 \times 10^3$),表示測試數據嘅數量。對於每組測試數據:

唯一一行包含三個整數 $n$、$m$ 同 $k$($0 \le n, m, k \le 100$,$n + m + k > 0$),分別表示圓、三角形同直線嘅數量。

保證所有測試數據嘅 $(\max(n, m, k))^3$ 之和唔超過 $10^7$。

輸出格式

對於每組測試數據:

首先,輸出一行包含一個整數,表示最多可以劃分出幾多個區域。

然後輸出 $n$ 行。呢啲行入面每一行包含三個用空格隔開嘅整數 $x$、$y$ 同 $R$($-10^3 \le x, y \le 10^3$,$1 \le R \le 10^3$),代表圓心嘅座標同埋圓嘅半徑。

跟住輸出 $m$ 行。呢啲行入面每一行包含六個用空格隔開嘅整數 $x_1$、$y_1$、$x_2$、$y_2$、$x_3$ 同 $y_3$($-10^3 \le x_1, y_1, x_2, y_2, x_3, y_3 \le 10^3$,$(x_1, y_1) \ne (x_2, y_2)$,$(x_1, y_1) \ne (x_3, y_3)$,$(x_2, y_2) \ne (x_3, y_3)$),代表三角形三個頂點嘅座標。

最後輸出 $k$ 行。呢啲行入面每一行包含四個用空格隔開嘅整數 $x_1$、$y_1$、$x_2$ 同 $y_2$($-10^3 \le x_1, y_1, x_2, y_2 \le 10^3$,$(x_1, y_1) \ne (x_2, y_2)$),代表直線上面兩個點嘅座標。

可以證明,就算有上述範圍限制,我哋總係可以達到最優答案。

範例

3
1 0 1
0 1 1
1 1 2
4
0 0 1
-2 0 2 0
4
0 0 0 2 2 0
0 1 1 0
18
3 4 2
2 7 2 1 6 4
3 4 6 4
3 3 3 5

說明

第三個範例測試數據如下圖所示。

problem_14812_478e31d2dc02ec2ad85e008d91ad27d7.png
problem_14812_c49174cf27c03ed0f97fb330c3e4891b.png

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.