QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 512 MB مجموع النقاط: 100

#3075. 工厂

الإحصائيات

工厂里有一台非常重要且复杂的机器,由 $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$ 是其半径。

输入文件的大小不超过 0.2 MiB(约 60 组数据)。

输出格式

对于每个测试用例,输出 $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.