Rosetta Problems

Achieve the Goal

https://atcoder.jp/contests/abc151/tasks/abc151_b