Rosetta Problems

Exchange Game

https://atcoder.jp/contests/abc380/tasks/abc380_f