CF712C Memory and De-Evolution
Solution Sketch
Key observation: It’s pretty hard to come up with the solution working from x to y. But, how about working your way back from y to x?
Hint: The next possible/best move is turn $(4, 4, 4)$ into $(4, 4, 7)$. Why 7? Because it’s in the range of $4 \leq x < 4 + 4 = 8$, which won’t form a degenerate triangle. Better yet, it’s the greatest among the range!
AC code
|
|