P5646 ygg's Problem Set

Background

ygg's problem set has broken again and again and again!

Description

ygg decides to use his power to forcibly reset his problem set. However, the problem set that ygg built by hand is not easy to deal with. When this intelligent, self-aware system realizes it is about to be reset, it quickly changes the administrator password to stop the reset. ygg finds this intelligent agent and locks it up immediately, but the administrator password has already been changed. ygg is very troubled, because his power cannot help him crack the password. After studying the agent, ygg discovers that the agent's mind stores a **floating-point** array $P$ of length $n$. It claims that if you take every number in $P$, **round it to exactly five digits after the decimal point**, and then join them with spaces, you will get the password. But the agent refuses to reveal what $P$ actually is. ygg continues his research and finds that the agent will consider a number $X$ to be beautiful if and only if $$ \sum_{i=0}^{n-1}P_i\cdot X^i>0 $$ So ygg gives the agent $m$ numbers and asks whether each is beautiful. ygg hopes to use these data to recover the array $P$, and thus retrieve the password. Since the answer is not unique, you only need to output any valid solution. See the notes/hints for details.

Input Format

The first line contains two integers $n$ and $m$. The next $m$ lines each contain a **floating-point number** $a$ and a boolean value (0/1), indicating whether the agent thinks $a$ is beautiful.

Output Format

Output one line with $n$ floating-point numbers, representing the array $P$ (rounded in the way described in the statement: keep five digits after the decimal point, and join with spaces). **The answer is not unique, but you must ensure that the absolute value of each number in** $P$ **is within** $5000$.

Explanation/Hint

$1\le n \le 32$, $15\le m \le 4,000$, $-5,000 \le a_i \le 5,000$, $-5,000 \le P_i \le 5,000$. Since there may be multiple solutions, this problem uses a $\text{Special Judge}$ to verify the answer. If the $P$ you output satisfies all input conditions, or **the number of errors is less than or equal to 5**, you will get full score. Otherwise, you will get a score of $\text{total points of this test}\cdot\frac{\text{number of correct answers}}{\text{total number of answers}}$ for that test. The testdata satisfy the following Constraints: | Test Point ID | $n$ | $m$ | | --------- | -------------- | ------------------- | | $1\sim 10$ | $1\le n \le 4$ | $15\le m\le 20$ | | $11\sim 20$ | $4\le n\le 32$ | $15\le m\le 4,000$ | Translated by ChatGPT 5