410715: GYM104090 D Money Game

Memory Limit:1024 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Money Gametime limit per test1 secondmemory limit per test1024 megabytesinputstandard inputoutputstandard output

Putata and Budada are organizing a game with $$$n$$$ players. Each player has some deposit, which is a real number. Player $$$i$$$ has $$$a_i$$$ deposits in the beginning. During each round of the game, the followings happen in order:

  • Player $$$1$$$ gives player $$$2$$$ half of player $$$1$$$'s deposit.
  • Player $$$2$$$ gives player $$$3$$$ half of player $$$2$$$'s deposit.
  • ...
  • Player $$$n-1$$$ gives player $$$n$$$ half of player $$$n-1$$$'s deposit.
  • Player $$$n$$$ gives player $$$1$$$ half of player $$$n$$$'s deposit.

The $$$n$$$ players played this game for exactly $$$2022^{1204}$$$ rounds. Putata wonders how much deposit each player has after the game. Please write a program to answer his question.

Input

The first line contains an integer $$$n$$$ ($$$2\leq n\leq 10^5$$$), denoting the number of players.

The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ ($$$1\leq a_i \leq 10^6$$$), denoting the deposit player $$$i$$$ has in the beginning.

Output

Output one line with $$$n$$$ real numbers, denoting the deposit each player has after they played this game.

Your answer will be considered correct if its absolute or relative error does not exceed $$$10^{-6}$$$. Formally, let your answer be $$$a$$$, and the jury's answer be $$$b$$$. Your answer will be considered correct if $$$\frac{|a-b|}{\max(1,|b|)}\leq 10^{-6}$$$.

ExampleInput
2
4 2
Output
4.00 2.00
Note

During one round, the deposit they have changed as follows: $$$[4,2]\to [2,4] \to [4,2]$$$. Their deposit does not change after this round, so the answer is the same as the input.

加入题单

算法标签: