#P5646. ygg的题库

ygg的题库

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 PP of length nn. It claims that if you take every number in PP, 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 PP actually is.

ygg continues his research and finds that the agent will consider a number XX to be beautiful if and only if

i=0n1PiXi>0\sum_{i=0}^{n-1}P_i\cdot X^i>0

So ygg gives the agent mm numbers and asks whether each is beautiful. ygg hopes to use these data to recover the array PP, 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 nn and mm.

The next mm lines each contain a floating-point number aa and a boolean value (0/1), indicating whether the agent thinks aa is beautiful.

Output Format

Output one line with nn floating-point numbers, representing the array PP (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 PP is within 50005000.

5 5
-2.6 0
-1.8 0
0.6 1
0 0
1 1

-1.90000 2.60000 0.80000 1.70000 0.66600
4 10
4995.35 1
-341.076 0
2658.4 1
-1624.69 0
2856.53 1
3746.43 1
3454.28 1
1560.6 1
3785.31 1
-580.728 0
670.15800 4361.39000 3761.88000 4575.00000

Hint

1n321\le n \le 32, 15m4,00015\le m \le 4,000, 5,000ai5,000-5,000 \le a_i \le 5,000, 5,000Pi5,000-5,000 \le P_i \le 5,000.

Since there may be multiple solutions, this problem uses a Special Judge\text{Special Judge} to verify the answer. If the PP 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 nn mm
1101\sim 10 1n41\le n \le 4 15m2015\le m\le 20
112011\sim 20 4n324\le n\le 32 15m4,00015\le m\le 4,000

Translated by ChatGPT 5