Rosetta Problems

Problem 1

https://atcoder.jp/contests/hokudai-hitachi2017-1/tasks/hitachi2017_1_a