Universal Cup Judging System

Universal Cup

시간 제한: 2.0 s 메모리 제한: 1024 MB 총점: 100 난이도: [표시] 해킹 가능 ✓
통계

アロナ(Arona)は地区大会(regional championship)で優勝したいと思っています。そこでプラナ(Plana)は、「領域(region)」というキーワードに基づいてアロナのために次の問題を作成しました。

3 つの整数 $n$, $m$, $k$ が与えられます。平面上に $n$ 個の円、$m$ 個の三角形、$k$ 本の直線を描き、平面をできるだけ多くの領域に分割する必要があります。

もちろん、アロナの画力と数学力は非常に乏しいです。そのため、彼女はあなたに助けを求めに来ました。

入力

複数のテストケースが与えられます。入力の 1 行目には、テストケースの個数を表す整数 $T$ ($1 \le T \le 5 \times 10^3$) が与えられます。各テストケースについて:

唯一の行に、円、三角形、直線の個数を表す 3 つの整数 $n$, $m$, $k$ ($0 \le n, m, k \le 100$, $n + m + k > 0$) が与えられます。

すべてのテストケースにおける $(\max(n, m, k))^3$ の総和は $10^7$ を超えないことが保証されています。

出力

各テストケースについて:

まず、分割によって得られる領域の最大個数を表す 1 つの整数を 1 行に出力してください。

次に、$n$ 行出力してください。各行には、円の中心の座標および半径を表す 3 つの整数 $x$, $y$, $R$ ($-10^3 \le x, y \le 10^3$, $1 \le R \le 10^3$) を空白区切りで出力してください。

続いて、$m$ 行出力してください。各行には、三角形の 3 頂点の座標を表す 6 つの整数 $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$ 行出力してください。各行には、直線上の 2 点の座標を表す 4 つの整数 $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

注記

3 番目のサンプルテストケースは以下の通りです。

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.