Rosetta Problems

Coming of Age Celebration

https://atcoder.jp/contests/abc388/tasks/abc388_d