↓のQ4の解き方わかる人いたら、教えてほしいです、、、

https://procon.disco.co.jp/backnumber/hiroshima2017/index.html#Q4_jump