QOJ.ac

QOJ

时间限制: 0.5 s 内存限制: 512 MB 总分: 100

#11068. 齿轮

统计

一个非常重要且复杂的机器由 $n$ 个轮子组成,编号为 $1, 2, \dots, n$。它们实际上是齿轮,但由于齿非常小,我们可以将它们建模为平面上的圆。每个轮子都可以绕其中心旋转。

两个轮子不能重叠(它们没有公共的内部点),但它们可以相切。如果两个轮子相切,且其中一个轮子转动,另一个轮子也会随之转动,因为它们的微型齿轮咬合在一起。

对 1 号轮子施加一个力(不对其他任何轮子施力),使其以每分钟正好一圈的速度顺时针旋转。计算其他轮子的运动速率。你可以假设机器不会卡住(运动在物理上是可能的)。

输入格式

输入的第一行包含测试用例的数量 $T$。接下来是各测试用例的描述:

每个测试用例的第一行包含轮子的数量 $n$ ($1 \le n \le 1000$)。接下来的 $n$ 行,每行包含三个整数 $x, y$ 和 $r$ ($-10\,000 \le x, y \le 10\,000; 1 \le r \le 10\,000$),其中 $(x, y)$ 表示轮子中心的笛卡尔坐标,$r$ 表示其半径。

输出格式

对于每个测试用例,输出 $n$ 行,每行描述一个轮子的运动,顺序与输入相同。对于每个轮子,输出 $p/q$ clockwise 或 $p/q$ counterclockwise,其中不可约分数 $p/q$ 为该轮子每分钟的转数。如果 $q$ 为 1,则仅输出整数 $p$。如果轮子静止不动,则输出 not moving。

样例

输入 1

1
5
0 0 6
6 8 4
-9 0 3
6 16 4
0 -11 4

输出 1

1 clockwise
3/2 counterclockwise
2 counterclockwise
3/2 clockwise
not moving

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.