Rosetta Problems

ABC Ultimatum

https://atcoder.jp/contests/agc055/tasks/agc055_d