Rosetta Problems

Road of the King

https://atcoder.jp/contests/cf16-final/tasks/codefestival_2016_final_f