QOJ.ac

QOJ

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

#13878. 平衡委员会

الإحصائيات

皮尔特沃夫市议会正在召开一次紧急会议。尽管局势严峻,但议会的官僚作风迫使他们优先考虑平衡座位,而不是实际讨论局势。在市政厅里,有 $N$ 个座位和 $M$ 位议员。保证 $N$ 是一个偶数。这 $N$ 个座位在一个圆周上均匀分布,每位议员将恰好占用一个唯一的座位。如果座位安排的平均位置位于圆心,则称该座位安排是“平衡”的。

假设 $M$ 位议员就座于点 $(x_1, y_1), (x_2, y_2), \dots, (x_M, y_M)$。该安排的平均位置是点 $(A_x, A_y)$,其中:

$$A_x = \frac{x_1 + x_2 + \dots + x_M}{M}$$

$$A_y = \frac{y_1 + y_2 + \dots + y_M}{M}$$

圆心是到所有座位距离相等的唯一一点。给定座位数和议员数,是否存在一种平衡的安排?

输入格式

输入只有一行,包含两个空格分隔的整数 $N$ ($4 \le N \le 2 \cdot 10^9$) 和 $M$ ($1 \le M \le N$),其中 $N$ 是座位数,$M$ 是议员数。保证 $N$ 是一个偶数。

输出格式

如果存在平衡的安排,输出 Yes,否则输出 No

样例

输入样例 1

6 4

输出样例 1

Yes

输入样例 2

8 7

输出样例 2

No

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.