QOJ.ac

QOJ

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

#14058. 七大罪

الإحصائيات

你需要找到 $n$ 个实数 $x_i$,满足以下性质:

对于任意序列 $s_1, \dots, s_n$($s_i \in \{-1, 1\}$),都存在一个实数 $a$,使得对于每个 $1 \le i \le n$,均有 $s_i \cdot \sin(a \cdot \pi \cdot x_i) > 0$。

在找到这些数之后,你还需要向我们证明该性质成立。为此,你需要针对给定的某些序列 $s_i$ 提供对应的 $a$ 值。

输入格式

输入的第一行包含一个整数 $n$($1 \le n \le 100$)。

接下来的行包含查询——每行一个查询。每个查询由 $n$ 个用空格隔开的整数 $s_i \in \{-1, 1\}$ 组成。

输入以单行的一个零结束。查询的总数不会超过 100 个。

输出格式

在输出的第一行,写入 $n$ 个实数 $x_i$。

对于输入中的每个查询,输出一个实数 $a$,使得题目描述中的性质成立。

所有数字必须以定点格式输出。每个数字(包括小数点前后的所有数位)的总位数不能超过 500 位。

你可以假设对你答案的验证是完全精确、没有误差的。

样例

样例输入 1

3
-1 -1 -1
1 -1 -1
1 1 -1
1 1 1
0

样例输出 1

1.0 2.0 3.0
1.72
0.53
0.36
2.24

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.