Question not clear

  1. What;s the condition that the guy has escaped from park?
  2. What’s the use of K ? Initial strength is S and what’s K?

s is the initial strenght with which it start
and when it move from all the rows with its strenght greater than 0 than it will escape
and is the final strength it will have after escaping