Rosetta Problems

Let's Play Tag

https://atcoder.jp/contests/arc129/tasks/arc129_f