Intuitive approach for CEOI Kangaroo?

Правка en1, от dino_merlin, 2023-10-07 00:07:18

The second task from day 1 of CEOI 2016 is a task which solution confuses me, not because it is hard to understand, but because of the fact that I cannot understand how someone could come up with it. When I read the official solution, it just looks like they shuffled some formulas around until they got an expression with an invariant with no real motivation for the process. Is there any, more intuitive approach for solving this problem? Thanks in advance.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский dino_merlin 2023-10-07 00:08:15 10 Tiny change: 's a task which solution confuses ' -> 's a task with a solution that confuses '
en1 Английский dino_merlin 2023-10-07 00:07:18 496 Initial revision (published)