⚡ Build the skills to land top-paying quant jobs. Offer ends in 30d 01h 37m 15s30 days 1 hours 37 minutes 15 seconds.
Eight points P1, P2, …, P8 stand in a straight row, equally spaced, in this order. Each point has an altitude (a real number):
| point | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 |
|---|---|---|---|---|---|---|---|---|
| altitude | 8 | 11 | 9 | 11 | 9 | 9 | 1 | 11 |
altitude
11 | o o o
10 |
9 | o o o
8 | o
... |
1 | o
+--------------------------------------------------
P1 P2 P3 P4 P5 P6 P7 P8A knight arrives at P1 at time 0 and wants to reach P8.
Jumps. Think of each point Pk as the point (k, altitude of Pk) in a vertical plane. A jump must be an ordinary chess-knight move in that plane. From Pk the knight may jump to Pj only if one of these holds at the moment of the jump:
The altitudes compared are the current ones, which may be fractional or negative; a jump onto a point of any altitude, including a negative or fractional one, is allowed as long as the difference is exact. Jumps take no time.
Sinking. Before each jump the knight may wait at its current point for any length of time t ≥ 0 (t may be fractional). Suppose the knight is on a point of altitude A when the wait begins. The moving class is the set of all points whose altitude equals A at that moment. It includes the knight's own point, and it includes points already visited as well as unvisited ones. Let n be the number of points in the moving class. While the knight waits:
The set of moving points and the value of n are fixed when the wait begins; they do not change during the wait, even if other points reach altitude A meanwhile. Altitudes may become fractional or negative, and all changes persist for the rest of the tour.
Other rules.
A tour is written as a list of moves (t, P): wait t minutes, then jump to P.
Question. What is the longest possible total time of a tour from P1 to P8?
Answer format: a single number of minutes.