6863.Moving Robots

Time Limit: 1s Memory Limit: 512MB

Each square of an $8 \times 8$ chessboard has a robot. Each robot independently moves $k$ steps, and there can be many robots on the same square.

On each turn, a robot moves one step left, right, up or down, but not outside the board. It randomly chooses a direction among those where it can move.

Your task is to calculate the expected number of empty squares after $k$ turns.

Input Format(From the terminal/stdin)

The only input line has an integer $k$ .

  • $1 \le k \le 100$

Output Format(To the terminal/stdout)

Print the expected number of empty squares rounded to six decimal places (rounding half to even).

Sample Input

Copy
10
  \n

Sample Output

Copy
23.120740
         \n
Source: CSES, Mathematics, 1726

Submit

请先 登录

© 2025 FAQs