Rosetta Problems

Two Alpinists

https://atcoder.jp/contests/code-festival-2016-qualc/tasks/codefestival_2016_qualC_c