Rosetta Problems

The bottom of the ninth

https://atcoder.jp/contests/abc351/tasks/abc351_a