Rosetta Problems

Chokudai's Demand(★5)

https://atcoder.jp/contests/typical90/tasks/typical90_ci