Rosetta Problems

Loong and Takahashi

https://atcoder.jp/contests/abc335/tasks/abc335_d