Rosetta Problems

Problem C

https://atcoder.jp/contests/hokudai-hitachi2019-2/tasks/hokudai_hitachi2019_2_a