Rosetta Problems

逻辑翻译

https://www.acwing.com/problem/content/2924