← Retour à l'épreuve

Kazakhstan FAIO 2024 · Énoncé

E. Ray is behaving bad

Mis en forme par IOAI Training à partir de l'original (BeksultanSagyndyk/faio-tasks, licence Apache-2.0). L'original fait foi.

https://contest.yandex.ru/contest/71291/problems/E/

Time limit: 1 second
Memory limit: 64 MB
Input: standard input or input.txt
Output: standard output or output.txt

Ray is on the first floor of a space station consisting of a single point.
The second and third floors are regular pentagons with only side edges (no diagonals).

  • The point on the first floor is connected by stairs to each vertex on the second floor.
  • Each vertex on the second floor is connected by stairs to its two neighboring vertices (adjacent along the pentagon).
  • Each vertex on the third floor is connected to two stairs coming from the second floor.
  • The fourth floor is a single point, and each vertex on the third floor is connected by a staircase to the fourth-floor point.

Ray moves continuously from vertex to vertex. Upon reaching any vertex, he chooses uniformly at random among all available outgoing stairs and traverses one staircase in one minute.

Task
What is the probability that Ray reaches the fourth floor in 3 minutes?
Print the answer as a decimal fraction (floating-point number).

Input
No input.

Output
Print the probability as a floating-point number.