Dodecahedron#4888

Dodecahedron

1 Sekunde
64 Megabyte
Schwer

A dodecahedron is a regular polyhedron with faces, each of which is a regular pentagon. Two tokens are placed on some faces of a dodecahedron (possibly on the same face); they are trying to capture a moving target, which is also placed on one of the dodecahedron's faces. The process proceeds in turns: first, one of the tokens (either one) moves, then the target moves. Each move consists of moving to a neighboring face, where two faces are neighbors if they share a common edge. Staying on the same face during a move is not allowed. Moves repeat until the target is captured. If the target moves to a face occupied by a token during its move, it will be captured on the next move of the token. If a token moves to the face where the target is during its move, the target is captured immediately.

Eingabe

The distance between the two tokens on the dodecahedron is given. The distance is defined as the minimum number of moves required for one token to reach the same face as the other.

Ausgabe

Output the maximum number of moves required to guarantee that the target is captured, regardless of its starting position on the dodecahedron. The tokens always know the target's location, and vice versa. The tokens are always aware of each other's positions.

Beispiele

Beispiel 1

Loading
Loading